Accept Merge Request #1502: (feature/sale_order_route_pick -> develop)

Merge Request: 修改细节

Created By: @胡尧
Accepted By: @胡尧
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1502?initial=true
This commit is contained in:
胡尧
2024-11-13 10:51:32 +08:00
committed by Coding
4 changed files with 28 additions and 10 deletions

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<data noupdate="1">
<data noupdate="0">
<record id="product_product_manual_processing" model="product.product">
<field name="name">人工线下加工模板</field>
<field name="active" eval="False"/>
@@ -82,8 +82,7 @@
<field name="seller_ids" eval="[ref('jikimo_sale_multiple_supply_methods.product_supplierinfo_bfm')]"/>
</record>
<record id="product_embryo_sf_self_machining" model="product.product">
<field name="name">坯料加工模板(人工线下加工)</field>
<record id="sf_dlm.product_embryo_sf_self_machining" model="product.product">
<field name="is_manual_processing">true</field>
</record>
</data>

View File

@@ -21,9 +21,12 @@ class SaleOrder(models.Model):
self.state = 'supply method'
def action_confirm(self):
# 判断是否所有产品都选择了供货方式
filter_line = self.order_line.filtered(lambda line: not line.supply_method)
if filter_line:
raise UserError('当前订单内(%s)产品未选择路线,请选择后重试' % ','.join(filter_line.mapped('product_id.name')))
for line in self.order_line:
if not line.supply_method:
raise UserError('请先选择供货方式')
bom_type = ''
# 根据供货方式修改成品模板
if line.supply_method == 'automation':

View File

@@ -22,7 +22,7 @@
<attribute name="name">confirm_to_supply_method</attribute>
</xpath>
<xpath expr="//header/button[@name='confirm_to_supply_method']" position="before">
<button name="action_confirm" string="供货方式确认" type="object" attrs="{'invisible': [('state', '!=', 'supply method')]}" />
<button name="action_confirm" string="供货方式确认" type="object" attrs="{'invisible': [('state', '!=', 'supply method')]}" confirm="您确定要确认供货方式吗?"/>
</xpath>
<xpath expr="//header/field[@name='state']" position="attributes">
<attribute name="statusbar_visible">draft,sent,supply method,sale</attribute>
@@ -30,6 +30,15 @@
<xpath expr="//page/field[@name='order_line']/tree/field[@name='remark']" position="before">
<field name="supply_method" attrs="{'invisible': [('state', '=', 'draft')], 'required': [('state', '=', 'supply method')]}" />
</xpath>
<xpath expr="//header/button[@name='action_cancel']" position="attributes">
<attribute name="attrs">{'invisible': [('state', '!=', 'draft')]}</attribute>
</xpath>
<xpath expr="//header/button[@name='action_cancel']" position="attributes">
<attribute name="attrs">{'invisible': [('state', '!=', 'draft')]}</attribute>
</xpath>
<xpath expr="//header/button[@name='action_quotation_send'][5]" position="attributes">
<attribute name="attrs">{'invisible': ['|','&amp;',('check_status', '!=', 'approved'),('state', 'in', ['draft','cancel','supply method']),'&amp;',('check_status', '=', 'approved'),('state', 'in', ['sale','cancel','supply method'])]}</attribute>
</xpath>
</field>
</record>
@@ -39,8 +48,11 @@
<field name="mode">primary</field>
<field name="inherit_id" ref="sale.sale_order_view_search_inherit_quotation"/>
<field name="arch" type="xml">
<xpath expr="//filter[@name='my_quotation']" position="replace">
<filter string="我的报价" name="my_quotation" domain="[('state', 'in', ('draft', 'sent'))]"/>
<xpath expr="//filter[@name='my_quotation']" position="attributes">
<attribute name="domain">[('state', 'in', ('draft', 'sent')), ('user_id', '=', uid)]</attribute>
</xpath>
<xpath expr="//filter[@name='draft']" position="after">
<filter string="供货方式待确认" name="supply_method" domain="[('state', '=', 'supply method')]"/>
</xpath>
</field>
</record>
@@ -51,8 +63,8 @@
<field name="mode">primary</field>
<field name="inherit_id" ref="sale.sale_order_view_search_inherit_quotation"/>
<field name="arch" type="xml">
<xpath expr="//filter[@name='my_quotation']" position="replace">
<filter string="我的报价" name="my_quotation" domain="[('state', 'in', ('draft', 'sent'))]"/>
<xpath expr="//filter[@name='my_quotation']" position="attributes">
<attribute name="domain">[('state', 'in', ('draft', 'sent')), ('user_id', '=', uid)]</attribute>
</xpath>
<xpath expr="//filter[@name='draft']" position="after">
<filter string="供货方式待确认" name="supply_method" domain="[('state', '=', 'supply method')]"/>
@@ -69,6 +81,7 @@
<field name="type">ir.actions.act_window</field>
<field name="res_model">sale.order</field>
<field name="view_mode">tree,kanban,form,calendar,pivot,graph,activity</field>
<field name="view_id" ref="sale.view_quotation_tree_with_onboarding"/>
<field name="search_view_id" ref="jikimo_sale_order_view_search_inherit_quotation_supply_method"/>
<field name="context">{'search_default_supply_method': 1}</field>
<field name="help" type="html">

View File

@@ -65,6 +65,9 @@
attrs="{'invisible': [('categ_type', '!=', '夹具')],'required': [('categ_type', '=', '夹具')]}"
domain="[('fixture_model_id','=',fixture_model_id)]"/>
</field>
<xpath expr="//field[@name='uom_id']" position="before">
<field name="is_manual_processing" attrs="{'invisible': [('categ_type', 'not in', ['成品', '坯料'])], 'readonly': True}" />
</xpath>
<xpath expr="//label[@for='volume']" position="before">
<label for="length" string="尺寸"
attrs="{'invisible':[('product_variant_count', '>', 1), ('is_product_variant', '=', False)]}"/>