修复货位问题
This commit is contained in:
@@ -279,7 +279,7 @@ class ShelfLocation(models.Model):
|
|||||||
('空闲', '空闲'),
|
('空闲', '空闲'),
|
||||||
('占用', '占用'),
|
('占用', '占用'),
|
||||||
('禁用', '禁用')
|
('禁用', '禁用')
|
||||||
], string='货位状态', default='空闲')
|
], string='货位状态', default='空闲', readonly=True)
|
||||||
# product_id = fields.Many2one('product.template', string='产品')
|
# product_id = fields.Many2one('product.template', string='产品')
|
||||||
product_id = fields.Many2one('product.product', string='产品', compute='_compute_product_id', readonly=True)
|
product_id = fields.Many2one('product.product', string='产品', compute='_compute_product_id', readonly=True)
|
||||||
product_sn_id = fields.Many2one('stock.lot', string='产品序列号')
|
product_sn_id = fields.Many2one('stock.lot', string='产品序列号')
|
||||||
@@ -287,6 +287,10 @@ class ShelfLocation(models.Model):
|
|||||||
hide_shelf = fields.Boolean(compute='_compute_hide_what', string='隐藏货架')
|
hide_shelf = fields.Boolean(compute='_compute_hide_what', string='隐藏货架')
|
||||||
hide_location = fields.Boolean(compute='_compute_hide_what', string='隐藏货位')
|
hide_location = fields.Boolean(compute='_compute_hide_what', string='隐藏货位')
|
||||||
|
|
||||||
|
# 修改货位状态为禁用
|
||||||
|
def action_location_status_disable(self):
|
||||||
|
self.location_status = '禁用'
|
||||||
|
|
||||||
@api.onchange('shelf_location_id')
|
@api.onchange('shelf_location_id')
|
||||||
def _onchange_shelf_location_id(self):
|
def _onchange_shelf_location_id(self):
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -55,8 +55,11 @@
|
|||||||
<form string="Shelf Location">
|
<form string="Shelf Location">
|
||||||
|
|
||||||
<header>
|
<header>
|
||||||
|
<field name="location_status" invisible="1"/>
|
||||||
<button string="生成货位" name="create_location" type="object" class="oe_highlight"
|
<button string="生成货位" name="create_location" type="object" class="oe_highlight"
|
||||||
attrs="{'invisible': [('hide_shelf', '=', False)]}"/>
|
attrs="{'invisible': [('hide_shelf', '=', False)]}"/>
|
||||||
|
<button string="禁用货位" name="action_location_status_disable" type="object" class="oe_highlight"
|
||||||
|
attrs="{'invisible': ['|', ('hide_shelf', '=', True), ('location_status', '!=', '空闲')]}"/>
|
||||||
|
|
||||||
<!-- <button name="%(shelf_location_kanban_action_id)d"-->
|
<!-- <button name="%(shelf_location_kanban_action_id)d"-->
|
||||||
<!-- type="action"-->
|
<!-- type="action"-->
|
||||||
|
|||||||
Reference in New Issue
Block a user