Update internal_transaction.py
This commit is contained in:
parent
b006a1880b
commit
ec10c699ba
|
|
@ -25,24 +25,6 @@ class InternalTransaction(models.Model):
|
|||
|
||||
to_ids = fields.Many2one(comodel_name='cm.entity', string='Send To')
|
||||
|
||||
@api.onchange('type_sender')
|
||||
def _onchange_type_sender(self):
|
||||
# تعيين الدومين لحقل to_ids بناءً على النوع المختار
|
||||
if self.type_sender == 'unit':
|
||||
return {
|
||||
'domain': {'to_ids': [('type', '=', 'unit')]}
|
||||
}
|
||||
elif self.type_sender == 'employee':
|
||||
return {
|
||||
'domain': {'to_ids': [('type', '=', 'employee')]}
|
||||
}
|
||||
|
||||
# إعادة تعيين القيم بعد تغيير الدومين
|
||||
if self.to_ids:
|
||||
self.to_ids = False
|
||||
if self.partner_id:
|
||||
self.partner_id = False
|
||||
|
||||
|
||||
partner_id = fields.Many2one('res.partner', string='Partner', readonly=True,
|
||||
related='to_ids.secretary_id.partner_id')
|
||||
|
|
|
|||
Loading…
Reference in New Issue