Skip to content

Commit

Permalink
[FIX] pre-commit: fix pre-commit issues
Browse files Browse the repository at this point in the history
  • Loading branch information
alan196 committed Mar 11, 2023
1 parent 781ccfb commit c3561ba
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 12 deletions.
17 changes: 12 additions & 5 deletions purchase_operating_unit/models/purchase_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,18 @@ def _check_company_operating_unit(self):

def _prepare_invoice(self):
invoice_vals = super()._prepare_invoice()
journal = self.env["account.journal"].search([("operating_unit_id", "=", self.operating_unit_id.id), ("type", "=", "purchase")])
invoice_vals.update({
"operating_unit_id": self.operating_unit_id.id,
"journal_id": journal.id,
})
journal = self.env["account.journal"].search(
[
("operating_unit_id", "=", self.operating_unit_id.id),
("type", "=", "purchase"),
]
)
invoice_vals.update(
{
"operating_unit_id": self.operating_unit_id.id,
"journal_id": journal.id,
}
)
return invoice_vals


Expand Down
4 changes: 3 additions & 1 deletion sale_operating_unit/models/sale_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,7 @@ class SaleOrderLine(models.Model):
_inherit = "sale.order.line"

operating_unit_id = fields.Many2one(
related="order_id.operating_unit_id", string="Operating Unit", store=True,
related="order_id.operating_unit_id",
string="Operating Unit",
store=True,
)
2 changes: 1 addition & 1 deletion sale_operating_unit/wizard/sale_make_invoice_advance.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from odoo import models
from odoo import _, models
from odoo.exceptions import ValidationError


Expand Down
6 changes: 1 addition & 5 deletions sale_stock_operating_unit/models/stock_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ def _get_new_picking_values(self):
"""
values = super(StockMove, self)._get_new_picking_values()

values.update(
{
"operating_unit_id": self.operating_unit_id.id
}
)
values.update({"operating_unit_id": self.operating_unit_id.id})

return values

0 comments on commit c3561ba

Please sign in to comment.