Update internal_transaction.py
This commit is contained in:
parent
c39a810704
commit
51e9ff1491
|
|
@ -27,11 +27,14 @@ class InternalTransaction(models.Model):
|
|||
|
||||
@api.onchange('type_sender')
|
||||
def _onchange_type_sender(self):
|
||||
if self.to_ids:
|
||||
self.ensure_one()
|
||||
if self.type_sender == 'unit' and self.to_ids and self.to_ids.type != 'unit':
|
||||
self.to_ids = False
|
||||
if self.partner_id:
|
||||
self.partner_id =False
|
||||
|
||||
self.partner_id = False
|
||||
elif self.type_sender == 'employee' and self.to_ids and self.to_ids.type != 'employee':
|
||||
self.to_ids = False
|
||||
self.partner_id = False
|
||||
|
||||
partner_id = fields.Many2one('res.partner', string='Partner', readonly=True,
|
||||
related='to_ids.secretary_id.partner_id')
|
||||
cc_ids = fields.Many2many(comodel_name='cm.entity', relation='internal_entity_cc_rel',
|
||||
|
|
|
|||
Loading…
Reference in New Issue