add event fields

This commit is contained in:
blackbelts 2025-05-18 17:40:51 +03:00
parent b828bbb370
commit 9e85779e9f
2 changed files with 46 additions and 1 deletions

View File

@ -24,6 +24,39 @@ class Event(models.Model):
state_id = fields.Many2one("res.country.state", string='State', ondelete='restrict',
domain="[('country_id', '=?', country_id)]", related="address_id.state_id", readonly=True)
country_id = fields.Many2one('res.country', string='Country', ondelete='restrict', related="address_id.country_id", readonly=True)
job_title = fields.Many2one(
string='المنصب الوظيفي',
related='user_id.employee_id.job_id',
store=True,
readonly=True
)
department_id = fields.Many2one(
'hr.department',
string='الإدارة',
related='user_id.employee_id.department_id',
store=True,
readonly=True
)
branch_name = fields.Many2one(
string='الفرع التابع للإدارة',
related='user_id.employee_id.department_id.branch_name',
store=True,
readonly=True
)
departments_id = fields.Many2one(
'hr.department',string='الإدارة التابع لها الفعالية'
)
branchs_name = fields.Many2one(
string='الفرع التابع للإدارة',
related='departments_id.branch_name',
store=True,
readonly=True
)
@api.depends('date_begin', 'date_end')
def _compute_remaining_time(self):

View File

@ -21,9 +21,21 @@
<field name="remaining_days"/>
<field name="remaining_hours"/>
</xpath>
<xpath expr="//field[@name='tag_ids']" position="after">
<field name="Description_event"/>
</xpath>
<xpath expr="//field[@name='user_id']" position="after">
<field name="job_title"/>
<field name="department_id"/>
<field name="branch_name"/>
</xpath>
<xpath expr="//field[@name='event_type_id']" position="before">
<field name="departments_id"/>
<field name="branchs_name"/>
</xpath>
<xpath expr="//field[@name='address_id']" position="attributes">
<attribute name="context">{'show_address': 1, 'default_is_event_address': True,'default_is_company':
True}