1
This commit is contained in:
@@ -80,9 +80,7 @@ class HrContract(models.Model):
|
||||
contact = fields.Char(related="party_id.contact", string="联系人")
|
||||
phone = fields.Char(related="party_id.phone", string="电话")
|
||||
documents_ids = fields.Many2many("ir.attachment", string="合同附件")
|
||||
current_contract = fields.Boolean(
|
||||
string="当前合同", default=True, compute="_compute_current_contract", store=True
|
||||
)
|
||||
current_contract = fields.Boolean(string="当前合同", default=True, compute="_compute_current_contract", store=True)
|
||||
is_company = fields.Boolean(
|
||||
string="本公司",
|
||||
default=True,
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='employee_id']" position="attributes">
|
||||
<attribute name="widget">false</attribute>
|
||||
<attribute name="options">"{'no_open': True}"</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='company_id']" position="attributes">
|
||||
<attribute name="column_invisible">1</attribute>
|
||||
@@ -63,11 +62,10 @@
|
||||
<attribute name="invisible">1</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='employee_id']" position="attributes">
|
||||
<attribute name="widget">false</attribute>
|
||||
<attribute name="options">"{'no_open': True}"</attribute>
|
||||
<attribute name="widget">false</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='code']" position="after">
|
||||
<field name="is_annual_salary"/>
|
||||
<field name="is_annual_salary"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='date_end']" position="after">
|
||||
<field name="is_probation"/>
|
||||
@@ -79,7 +77,7 @@
|
||||
<field name="termination_date"/>
|
||||
<field name="reason_suspension" required="termination_date" invisible="not termination_date"/>
|
||||
<field name="salary_day" invisible="not is_internship"/>
|
||||
<field name="salary_group_id" options="{'no_create': True, 'no_open': True}"/>
|
||||
<field name="salary_group_id" options="{'no_create': True}"/>
|
||||
<field name="is_internship" invisible="1"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='resource_calendar_id']" position="attributes">
|
||||
@@ -90,7 +88,7 @@
|
||||
</xpath>
|
||||
<xpath expr="//group[@name='top_info']" position="before">
|
||||
<group string="甲方信息">
|
||||
<field name="party_id" options="{'no_open': True}"/>
|
||||
<field name="party_id"/>
|
||||
<field name="representatives"/>
|
||||
<field name="economy_type"/>
|
||||
<field name="address"/>
|
||||
@@ -121,19 +119,19 @@
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_hr_contract_search_inherit" model="ir.ui.view">
|
||||
<field name="name">hr.contract.search.inherit</field>
|
||||
<field name="model">hr.contract</field>
|
||||
<field name="inherit_id" ref="hr_contract.hr_contract_view_search"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//filter[@name='running']" position="after">
|
||||
<filter name="current_contract" string="当前合同" domain="[('current_contract', '=', True)]"/>
|
||||
</xpath>
|
||||
<xpath expr="//filter[@name='group_by_employee']" position="after">
|
||||
<filter name="group_salary_group_id" string="工资单分组" context="{'group_by':'salary_group_id'}"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
<!-- <record id="view_hr_contract_search_inherit" model="ir.ui.view">-->
|
||||
<!-- <field name="name">hr.contract.search.inherit</field>-->
|
||||
<!-- <field name="model">hr.contract</field>-->
|
||||
<!-- <field name="inherit_id" ref="hr_contract.hr_contract_view_search"/>-->
|
||||
<!-- <field name="arch" type="xml">-->
|
||||
<!-- <xpath expr="//filter[@name='running']" position="after">-->
|
||||
<!-- <filter name="current_contract" string="当前合同" domain="[('current_contract', '=', True)]"/>-->
|
||||
<!-- </xpath>-->
|
||||
<!-- <xpath expr="//filter[@name='group_by_employee']" position="after">-->
|
||||
<!-- <filter name="group_salary_group_id" string="工资单分组" context="{'group_by':'salary_group_id'}"/>-->
|
||||
<!-- </xpath>-->
|
||||
<!-- </field>-->
|
||||
<!-- </record>-->
|
||||
<record id="all_data_write_user_contract" model="ir.actions.server">
|
||||
<field name="name">批量导入合同</field>
|
||||
<field name="model_id" ref="hr_contract.model_hr_contract"/>
|
||||
|
||||
@@ -49,14 +49,9 @@ class PropertyMeterArchives(models.Model):
|
||||
def create(self, vals):
|
||||
record = super().create(vals)
|
||||
if "name" in vals and vals["name"]:
|
||||
existing_records = self.search([
|
||||
("name", "=", vals["name"]),
|
||||
("id", "!=", record.id)
|
||||
])
|
||||
existing_records = self.search([("name", "=", vals["name"]), ("id", "!=", record.id)])
|
||||
if existing_records:
|
||||
raise ValidationError(
|
||||
f"仪表编号 '{vals['name']}' 已存在,请使用其他编号!"
|
||||
)
|
||||
raise ValidationError(f"仪表编号 '{vals['name']}' 已存在,请使用其他编号!")
|
||||
return record
|
||||
|
||||
@api.onchange("name")
|
||||
|
||||
Reference in New Issue
Block a user