零件图号零件名称

This commit is contained in:
liaodanlong
2024-12-20 14:55:04 +08:00
parent 283950db39
commit 41096c9c65
15 changed files with 61 additions and 21 deletions

View File

@@ -40,6 +40,7 @@
'views/res_config_settings_views.xml',
'views/sale_order_views.xml',
'views/mrp_workorder_batch_replan.xml',
'views/purchase_order_view.xml',
],
'assets': {

View File

@@ -15,3 +15,4 @@ from . import sf_technology_design
from . import sf_production_common
from . import sale_order
from . import quick_easy_order
from . import purchase_order

View File

@@ -774,11 +774,10 @@ class ResProductMo(models.Model):
# bfm下单
manual_quotation = fields.Boolean('人工编程', default=False, readonly=True)
part_number = fields.Char(string='零件图号', readonly=True)
machining_drawings = fields.Binary('2D加工图纸', readonly=True)
quality_standard = fields.Binary('质检标准', readonly=True)
part_name = fields.Char(string='零件名称', readonly=True)
part_number = fields.Char(string='零件图号', readonly=True)
@api.constrains('tool_length')
def _check_tool_length_size(self):
if self.tool_length > 1000000:
@@ -892,7 +891,7 @@ class ResProductMo(models.Model):
'machining_drawings': '' if not item['machining_drawings'] else base64.b64decode(
item['machining_drawings']),
'quality_standard': '' if not item['quality_standard'] else base64.b64decode(item['quality_standard']),
'part_name': item['part_name'],
'part_name': item.get('part_name') or '',
}
tax_id = self.env['account.tax'].sudo().search(
[('type_tax_use', '=', 'sale'), ('amount', '=', item.get('tax')), ('price_include', '=', 'True')])

View File

@@ -0,0 +1,7 @@
import logging
from odoo import models, fields, api
_logger = logging.getLogger(__name__)
class PurchaseOrderLine(models.Model):
_inherit = 'purchase.order.line'
part_number = fields.Char('零件图号', related='product_id.part_number', readonly=True)

View File

@@ -152,7 +152,7 @@ class SaleOrder(models.Model):
class SaleOrderLine(models.Model):
_inherit = 'sale.order.line'
part_number = fields.Char('零件图号', related='product_id.part_number', readonly=True)
# 供货方式
supply_method = fields.Selection([
('automation', "自动化产线加工"),

View File

@@ -18,9 +18,12 @@
<xpath expr="//field[@name='date_deadline']" position="replace"/>
<xpath expr="//field[@name='name']" position="after">
<field name="product_id" readonly="1" optional="show"/>
<field name="part_name" readonly="1" optional="hide"/>
<field name="part_number" readonly="1" optional="show"/>
</xpath>
<xpath expr="//field[@name='product_id']" position="after">
<field name="product_qty" sum="Total Qty" string="数量" readonly="1" optional="show"/>
<field name="deadline_of_delivery" optional="show"/>
</xpath>
<xpath expr="//field[@name='product_qty']" position="after">
<field name="product_uom_id" string="计量单位" options="{'no_open':True,'no_create':True}"

View File

@@ -29,6 +29,8 @@
</field>
<field name="product_id" position="after">
<field name="equipment_id" optional="hide"/>
<field name="part_name" optional="hide"/>
<field name="part_number" optional="show"/>
</field>
<xpath expr="//field[@name='qty_remaining']" position="after">
<field name="manual_quotation" optional="show"/>

View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<data>
<record model="ir.ui.view" id="view_purchase_order_line_form_inherit_sf1">
<field name="name">purchase.order.form.inherit.sf</field>
<field name="model">purchase.order</field>
<field name="inherit_id" ref="purchase.purchase_order_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='order_line']/tree/field[@name='name']" position="after">
<field name="part_number" optional="show"/>
</xpath>
</field>
</record>
</data>
</odoo>

View File

@@ -18,6 +18,10 @@
<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="//field[@name='order_line']/tree/field[@name='model_glb_file']" position="before">
<field name="part_number" optional="show"/>
</xpath>
<xpath expr="//header/button[@name='action_cancel']" position="attributes">
<attribute name="attrs">{'invisible': [('state', '!=', 'draft')]}</attribute>
</xpath>

View File

@@ -13,7 +13,8 @@ class sf_production_plan(models.Model):
_description = 'sf_production_plan'
_inherit = ['mail.thread']
# _order = 'state desc, write_date desc'
part_name = fields.Char('零件名称', related='product_id.part_name', readonly=True)
part_number = fields.Char('零件图号', related='product_id.part_number', readonly=True)
state = fields.Selection([
('draft', '待排程'),
('done', '已排程'),

View File

@@ -17,6 +17,8 @@
decoration-danger="state == 'finished'"/>
<field name="name"/>
<field name="origin"/>
<field name="part_number" optional="show"/>
<field name="part_name" optional="hide"/>
<field name="order_deadline" widget="date"/>
<field name="product_qty"/>
<field name="production_line_id"/>

View File

@@ -18,7 +18,8 @@
<field name="production_id"/>
<field name="processing_panel"/>
<field name="product_id"/>
<field name="part_number"/>
<field name="part_number" optional="show"/>
<field name="part_name" optional="hide"/>
<field name="number"/>
<field name="state" widget="badge"
decoration-success="state == 'done'"

View File

@@ -225,7 +225,8 @@ class ReSaleOrder(models.Model):
class ResaleOrderLine(models.Model):
_inherit = 'sale.order.line'
# part_number = fields.Char('零件图号', related='product_id.part_number', readonly=True)
part_name = fields.Char('零件名称', related='product_id.part_name', readonly=True)
model_glb_file = fields.Binary('模型的glb文件', compute='_compute_model_glb_file', store=True)
# product_template_id = fields.Many2one(
# string="产品",
@@ -383,7 +384,7 @@ class PurchaseOrderLine(models.Model):
_inherit = 'purchase.order.line'
part_name = fields.Char('零件名称', related='product_id.part_name', readonly=True)
# part_number = fields.Char('零件图号',related='product_id.part_number', readonly=True)
class ResPartnerToSale(models.Model):
_inherit = 'res.partner'

View File

@@ -19,7 +19,8 @@
string="接收产品" class="oe_highlight" type="object"
attrs="{'invisible': ['|', '|' , ('is_shipped', '=', True), ('state','not in', ('purchase','done')), ('incoming_picking_count', '=', 0)]}"
data-hotkey="y" groups="stock.group_stock_user"/>
<button name="button_cancel" states="draft,to approve,sent,purchase" string="取消" type="object" data-hotkey="x" />
<button name="button_cancel" states="draft,to approve,sent,purchase" string="取消" type="object"
data-hotkey="x"/>
</xpath>
<xpath expr="//header/button[@name='button_cancel'][2]" position="attributes">
<attribute name="invisible">1</attribute>
@@ -134,7 +135,8 @@
<attribute name="optional">hide</attribute>
</xpath>
<xpath expr="//field[@name='order_line']/tree/field[@name='name']" position="after">
<field name="part_name" string="零件名称" optional="show"/>
<field name="part_name" optional="hide"/>
<!-- <field name="part_number" optional="show"/>-->
</xpath>
<xpath expr="//field[@name='date_order']" position="attributes">
<attribute name="string">报价截止日期</attribute>
@@ -168,11 +170,11 @@
</attribute>
</field>
<!-- 添加采购类型字段 -->
<!-- 添加采购类型字段 -->
<field name="partner_ref" position="after">
<field name="purchase_type" string="采购类型" readonly="1"/>
</field>
<!-- 添加销售订单号字段-->
<!-- 添加销售订单号字段-->
<field name="effective_date" position="after">
<field name="origin_sale_id" readonly="1" attrs="{'invisible': [('origin_sale_id', '=', False)]}"/>
</field>
@@ -261,12 +263,12 @@
<xpath expr="//field[@name='name']" position="replace">
<field name="name" string="单据编码" filter_domain="[('name', 'ilike', self)]"/>
</xpath>
<!-- <xpath expr="//search" position="inside">-->
<!-- <searchpanel>-->
<!-- <field name="purchase_type" icon="fa-filter"/>-->
<!-- <field name="state" icon="fa-filter"/>-->
<!-- </searchpanel>-->
<!-- </xpath>-->
<!-- <xpath expr="//search" position="inside">-->
<!-- <searchpanel>-->
<!-- <field name="purchase_type" icon="fa-filter"/>-->
<!-- <field name="state" icon="fa-filter"/>-->
<!-- </searchpanel>-->
<!-- </xpath>-->
</field>
</record>

View File

@@ -103,6 +103,7 @@
<xpath expr="//field[@name='order_line']/tree/field[@name='name']" position="before">
<field name="model_glb_file" widget="Viewer3D" optional="show"
string="模型文件" attrs="{'readonly': [('state', 'in', ['draft'])]}"/>
<field name="part_name" optional="hide"/>
</xpath>
<xpath expr="//field[@name='order_line']/tree/field[@name='price_subtotal']" position="after">
<field name="remark"/>