تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
3807 أدوات العرض

I create 3 models

class RealUnit(models.Model):
_name = 'real.units'
real_id = fields.Many2one('real.realstate', 'Real State', ondelete='cascade')
unit_no = fields.Char('Unit No.')
rented = fields.Boolean('Rented')
class RealContractUnit(models.Model):
_name = 'real.contract_units'
real_id = fields.Many2one('real.realstate', 'Real State', ondelete='restrict')
unit_id = fields.Many2one('real.units', 'Unit', ondelete='restrict', domain="[('real_id', '=', real_id)]")
class RealContract(models.Model):
_name = 'real.contracts'
cont_no = fields.Char('Contract No.', index=True, search='_search_function',
filter_domain="[('cont_no','ilike',self)]", required=True)
real_id = fields.Many2one('real.realstate', 'Real State.', ondelete='restrict', required=True)
units = fields.One2many('real.contract_units', 'cont_id', 'Units')

I want update rented flag to set it false  for all units  deleted from one2many table in contract view 

I don't know if I can use unlike function to do it and how implement 

Thanks



الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
0
نوفمبر 22
4230
1
مارس 21
2408
3
يوليو 20
17622
2
أبريل 20
4318
6
أغسطس 19
63910