Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX purchase order line price in intercompany #14

Open
wants to merge 1 commit into
base: 16.0-add-sale_purchase_inter_company
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading