[FIX] account: Remove supplier/customer in default_partner_type
The fields supplier/customer was removed from the partner, then, they
cannot be used in the default for the views.
Avoid the next traceback in the next case:
'''raise ValueError("Invalid field %r in leaf %r" % (left, str(leaf)))
ValueError: Invalid field 'supplier' in leaf "<osv.ExtendedLeaf: ('supplier', '=', True) on res_partner (ctx: )>"```
1. Go to create a new payment for supplier
2. Try select the supplier
closes odoo/odoo#35743
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This commit is contained in:
@@ -213,13 +213,6 @@ class account_payment(models.Model):
|
||||
self.partner_bank_account_id = False
|
||||
return {'domain': {'partner_bank_account_id': [('partner_id', 'in', [self.partner_id.id, self.partner_id.commercial_partner_id.id])]}}
|
||||
|
||||
@api.onchange('partner_type')
|
||||
def _onchange_partner_type(self):
|
||||
self.ensure_one()
|
||||
# Set partner_id domain
|
||||
if self.partner_type:
|
||||
return {'domain': {'partner_id': [(self.partner_type, '=', True)]}}
|
||||
|
||||
@api.onchange('payment_type')
|
||||
def _onchange_payment_type(self):
|
||||
if not self.invoice_ids and not self.partner_type:
|
||||
|
||||
Reference in New Issue
Block a user