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

[14.0][ADD] account_payment_order_inter_company #383

Conversation

chafique-delli
Copy link
Contributor

No description provided.

@chafique-delli chafique-delli force-pushed the 14.0-ADD-account_payment_order_inter_company branch 3 times, most recently from e53f5ae to 049c4ee Compare September 22, 2022 13:58
@chafique-delli
Copy link
Contributor Author

@sebastienbeau


def test_customer_invoice_is_paid_in_company_a(self):
# Confirm the customer invoice in company A
self.invoice_company_a.with_user(self.user_company_a.id).with_context(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Chafique test are good but can you simplify the code between the two test can you create the follwoing method

  • "_create_intercompany_customer_invoice"
  • "_pay_invoice(invoice, journal, payment_mode"
    So you can share code between the two test and make them perfect ?

Also we need two new case.
Creating a supplier invoice in Company B and this will create a customer invoice in company A, then pay it from

  • company B supplier invoice
  • company A customer invoice

Thanks

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sebastienbeau , I made the requested changes.

@chafique-delli chafique-delli force-pushed the 14.0-ADD-account_payment_order_inter_company branch from 049c4ee to 8464940 Compare September 23, 2022 13:55
vals2 = {}
vals = {
"journal_id": journal.id,
"move_id": invoice.id,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning you are adding new line in the invoice move !!
you need to create a new move with all payment line

(
"bank_account_id",
"=",
payment_line.partner_bank_id.id,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

match with the partner_bank_id.sanitized_acc_number.
This will solve case where the res.partner.bank are not shared but have the same value.

vals = {
"journal_id": journal.id,
"move_id": invoice.id,
"partner_id": invoice.partner_id.id,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not use partner_id !! Use commercial_partner_id !!

"credit": 0.0,
"debit": payment_line.amount_currency,
}
if vals1 and vals2:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

too complexe

@chafique-delli chafique-delli force-pushed the 14.0-ADD-account_payment_order_inter_company branch from 3ebcf11 to f921aee Compare January 24, 2023 15:15
@github-actions
Copy link

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label May 28, 2023
@github-actions github-actions bot closed this Jul 2, 2023
@chafique-delli
Copy link
Contributor Author

new PR: #516

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale PR/Issue without recent activity, it'll be soon closed automatically.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants