Skip to content

Commit

Permalink
Merge PR #525 into 14.0
Browse files Browse the repository at this point in the history
Signed-off-by sebastienbeau
  • Loading branch information
OCA-git-bot committed Nov 14, 2023
2 parents e65e72a + f6c08dc commit 128643b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 5 additions & 5 deletions account_invoice_inter_company/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,12 @@ def create_counterpart_invoices(self):
# nor the invoices that were already validated in the past
dest_company = src_invoice._find_company_from_invoice_partner()
if dest_company:
intercompany_user = dest_company.intercompany_invoice_user_id
if intercompany_user:
src_invoice = src_invoice.with_user(intercompany_user).sudo()
else:
src_invoice = src_invoice.sudo()
if not src_invoice.auto_generated:
intercompany_user = dest_company.intercompany_invoice_user_id
if intercompany_user:
src_invoice = src_invoice.with_user(intercompany_user).sudo()
else:
src_invoice = src_invoice.sudo()
src_invoice.with_company(dest_company.id).with_context(
skip_check_amount_difference=True
)._inter_company_create_invoice(dest_company)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,8 @@ def test_purchase_attachement_in_invoice(self):
)
self.assertEqual(len(bill_a_pdf), 1)
self.assertEqual(bill_a_pdf.name, invoice_company_b.name + ".pdf")
invoice_company_b.button_cancel()
invoice_company_b.action_post()

def _confirm_invoice_with_product(self):
# Confirm the invoice of company A
Expand Down

0 comments on commit 128643b

Please sign in to comment.