STR:
1. Install `partner_multi_company`
2. Install `product_multi_company`
3. Install `hr_expense`
4. Install and test `account_payment_partner`
Error:
```
2023-04-05 09:12:48,641 72 ERROR odoo unittest.suite: ERROR: setUpClass (odoo.addons.account_payment_partner.tests.test_account_payment_partner.TestAccountPaymentPartner)
Traceback (most recent call last):
File "/opt/odoo/auto/addons/account_payment_partner/tests/test_account_payment_partner.py", line 35, in setUpClass
cls.env.user.company_id = cls.company_2.id
File "/opt/odoo/custom/src/odoo/odoo/fields.py", line 1150, in __set__
records.write({self.name: write_value})
File "/opt/odoo/auto/addons/pos_blackbox_be/models/res_users.py", line 55, in write
return super(ResUser, self).write(values)
File "/opt/odoo/auto/addons/website_slides/models/res_users.py", line 19, in write
res = super(Users, self).write(vals)
File "/opt/odoo/auto/addons/helpdesk/models/res_users.py", line 45, in write
return super().write(vals)
File "/opt/odoo/auto/addons/hr/models/res_users.py", line 189, in write
result = super(User, self).write(vals)
File "/opt/odoo/auto/addons/gamification/models/res_users.py", line 63, in write
result = super(Users, self).write(vals)
File "/opt/odoo/auto/addons/mail/models/res_users.py", line 88, in write
write_res = super(Users, self).write(vals)
File "/opt/odoo/auto/addons/partner_multi_company/models/res_users.py", line 28, in write
user.partner_id.company_ids = [(4, vals["company_id"])]
File "/opt/odoo/custom/src/odoo/odoo/fields.py", line 1150, in __set__
records.write({self.name: write_value})
File "/opt/odoo/auto/addons/sale_subscription/models/res_partner.py", line 14, in write
res = super().write(vals)
File "/opt/odoo/auto/addons/payment_sepa_direct_debit/models/partner.py", line 18, in write
res = super().write(vals)
File "/opt/odoo/auto/addons/mass_mailing_partner/models/res_partner.py", line 74, in write
res = super().write(vals)
File "/opt/odoo/auto/addons/base_vat/models/res_partner.py", line 643, in write
return super(ResPartner, self).write(values)
File "/opt/odoo/auto/addons/snailmail/models/res_partner.py", line 26, in write
return super(ResPartner, self).write(vals)
File "/opt/odoo/auto/addons/partner_autocomplete/models/res_partner.py", line 199, in write
res = super(ResPartner, self).write(values)
File "/opt/odoo/auto/addons/base_multi_company/models/multi_company_abstract.py", line 74, in write
return super().write(vals)
File "/opt/odoo/auto/addons/partner_contact_lang/models/res_partner.py", line 13, in write
res = super(ResPartner, self).write(vals)
File "/opt/odoo/auto/addons/base_address_extended/models/res_partner.py", line 127, in write
res = super(Partner, self).write(vals)
File "/opt/odoo/custom/src/odoo/odoo/addons/base/models/res_partner.py", line 560, in write
partner._fields_sync(vals)
File "/opt/odoo/custom/src/odoo/odoo/addons/base/models/res_partner.py", line 479, in _fields_sync
self._children_sync(values)
File "/opt/odoo/custom/src/odoo/odoo/addons/base/models/res_partner.py", line 488, in _children_sync
self._commercial_sync_to_children()
File "/opt/odoo/custom/src/odoo/odoo/addons/base/models/res_partner.py", line 461, in _commercial_sync_to_children
res = sync_children.write(sync_vals)
File "/opt/odoo/auto/addons/sale_subscription/models/res_partner.py", line 14, in write
res = super().write(vals)
File "/opt/odoo/auto/addons/payment_sepa_direct_debit/models/partner.py", line 18, in write
res = super().write(vals)
File "/opt/odoo/auto/addons/mass_mailing_partner/models/res_partner.py", line 74, in write
res = super().write(vals)
File "/opt/odoo/auto/addons/base_vat/models/res_partner.py", line 643, in write
return super(ResPartner, self).write(values)
File "/opt/odoo/auto/addons/snailmail/models/res_partner.py", line 26, in write
return super(ResPartner, self).write(vals)
File "/opt/odoo/auto/addons/partner_autocomplete/models/res_partner.py", line 199, in write
res = super(ResPartner, self).write(values)
File "/opt/odoo/auto/addons/base_multi_company/models/multi_company_abstract.py", line 74, in write
return super().write(vals)
File "/opt/odoo/auto/addons/partner_contact_lang/models/res_partner.py", line 13, in write
res = super(ResPartner, self).write(vals)
File "/opt/odoo/auto/addons/base_address_extended/models/res_partner.py", line 127, in write
res = super(Partner, self).write(vals)
File "/opt/odoo/custom/src/odoo/odoo/addons/base/models/res_partner.py", line 556, in write
result = result and super(Partner, self).write(vals)
File "/opt/odoo/auto/addons/mail/models/mail_activity.py", line 788, in write
return super(MailActivityMixin, self).write(vals)
File "/opt/odoo/auto/addons/mail/models/mail_thread.py", line 322, in write
result = super(MailThread, self).write(values)
File "/opt/odoo/auto/addons/website/models/mixins.py", line 205, in write
return super(WebsitePublishedMixin, self).write(values)
File "/opt/odoo/custom/src/odoo/odoo/models.py", line 3730, in write
self._check_company()
File "/opt/odoo/custom/src/odoo/odoo/models.py", line 3335, in _check_company
raise UserError("\n".join(lines))
odoo.exceptions.UserError: Incompatible companies on records:
- "OdooBot, Pieter Parter's Farm" belongs to company 'Company 2' and 'Supplier Payment Mode' (supplier_payment_mode_id: 'Credit Transfer to Suppliers') belongs to another company.
- "OdooBot, Pieter Parter's Farm" belongs to company 'Company 2' and 'Customer Payment Mode' (customer_payment_mode_id: 'Inbound Credit Trf Société Générale') belongs to another company.
```
With this change, the test is simpler and won't make that side effect.
@moduon MT-2638
Add columns to avoid Memory error on an existing Odoo instance
with lots of data.
The payment_mode_id fields are introduced by this module and computed only
from each other or the also newly introduced supplier_payment_mode_id and
customer_payment_mode_id on res.partner, so they can stay NULL, nothing
to compute.
Complement of 998f8df6aa254266c015fab144ba290e1a386cf0
Extend the editability to the journal entry (account.move), taking
as criteria if there's no reconciliation made, which is the definitory
one.
It includes test for this new feature, both the mode propagation and
the editability check.
TT39850
This field was editable in previous version before invoice > move
refactoring, and it's logic to allow to change payment mode once the
invoice has been posted without the need of resetting it to draft.
Thus, the field has been changed to computed writable field, taking care
of the consequences at model level (compute) and view level (add the
field in views + proper attrs).
This commits adds tracking=True to the payment mode field as well to be
aware when and who the payment mode is changed in the invoice, no matter
if directly changed in draft, or through the change on the journal item.
TT39850
This error is happening because the salesperson has not access to payment_method_id.
With this changes we avoid the error and the invoices are printed like normally.
TT31296