Skip to content

Commit

Permalink
FIX purchase order line price in intercompany
Browse files Browse the repository at this point in the history
  • Loading branch information
Kev-Roche committed Jun 26, 2024
1 parent df2f5b0 commit 4e96b2c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion sale_purchase_inter_company/models/purchase_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def button_approve(self, force=False):
for order in self.filtered("auto_sale_order_id"):
for line in order.order_line.sudo():
if line.auto_sale_line_id:
line.auto_sale_line_id.price_unit = line.price_unit
line.price_unit = line.auto_sale_line_id.price_unit
return super().button_approve(force)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,11 @@ def test_cancel_confirmed_so_po(self):
with self.assertRaises(UserError):
self.sale_company_a.with_user(self.user_company_a).action_cancel()

def test_po_change_price(self):
def test_so_change_price(self):
self.sale_company_a.order_line.price_unit = 10
purchase = self._confirm_so()
purchase.order_line.price_unit = 10
purchase.button_approve()
self.assertEqual(self.sale_company_a.order_line.price_unit, 10)
self.assertEqual(purchase.order_line.price_unit, 10)

def test_so_with_contact_as_partner(self):
contact = self.env["res.partner"].create(
Expand Down

0 comments on commit 4e96b2c

Please sign in to comment.