Merge branch 'feature/制造订单优化' into feature/销售单优化

This commit is contained in:
yuxianghui
2024-08-07 17:11:57 +08:00
4 changed files with 30 additions and 14 deletions

View File

@@ -171,7 +171,7 @@
<field name="width"/> <field name="width"/>
<field name="height"/> <field name="height"/>
<field name="diameter"/> <field name="diameter"/>
<field name="weight"/> <field name="weight" string="重量(kg)"/>
<field name="orientation_dish_diameter"/> <field name="orientation_dish_diameter"/>
<field name="clamping_diameter"/> <field name="clamping_diameter"/>
<field name="clamping_num"/> <field name="clamping_num"/>
@@ -197,7 +197,7 @@
<field name="width"/> <field name="width"/>
<field name="height"/> <field name="height"/>
<field name="diameter"/> <field name="diameter"/>
<field name="weight"/> <field name="weight" string="重量(kg)"/>
<field name="clamping_diameter"/> <field name="clamping_diameter"/>
<field name="connector_diameter"/> <field name="connector_diameter"/>
<field name="chucking_power_max"/> <field name="chucking_power_max"/>
@@ -220,7 +220,7 @@
<field name="length"/> <field name="length"/>
<field name="width"/> <field name="width"/>
<field name="height"/> <field name="height"/>
<field name="weight"/> <field name="weight" string="重量(kg)"/>
<field name="gripper_length_min"/> <field name="gripper_length_min"/>
<field name="gripper_width_min"/> <field name="gripper_width_min"/>
<field name="gripper_height_min"/> <field name="gripper_height_min"/>
@@ -248,7 +248,7 @@
<field name="length"/> <field name="length"/>
<field name="width"/> <field name="width"/>
<field name="height"/> <field name="height"/>
<field name="weight"/> <field name="weight" string="重量(kg)"/>
<field name="gripper_length_min"/> <field name="gripper_length_min"/>
<field name="gripper_width_min"/> <field name="gripper_width_min"/>
<field name="gripper_height_min"/> <field name="gripper_height_min"/>
@@ -278,7 +278,7 @@
<field name="width"/> <field name="width"/>
<field name="height"/> <field name="height"/>
<field name="height_tolerance_value"/> <field name="height_tolerance_value"/>
<field name="weight"/> <field name="weight" string="重量(kg)"/>
<field name="gripper_length_min"/> <field name="gripper_length_min"/>
<field name="gripper_width_min"/> <field name="gripper_width_min"/>
<field name="gripper_height_min"/> <field name="gripper_height_min"/>
@@ -307,7 +307,7 @@
<field name="length"/> <field name="length"/>
<field name="width"/> <field name="width"/>
<field name="height"/> <field name="height"/>
<field name="weight"/> <field name="weight" string="重量(kg)"/>
<field name="gripper_length_min"/> <field name="gripper_length_min"/>
<field name="gripper_width_min"/> <field name="gripper_width_min"/>
<field name="gripper_height_min"/> <field name="gripper_height_min"/>
@@ -335,7 +335,7 @@
<field name="width"/> <field name="width"/>
<field name="height"/> <field name="height"/>
<field name="diameter"/> <field name="diameter"/>
<field name="weight"/> <field name="weight" string="重量(kg)"/>
<field name="gripper_length_min"/> <field name="gripper_length_min"/>
<field name="gripper_width_min"/> <field name="gripper_width_min"/>
<field name="gripper_height_min"/> <field name="gripper_height_min"/>

View File

@@ -217,6 +217,23 @@ class StockRule(models.Model):
( (
p.move_dest_ids.procure_method != 'make_to_order' and not p.move_dest_ids.procure_method != 'make_to_order' and not
p.move_raw_ids and not p.workorder_ids)).action_confirm() p.move_raw_ids and not p.workorder_ids)).action_confirm()
# 处理 根据制造订单生成的采购单坯料入库时到原材料库,手动将原材料位置该为坯料存货区
for production in productions:
if production.picking_ids:
product_type_id = production.picking_ids[0].move_ids[0].product_id.categ_id
if product_type_id.name == '坯料':
location_id = self.env['stock.location'].search([('name', '=', '坯料存货区')])
if not location_id:
logging.info(f'没有搜索到【坯料存货区】: {location_id}')
break
for picking_id in production.picking_ids:
if picking_id.picking_type_id.name == '内部调拨':
if picking_id.location_dest_id.product_type != product_type_id:
picking_id.location_dest_id = location_id.id
elif picking_id.picking_type_id.name == '生产发料':
if picking_id.location_id.product_type != product_type_id:
picking_id.location_id = location_id.id
for production in productions: for production in productions:
''' '''
创建制造订单时生成序列号 创建制造订单时生成序列号

View File

@@ -34,15 +34,13 @@
<!-- </xpath>--> <!-- </xpath>-->
<xpath expr="//form/header/button[@name='action_confirm'][2]" position="replace"> <xpath expr="//form/header/button[@name='action_confirm'][2]" position="replace">
<button name="action_confirm" data-hotkey="v" <button name="action_confirm" data-hotkey="v"
string="确认" type="object" context="{'validate_analytic': True}" string="确认接单" type="object" context="{'validate_analytic': True}"
attrs="{'invisible': ['|','&amp;',('check_status', '!=', 'approved'),('state', 'in', ['draft','cancel']),'&amp;','&amp;',('check_status', '=', 'approved'),('state', 'in', ['sale','cancel']),('delivery_status', '!=', False)]}"/> attrs="{'invisible': ['|','&amp;',('check_status', '!=', 'approved'),('state', 'in', ['draft','cancel']),'&amp;','&amp;',('check_status', '=', 'approved'),('state', 'in', ['sale','cancel']),('delivery_status', '!=', False)]}"/>
</xpath> </xpath>
<xpath expr="//form/header/button[@name='action_cancel']" position="attributes"> <xpath expr="//form/header/button[@name='action_cancel']" position="attributes">
<attribute name="attrs">{'invisible': ['|','&amp;',('state', 'in', <attribute name="attrs">{'invisible': ['|','&amp;',('check_status', '!=', 'approved'),('state',
['cancel','draft']),('check_status', 'in', ['draft','cancel']),'&amp;','&amp;',('check_status', '=', 'approved'),('state', 'in',
'in', ['sale','cancel']),('delivery_status', '!=', False)]}
[False,'approved']),'&amp;',('check_status', '=', 'approved'),('state', 'in',
['sale','cancel','draft'])]}
</attribute> </attribute>
</xpath> </xpath>
<xpath expr="//form/header/button[@name='action_draft']" position="attributes"> <xpath expr="//form/header/button[@name='action_draft']" position="attributes">

View File

@@ -21,7 +21,8 @@
<!-- ]"/> --> <!-- ]"/> -->
<field name="destination_location_id" domain="[('location_id', '=', location_dest_id_value), '|', <field name="destination_location_id" domain="[('location_id', '=', location_dest_id_value), '|',
('location_status', '=', '空闲'), ('product_id', '=', current_product_id), ('product_sn_id', ('location_status', '=', '空闲'), ('product_id', '=', current_product_id), ('product_sn_id',
'=', there_is_no_sn)]" options="{'no_create': True,'no_create_edit':True}"/> '=', there_is_no_sn), ('rotative_Boolean', '=', False)]"
options="{'no_create': True,'no_create_edit':True}"/>
<field name="rfid_barcode" string="Rfid"/> <field name="rfid_barcode" string="Rfid"/>
<!-- <field name="location_dest_id_product_type"/> --> <!-- <field name="location_dest_id_product_type"/> -->