Skip to content

Conversation

@alexis-via
Copy link
Contributor

FIX form view of account.move
Replace python constraint by check_company=True on payment_mode_id of account.move

@pedrobaeza pedrobaeza added this to the 14.0 milestone Dec 27, 2020
@pedrobaeza
Copy link
Member

Please check Travis

@StefanRijnhart
Copy link
Member

StefanRijnhart commented Jan 4, 2021

Travis agrees that this change improves the consistency of the data :-)

Traceback (most recent call last):
  File "/home/travis/build/OCA/bank-payment/setup/account_payment_partner/odoo/addons/account_payment_partner/tests/test_account_payment_partner.py", line 297, in test_invoice_constrains
    "payment_mode_id": self.supplier_payment_mode_c2.id,
...
  File "/home/travis/OCB-14.0/odoo/models.py", line 3900, in create
    records._check_company()
  File "/home/travis/OCB-14.0/odoo/models.py", line 3321, in _check_company
    raise UserError("\n".join(lines))
odoo.exceptions.UserError: Incompatible companies on records:
- 'Draft Bill MISC/2020/12/0001' belongs to company 'YourCompany' and 'Payment Mode' (payment_mode_id: 'Suppliers Bank 2') elongs to another company.

@pedrobaeza
Copy link
Member

No news on this?

@pedrobaeza
Copy link
Member

@alexis-via are you going to fix this PR?

Replace python constraint by check_company=True on payment_mode_id of account.move
@alexis-via alexis-via force-pushed the 14-fix-account_payment_partner branch from 179bf5c to 0800cec Compare February 1, 2021 09:34
@alexis-via
Copy link
Contributor Author

I updated the tests (raises UserError instead of ValidationError). The tests work on my laptop ; Travis should be green this time.

expr="//div[field[@name='invoice_payment_term_id']]"
position="after"
>
<field name="partner_bank_id" position="before">
Copy link
Member

Choose a reason for hiding this comment

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

You are moving this to a place that is not always shown (I don't see it in customer invoices) and not in main section. Please put it before journal_id instead.

@alexis-via
Copy link
Contributor Author

alexis-via commented Feb 4, 2021

@pedrobaeza I don't understand your last remark. This is the view I have on customer invoices:

customer_invoice

@pedrobaeza
Copy link
Member

I don't see anything with your debug mode activated and overlapping the screenshot. Can you repeat it?

@alexis-via
Copy link
Contributor Author

Sorry about this bad screenshot. Here is a better one
fac_client2

@pedrobaeza
Copy link
Member

I'm not seeing "Recipient Bank" in runbot, but OK if it's always show in that position.

/ocabot merge minor

@OCA-git-bot
Copy link
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 14.0-ocabot-merge-pr-765-by-pedrobaeza-bump-minor, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 513108c into OCA:14.0 Feb 4, 2021
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at 92c82e1. Thanks a lot for contributing to OCA. ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants