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

[16.0][FIX] check if sale come from intercompany purchase #12

Open
wants to merge 1 commit into
base: 16.0-add-sale_purchase_inter_company
Choose a base branch
from
Open
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
15 changes: 12 additions & 3 deletions sale_purchase_inter_company/models/sale_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,18 @@ def action_confirm(self):
# intercompany relation
dest_company = sale_order.partner_id.commercial_partner_id.ref_company_ids
if dest_company and dest_company.po_from_so:
sale_order.with_company(
dest_company.id
)._inter_company_create_purchase_order(dest_company)
# ensure compatibility with sale_purchase_inter_company
# module
create_purchase_order = False
if "auto_purchase_order_id" in self._fields:
if not sale_order.auto_purchase_order_id:
create_purchase_order = True
else:
create_purchase_order = True
if create_purchase_order:
sale_order.with_company(
dest_company.id
)._inter_company_create_purchase_order(dest_company)
return res

def _get_user_domain(self, dest_company):
Expand Down
Loading