update translate,update common

This commit is contained in:
ivan deng
2021-07-27 00:02:24 +08:00
parent bbdefaccf5
commit 4715d0df65
2 changed files with 4 additions and 2 deletions

View File

@@ -14,14 +14,15 @@ class MrpWorkCenter(models.Model):
_parent_name = "parent_id" _parent_name = "parent_id"
_parent_store = True _parent_store = True
_parent_order = 'code' _parent_order = 'code'
_order = 'parent_path, code'
parent_id = fields.Many2one('mrp.workcenter', 'Parent WC', index=True, ondelete='cascade') parent_id = fields.Many2one('mrp.workcenter', 'Parent WC', index=True, ondelete='restrict')
parent_path = fields.Char(index=True) parent_path = fields.Char(index=True)
child_ids = fields.One2many('mrp.workcenter', 'parent_id', 'Child WCs') child_ids = fields.One2many('mrp.workcenter', 'parent_id', 'Child WCs')
child_all_count = fields.Integer( child_all_count = fields.Integer(
'Indirect Surbordinates Count', 'Indirect Surbordinates Count',
compute='_compute_child_all_count', store=False) compute='_compute_child_all_count', store=False)
level = fields.Integer('Level', compute='_compute_level', inverse=False, default=0, readonly=True, store=True) level = fields.Integer('Level', compute='_compute_level', inverse=False, readonly=True, store=True)
@api.depends('child_ids.child_all_count') @api.depends('child_ids.child_all_count')
def _compute_child_all_count(self): def _compute_child_all_count(self):

View File

@@ -9,6 +9,7 @@
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//search"> <xpath expr="//search">
<searchpanel view_types="tree"> <searchpanel view_types="tree">
<field name="code"/>
<field name="warehouse_id" groups="stock.group_stock_multi_warehouses"/> <field name="warehouse_id" groups="stock.group_stock_multi_warehouses"/>
</searchpanel> </searchpanel>
</xpath> </xpath>