Compare commits

...

11 Commits

Author SHA1 Message Date
guanhuan
ba955ca658 快速订单上传模型文件检查文件后缀 2024-09-14 08:46:32 +08:00
guanhuan
ccbe311c58 快速订单填写的零件图号和零件图纸传给制造订单 2024-09-13 10:45:08 +08:00
guanhuan
4c58f4d7f3 快速订单填写的零件图号和零件图纸传给制造订单 2024-09-13 10:22:14 +08:00
guanhuan
b5a3815f1f 设备维保标准筛选添加已归档 2024-09-12 16:43:54 +08:00
guanhuan
988c4a460d 2D加工图纸改为pdf 2024-09-12 10:24:45 +08:00
guanhuan
c050e2f11a 供应商详情的采购员去掉必填 2024-09-12 10:14:38 +08:00
guanhuan
8bc68e1edd 表面工艺参数取消必填 2024-09-11 17:40:28 +08:00
guanhuan
ea6fd42b2e SF快速订单优化 2024-09-11 09:01:24 +08:00
guanhuan
625499f758 SF快速订单优化 2024-09-11 08:59:44 +08:00
guanhuan
0c2d6dd582 SF快速订单优化 2024-09-11 08:52:28 +08:00
guanhuan
005a7bb68e 建立设备维保标准,建立设备维保标准修复 2024-09-05 08:51:36 +08:00
7 changed files with 49 additions and 12 deletions

View File

@@ -24,6 +24,7 @@ class SfEquipmentSaintenanceStandards(models.Model):
remark = fields.Char('备注') remark = fields.Char('备注')
maintenance_type = fields.Selection([('保养', '保养'), ("检修", "检修")], string='类型', default='保养') maintenance_type = fields.Selection([('保养', '保养'), ("检修", "检修")], string='类型', default='保养')
name = fields.Char(string='名称') name = fields.Char(string='名称')
active = fields.Boolean(default=True)
@api.model_create_multi @api.model_create_multi
def create(self, vals_list): def create(self, vals_list):

View File

@@ -6,15 +6,16 @@
<field name="name">equipment.maintenance.standards.form</field> <field name="name">equipment.maintenance.standards.form</field>
<field name="model">equipment.maintenance.standards</field> <field name="model">equipment.maintenance.standards</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<form string="设备维保标准"> <form string="设备维保标准" delete="false" duplicate="false">
<sheet> <sheet>
<group> <group>
<group> <group>
<field name="code" readonly="1" force_save="1"/> <field name="active" invisible="1"/>
<field name="name" readonly="1" force_save="1"/> <field name="code" readonly="1" force_save="1"/>
<field name="maintenance_equipment_category_id" required="1" /> <field name="name" readonly="1" force_save="1"/>
<field name="eq_maintenance_ids" invisible='1'/> <field name="maintenance_equipment_category_id" required="1"/>
<field name="overhaul_ids" invisible='1'/> <field name="eq_maintenance_ids" invisible='1'/>
<field name="overhaul_ids" invisible='1'/>
</group> </group>
@@ -50,7 +51,8 @@
<field name="name">equipment.maintenance.standards.tree</field> <field name="name">equipment.maintenance.standards.tree</field>
<field name="model">equipment.maintenance.standards</field> <field name="model">equipment.maintenance.standards</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<tree string="设备维保标准"> <tree string="设备维保标准" delete="false">
<field name="active" invisible="1"/>
<field name="code" readonly="1" force_save="1"/> <field name="code" readonly="1" force_save="1"/>
<field name="maintenance_type" required="1"/> <field name="maintenance_type" required="1"/>
<field name="name" required="1"/> <field name="name" required="1"/>
@@ -77,6 +79,7 @@
<field name="name" string="日常机床保养"/> <field name="name" string="日常机床保养"/>
<field name="created_user_id" string="创建人"/> <field name="created_user_id" string="创建人"/>
<field name="maintenance_equipment_category_id" string="设备类别"/> <field name="maintenance_equipment_category_id" string="设备类别"/>
<filter name="filter_active" string="已归档" domain="[('active','=',False)]"/>
</search> </search>
</field> </field>
</record> </record>

View File

@@ -222,7 +222,7 @@ class ResMrpWorkOrder(models.Model):
material_width = fields.Float(string='') material_width = fields.Float(string='')
material_height = fields.Float(string='') material_height = fields.Float(string='')
# 零件图号 # 零件图号
part_number = fields.Char(string='零件图号') part_number = fields.Char(related='production_id.part_number', string='零件图号')
# 工序状态 # 工序状态
process_state = fields.Selection([ process_state = fields.Selection([
('待装夹', '待装夹'), ('待装夹', '待装夹'),

View File

@@ -267,6 +267,11 @@ class StockRule(models.Model):
workorder_duration += workorder.duration_expected workorder_duration += workorder.duration_expected
sale_order = self.env['sale.order'].sudo().search([('name', '=', production.origin)]) sale_order = self.env['sale.order'].sudo().search([('name', '=', production.origin)])
# 根据销售订单号查询快速订单
quick_easy_order = self.env['quick.easy.order'].sudo().search([('sale_order_id', '=', sale_order.id)])
if quick_easy_order:
production.write({'part_number': quick_easy_order.part_drawing_number,
'part_drawing': quick_easy_order.machining_drawings})
if sale_order: if sale_order:
# sale_order.write({'schedule_status': 'to schedule'}) # sale_order.write({'schedule_status': 'to schedule'})
self.env['sf.production.plan'].sudo().with_company(company_id).create({ self.env['sf.production.plan'].sudo().with_company(company_id).create({
@@ -288,6 +293,7 @@ class StockRule(models.Model):
# 为同一个product_id创建一个生产订单名称列表 # 为同一个product_id创建一个生产订单名称列表
product_id_to_production_names[product_id] = [production.name for production in all_production] product_id_to_production_names[product_id] = [production.name for production in all_production]
for production_item in productions: for production_item in productions:
production_programming = self.env['mrp.production'].search( production_programming = self.env['mrp.production'].search(
[('product_id.id', '=', production_item.product_id.id), [('product_id.id', '=', production_item.product_id.id),
('origin', '=', production_item.origin)], ('origin', '=', production_item.origin)],

View File

@@ -56,6 +56,27 @@ class QuickEasyOrder(models.Model):
processing_time = fields.Integer('加工时长(min)') processing_time = fields.Integer('加工时长(min)')
sale_order_id = fields.Many2one('sale.order', '销售订单号') sale_order_id = fields.Many2one('sale.order', '销售订单号')
part_drawing_number = fields.Char('零件图号')
machining_drawings = fields.Binary('2D加工图纸')
machining_drawings_name = fields.Char('2D加工图纸名')
@api.onchange('machining_drawings_name')
def _onchange_machining_drawings_name(self):
for item in self:
if item.machining_drawings_name:
if not item.machining_drawings_name.lower().endswith(
'.pdf'):
raise ValidationError('文件格式上传有误,请检查文件后缀(不区分大小写)是否为pdf')
@api.onchange('parameter_ids')
def _compute_parameter_ids(self):
my_parameter_ids = {}
for item in self:
for item1 in item.parameter_ids:
my_parameter_ids[item1.process_id.id] = item1.ids[0]
my_parameter_ids = list(my_parameter_ids.values())
item.write({'parameter_ids': [(6, 0, my_parameter_ids)]})
@api.depends('unit_price', 'quantity') @api.depends('unit_price', 'quantity')
def _compute_total_amount(self): def _compute_total_amount(self):
for item in self: for item in self:
@@ -116,6 +137,10 @@ class QuickEasyOrder(models.Model):
if len(item.upload_model_file) > 1: if len(item.upload_model_file) > 1:
raise ValidationError('只允许上传一个文件') raise ValidationError('只允许上传一个文件')
if item.upload_model_file: if item.upload_model_file:
if not item.upload_model_file.name.lower().endswith(
'.step') and not item.upload_model_file.name.lower().endswith(
'.stp'):
raise ValidationError('文件格式上传有误,请检查文件后缀(不区分大小写)是否为step、stp')
file_attachment_id = item.upload_model_file[0] file_attachment_id = item.upload_model_file[0]
# 附件路径 # 附件路径
report_path = file_attachment_id._full_path(file_attachment_id.store_fname) report_path = file_attachment_id._full_path(file_attachment_id.store_fname)

View File

@@ -73,12 +73,15 @@
<field name="material_model_id" options="{'no_create': True}" required="1"/> <field name="material_model_id" options="{'no_create': True}" required="1"/>
<!-- <field name="process_id"/>--> <!-- <field name="process_id"/>-->
<field name="parameter_ids" widget="many2many_tags" string="表面工艺参数" <field name="parameter_ids" widget="many2many_tags" string="表面工艺参数"
options="{'no_create': True}" required="1"/> options="{'no_create': True}"/>
<field name="machining_precision" required="1"/> <field name="machining_precision" required="1"/>
<field name="processing_time"/> <field name="processing_time"/>
<field name="quantity" options="{'format': false}"/> <field name="quantity" options="{'format': false}"/>
<field name="unit_price"/> <field name="unit_price"/>
<field name="price" options="{'format': false}"/> <field name="price" options="{'format': false}"/>
<field name="part_drawing_number"/>
<field name="machining_drawings" filename="machining_drawings_name" widget="pdf_viewer"/>
<field name="machining_drawings_name" invisible="1"/>
<field name="sale_order_id" <field name="sale_order_id"
attrs='{"invisible": [("sale_order_id","=",False)],"readonly": [("sale_order_id","!=",False)]}'/> attrs='{"invisible": [("sale_order_id","=",False)],"readonly": [("sale_order_id","!=",False)]}'/>
</group> </group>

View File

@@ -100,8 +100,7 @@
<field name="arch" type="xml"> <field name="arch" type="xml">
<field name="property_supplier_payment_term_id" position="before"> <field name="property_supplier_payment_term_id" position="before">
<field name="purchase_user_id" context="{'supplier_rank': supplier_rank }" <field name="purchase_user_id" context="{'supplier_rank': supplier_rank }"
widget="many2one_avatar_user" widget="many2one_avatar_user"/>
attrs="{'required' : [('supplier_rank','>', 0)]}"/>
</field> </field>
<xpath expr="//field[@name='property_account_position_id']" position="attributes"> <xpath expr="//field[@name='property_account_position_id']" position="attributes">
<attribute name="attrs">{'readonly': [('id','!=', False)]}</attribute> <attribute name="attrs">{'readonly': [('id','!=', False)]}</attribute>