Compare commits
11 Commits
feature/仓库
...
feature/优化
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ba955ca658 | ||
|
|
ccbe311c58 | ||
|
|
4c58f4d7f3 | ||
|
|
b5a3815f1f | ||
|
|
988c4a460d | ||
|
|
c050e2f11a | ||
|
|
8bc68e1edd | ||
|
|
ea6fd42b2e | ||
|
|
625499f758 | ||
|
|
0c2d6dd582 | ||
|
|
005a7bb68e |
@@ -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):
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -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([
|
||||||
('待装夹', '待装夹'),
|
('待装夹', '待装夹'),
|
||||||
|
|||||||
@@ -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)],
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
Reference in New Issue
Block a user