Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/修改机床参数bug

# Conflicts:
#	sf_warehouse/views/view.xml
This commit is contained in:
qihao.gong@jikimo.com
2024-01-22 14:37:25 +08:00
21 changed files with 287 additions and 83 deletions

View File

@@ -567,30 +567,6 @@ class SfPickingType(models.Model):
self.check_state = 'enable'
class SfProductCategory(models.Model):
_inherit = 'product.category'
check_state = fields.Selection([
('enable', '启用'),
('close', '关闭')
], string='审核状态', default='close')
def action_check(self):
self.check_state = 'enable'
class SfUomCategory(models.Model):
_inherit = 'uom.category'
check_state = fields.Selection([
('enable', '启用'),
('close', '关闭')
], string='审核状态', default='close')
def action_check(self):
self.check_state = 'enable'
class SfBarcodeNomenclature(models.Model):
_inherit = 'barcode.nomenclature'

View File

@@ -37,5 +37,41 @@
</field>
</record>
<!-- 原生的按钮对base.user可见这里修改为对库存用户可见 -->
<record id="sf_view_picking_form" model="ir.ui.view">
<field name="name">sf.view.picking.form</field>
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.view_picking_form"/>
<field name="arch" type="xml">
<xpath expr="//form//header//button[@name='action_cancel']" position="replace">
<button name="action_cancel" attrs="{'invisible': [('state', 'not in', ('assigned', 'confirmed', 'draft', 'waiting'))]}" string="取消" groups="sf_warehouse.group_sf_stock_user" type="object" data-hotkey="z"/>
</xpath>
<xpath expr="//form//header//button[@name='do_unreserve']" position="replace">
<button name="do_unreserve" string="取消保留" groups="sf_warehouse.group_sf_stock_user" type="object" attrs="{'invisible': ['|', '|', '|', ('picking_type_code', '=', 'incoming'), ('immediate_transfer', '=', True), '&amp;', ('state', '!=', 'assigned'), ('move_type', '!=', 'one'), '&amp;', ('state', 'not in', ('assigned', 'confirmed')), ('move_type', '=', 'one')]}" data-hotkey="w"/>
</xpath>
<xpath expr="//form//header//button[@name='button_scrap']" position="replace">
<button name="button_scrap" groups="sf_warehouse.group_sf_stock_user" type="object" string="报废" attrs="{'invisible': ['|', '&amp;', ('picking_type_code', '=', 'incoming'), ('state', '!=', 'done'), '&amp;', ('picking_type_code', '=', 'outgoing'), ('state', '=', 'done')]}" data-hotkey="y"/>
</xpath>
<xpath expr="//form//header//button[@name='action_assign']" position="replace">
<button name="action_assign" attrs="{'invisible': [('show_check_availability', '=', False)]}" string="检查可用量" type="object" class="oe_highlight" groups="sf_warehouse.group_sf_stock_user" data-hotkey="q"/>
</xpath>
<xpath expr="//form//header//button[@name='%(stock.act_stock_return_picking)d']" position="replace">
<button name="%(stock.act_stock_return_picking)d" string="退回" attrs="{'invisible': [('state', '!=', 'done')]}" type="action" groups="sf_warehouse.group_sf_stock_user" data-hotkey="k"/>
</xpath>
</field>
</record>
<record id="sf_stock_scrap_form_view" model="ir.ui.view">
<field name="name">sf.stock.scrap.form.view</field>
<field name="model">stock.scrap</field>
<field name="inherit_id" ref="stock.stock_scrap_form_view"/>
<field name="arch" type="xml">
<xpath expr="//header//button[@name='action_validate']" position="replace">
<button name="action_validate" states="draft" string="Validate" type="object" class="oe_highlight" context="{'not_unlink_on_discard': True}" data-hotkey="v" groups="sf_warehouse.group_sf_stock_user"/>
</xpath>
</field>
</record>
</data>
</odoo>