Compare commits

...

6 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
6 changed files with 24 additions and 4 deletions

View File

@@ -79,6 +79,7 @@
<field name="name" string="日常机床保养"/>
<field name="created_user_id" string="创建人"/>
<field name="maintenance_equipment_category_id" string="设备类别"/>
<filter name="filter_active" string="已归档" domain="[('active','=',False)]"/>
</search>
</field>
</record>

View File

@@ -222,7 +222,7 @@ class ResMrpWorkOrder(models.Model):
material_width = 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([
('待装夹', '待装夹'),

View File

@@ -267,6 +267,11 @@ class StockRule(models.Model):
workorder_duration += workorder.duration_expected
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:
# sale_order.write({'schedule_status': 'to schedule'})
self.env['sf.production.plan'].sudo().with_company(company_id).create({
@@ -288,6 +293,7 @@ class StockRule(models.Model):
# 为同一个product_id创建一个生产订单名称列表
product_id_to_production_names[product_id] = [production.name for production in all_production]
for production_item in productions:
production_programming = self.env['mrp.production'].search(
[('product_id.id', '=', production_item.product_id.id),
('origin', '=', production_item.origin)],

View File

@@ -58,6 +58,15 @@ class QuickEasyOrder(models.Model):
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):
@@ -128,6 +137,10 @@ class QuickEasyOrder(models.Model):
if len(item.upload_model_file) > 1:
raise ValidationError('只允许上传一个文件')
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]
# 附件路径
report_path = file_attachment_id._full_path(file_attachment_id.store_fname)

View File

@@ -80,7 +80,8 @@
<field name="unit_price"/>
<field name="price" options="{'format': false}"/>
<field name="part_drawing_number"/>
<field name="machining_drawings" widget="image"/>
<field name="machining_drawings" filename="machining_drawings_name" widget="pdf_viewer"/>
<field name="machining_drawings_name" invisible="1"/>
<field name="sale_order_id"
attrs='{"invisible": [("sale_order_id","=",False)],"readonly": [("sale_order_id","!=",False)]}'/>
</group>

View File

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