测试异常问题修复
This commit is contained in:
@@ -254,6 +254,14 @@ class SfShelf(models.Model):
|
|||||||
shelf_layer = fields.Integer(string='货架层数')
|
shelf_layer = fields.Integer(string='货架层数')
|
||||||
layer_capacity = fields.Integer(string='层数容量')
|
layer_capacity = fields.Integer(string='层数容量')
|
||||||
|
|
||||||
|
# 是否有货位
|
||||||
|
is_there_area = fields.Boolean(string='是否有货位', compute='_compute_is_there_area', default=False, store=True)
|
||||||
|
|
||||||
|
@api.depends('location_ids')
|
||||||
|
def _compute_is_there_area(self):
|
||||||
|
for record in self:
|
||||||
|
record.is_there_area = bool(record.location_ids)
|
||||||
|
|
||||||
@api.onchange('shelf_location_id')
|
@api.onchange('shelf_location_id')
|
||||||
def _onchange_shelf_location_id(self):
|
def _onchange_shelf_location_id(self):
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -8,7 +8,8 @@
|
|||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<form string="Sf Shelf">
|
<form string="Sf Shelf">
|
||||||
<header>
|
<header>
|
||||||
<button string="生成货位" name="create_location" type="object" class="oe_highlight"/>
|
<field name="is_there_area" invisible="1"/>
|
||||||
|
<button string="生成货位" name="create_location" type="object" class="oe_highlight" attrs="{'invisible': [('is_there_area', '=', True)]}"/>
|
||||||
</header>
|
</header>
|
||||||
<sheet>
|
<sheet>
|
||||||
<group>
|
<group>
|
||||||
|
|||||||
Reference in New Issue
Block a user