@@ -37,6 +37,14 @@ class YuthonOfficial(models.Model):
|
||||
'flat_id',
|
||||
string="抄送单位"
|
||||
)
|
||||
main_unit_type = fields.Selection([
|
||||
('gov', '行政事业单位'),
|
||||
('other', '其他单位')
|
||||
], string='主送单位类型')
|
||||
copy_unit_type = fields.Selection([
|
||||
('gov', '行政事业单位'),
|
||||
('other', '其他单位')
|
||||
], string='抄送单位类型')
|
||||
department_ids = fields.Many2many('hr.department', string='部门范围')
|
||||
employee_ids = fields.Many2many('hr.employee', string='人员范围')
|
||||
users_role_ids = fields.Many2many('soong.user.role', string='角色范围')
|
||||
@@ -183,6 +191,20 @@ class YuthonOfficial(models.Model):
|
||||
else:
|
||||
self.reference_cold = False
|
||||
|
||||
@api.onchange('main_flats_ids')
|
||||
def _onchange_main_flats_ids(self):
|
||||
if self.main_flats_ids:
|
||||
self.main_unit_type = self.main_flats_ids[0].unit_type
|
||||
else:
|
||||
self.main_unit_type = False
|
||||
|
||||
@api.onchange('copy_flats_ids')
|
||||
def _onchange_copy_flats_ids(self):
|
||||
if self.copy_flats_ids:
|
||||
self.copy_unit_type = self.copy_flats_ids[0].unit_type
|
||||
else:
|
||||
self.copy_unit_type = False
|
||||
|
||||
@api.onchange('company_id1')
|
||||
def onchange_company_id1(self):
|
||||
current_year = fields.Date.today().year
|
||||
@@ -422,6 +444,20 @@ class YuthonPropertyOfficial(models.Model):
|
||||
else:
|
||||
self.reference_cold = False
|
||||
|
||||
@api.onchange('main_flats_ids')
|
||||
def _onchange_main_flats_ids(self):
|
||||
if self.main_flats_ids:
|
||||
self.main_unit_type = self.main_flats_ids[0].unit_type
|
||||
else:
|
||||
self.main_unit_type = False
|
||||
|
||||
@api.onchange('copy_flats_ids')
|
||||
def _onchange_copy_flats_ids(self):
|
||||
if self.copy_flats_ids:
|
||||
self.copy_unit_type = self.copy_flats_ids[0].unit_type
|
||||
else:
|
||||
self.copy_unit_type = False
|
||||
|
||||
@api.onchange('company_id1')
|
||||
def onchange_company_id1(self):
|
||||
current_year = fields.Date.today().year
|
||||
|
||||
@@ -78,6 +78,8 @@
|
||||
<field name="reference_cold" invisible="not is_cold"/>
|
||||
<field name="main_flats_ids" options="{'no_create': True, 'no_open': True}" widget="many2many_tags"/>
|
||||
<field name="copy_flats_ids" options="{'no_create': True, 'no_open': True}" widget="many2many_tags"/>
|
||||
<field name="main_unit_type" invisible="1"/>
|
||||
<field name="copy_unit_type" invisible="1"/>
|
||||
<field name="date"/>
|
||||
<field name="issues_result" invisible="is_meet == False"/>
|
||||
</group>
|
||||
|
||||
Reference in New Issue
Block a user