权限
This commit is contained in:
@@ -450,6 +450,7 @@
|
||||
<field name="deposit" decoration-success="deposit_status == 'paid'"
|
||||
decoration-danger="deposit_status == 'unpaid'" decoration-muted="deposit_status == 'returned'"
|
||||
decoration-warning="deposit_status == 'no_paid'"/>
|
||||
<field name="not_tax_amount"/>
|
||||
<field name="rent"/>
|
||||
<field name="not_received" decoration-muted="comparison == 'equal'"
|
||||
decoration-danger="comparison == 'outweigh'"
|
||||
|
||||
@@ -23,6 +23,22 @@ class YuthonSealsApproval(models.Model):
|
||||
remake = fields.Text(string="用章意见")
|
||||
active = fields.Boolean('Active', default=True, tracking=True)
|
||||
work_end = fields.Boolean(string="结束")
|
||||
is_company = fields.Boolean(string="本公司", default=True, compute='_compute_is_company',
|
||||
search='_search_part_of_company')
|
||||
|
||||
def _compute_is_company(self):
|
||||
active_company_ids = self.env.companies
|
||||
for employee in self:
|
||||
employee.is_company = employee.company_id in active_company_ids
|
||||
|
||||
def _search_part_of_company(self, operator, value):
|
||||
company_ids = self.env.companies.ids
|
||||
if not value:
|
||||
operator = '!=' if operator == '=' else '='
|
||||
if operator == '=':
|
||||
return [('company_id', 'in', company_ids)]
|
||||
else:
|
||||
return [('company_id', 'not in', company_ids)]
|
||||
|
||||
def _get_default_name_title(self):
|
||||
return self._description if self._description else self._name
|
||||
|
||||
@@ -5,10 +5,10 @@
|
||||
<field name="model">yuthon.seals.approval</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="用章审批">
|
||||
<field name="name"/>
|
||||
<field name="users_id" options="{'no_create': True}"/>
|
||||
<field name="code"/>
|
||||
<field name="users_id" string="发起人" options="{'no_create': True}"/>
|
||||
<field name="name" string="标题"/>
|
||||
<field name="approval_unit"/>
|
||||
<field name="remake"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
@@ -63,6 +63,7 @@
|
||||
<record id="view_yuthon_seals_approval_action" model="ir.actions.act_window">
|
||||
<field name="name">用章审批</field>
|
||||
<field name="res_model">yuthon.seals.approval</field>
|
||||
<field name="domain">[('is_company','=',True)]</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user