Accept Merge Request #1515: (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/1515
This commit is contained in:
胡尧
2024-11-15 15:31:22 +08:00
committed by Coding
8 changed files with 30 additions and 27 deletions

View File

@@ -12,7 +12,7 @@
'data/stock_routes.xml',
'data/product_data.xml',
'views/sale_order_views.xml',
'views/product_product_views.xml',
# 'views/product_product_views.xml',
],'assets': {
# 'web.assets_backend': [
# 'jikimo_sale_multiple_supply_methods/static/src/**/*'

View File

@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="product_template_only_form_view" model="ir.ui.view">
<!-- 由于该模块不能依赖sf_dlm_management, 该功能只能在sf_dlm_management中实现并且依赖该模块-->
<record id="view_product_product_form_inherit_sf" model="ir.ui.view">
<field name="name">view.product.template.form.inherit.sf</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_only_form_view"/>
<field name="inherit_id" ref="sf_dlm_management.view_sale_product_template_form_inherit_sf"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='uom_id']" position="before">
<field name="categ_type" invisible="1"/>
<field name="is_manual_processing" attrs="{'invisible': [('categ_type', 'not in', ['成品', '坯料'])], 'readonly': True}" />
<xpath expr="//field[@name='manual_quotation']" position="after">
<field name="is_customer_provided" attrs="{'invisible': [('categ_type', 'not in', ['成品', '坯料'])], 'readonly': True}" />
</xpath>
</field>
</record>

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)]}"/>

View File

@@ -10,7 +10,7 @@
""",
'category': 'sf',
'website': 'https://www.sf.jikimo.com',
'depends': ['sf_base', 'sf_maintenance', 'web_widget_model_viewer', 'sf_warehouse', 'jikimo_attachment_viewer'],
'depends': ['sf_base', 'sf_maintenance', 'web_widget_model_viewer', 'sf_warehouse','jikimo_attachment_viewer', 'jikimo_sale_multiple_supply_methods'],
'data': [
'data/cron_data.xml',
'data/stock_data.xml',

View File

@@ -1331,17 +1331,17 @@ class MrpProduction(models.Model):
return production_values_str
# 增加制造订单类型
# production_type = fields.Selection(
# [('自动化产线加工', '自动化产线加工'), ('人工线下加工', '人工线下加工')],
# string='制造类型',
# compute='_compute_production_type',
# store=True
# )
production_type = fields.Selection(
[('自动化产线加工', '自动化产线加工'), ('人工线下加工', '人工线下加工')],
string='制造类型',
compute='_compute_production_type',
store=True
)
# @api.depends('product_id.is_manual_processing')
# def _compute_production_type(self):
# for production in self:
# production.production_type = '自动化产线加工' if not production.product_id.is_manual_processing else '人工线下加工'
@api.depends('product_id.is_manual_processing')
def _compute_production_type(self):
for production in self:
production.production_type = '自动化产线加工' if not production.product_id.is_manual_processing else '人工线下加工'
class sf_detection_result(models.Model):

View File

@@ -35,10 +35,10 @@
<field name="reservation_state" optional="hide" decoration-danger="reservation_state == 'confirmed'"
decoration-success="reservation_state == 'assigned'"/>
</xpath>
<!-- <xpath expr="//field[@name='state']" position="before">
<xpath expr="//field[@name='state']" position="before">
<field name="production_type" widget="badge" decoration-warning="production_type == '人工线下加工'"
decoration-success="production_type == '自动化产线加工'" optional="show"/>
</xpath> -->
</xpath>
<xpath expr="//field[@name='activity_ids']" position="replace">
<field name="activity_ids" string="下一个活动" widget="list_activity" optional="hide"/>
</xpath>
@@ -91,7 +91,7 @@
</xpath>
<xpath expr="//sheet//group//group//div[3]" position="after">
<!-- <field name="production_type" readonly="1"/> -->
<field name="production_type" readonly="1"/>
<field name="manual_quotation" readonly="1"/>
<field name="programming_no" readonly="1"/>
<field name="programming_state" readonly="1"

View File

@@ -417,12 +417,12 @@ class sf_production_plan(models.Model):
raise UserError(e)
# 增加制造订单类型
# production_type = fields.Selection(
# [('自动化产线加工', '自动化产线加工'), ('人工线下加工', '人工线下加工')],
# string='制造类型',
# related='production_id.production_type',
# store=True
# )
production_type = fields.Selection(
[('自动化产线加工', '自动化产线加工'), ('人工线下加工', '人工线下加工')],
string='制造类型',
related='production_id.production_type',
store=True
)
# 机台作业计划

View File

@@ -22,7 +22,7 @@
<field name="production_line_id"/>
<field name="date_planned_start"/>
<field name="date_planned_finished"/>
<!-- <field name="production_type" widget="badge" decoration-warning="production_type == '人工线下加工'" decoration-success="production_type == '自动化产线加工'"/> -->
<field name="production_type" widget="badge" decoration-warning="production_type == '人工线下加工'" decoration-success="production_type == '自动化产线加工'"/>
<field name="actual_start_time" optional='hide'/>
<field name="actual_end_time" optional='hide'/>
<field name="actual_process_time" optional='hide'/>