1.优化生成销售订单和产品的接口:bfm分配工厂时将“结算方式”和“支付方式”传到该接口内的生成报价订单方法里
2.优化销售和报价查询及详情页面:新增“结算方式”和“支付方式”两个字段;销售的tree列表的“号码”显示改为“订单号”;报价的tree列表的“号码”显示改为“订单号”,创建时间改为“下单时间” 3.优化快速订单:tree列表去掉“表面工艺参数”字段,新增“创建人”和“创建时间”2个字段;详情页面新增“加工时长”字段
This commit is contained in:
@@ -27,7 +27,7 @@ class Sf_Bf_Connect(http.Controller):
|
||||
bfm_process_order_list = json.loads(kw['bfm_process_order_list'])
|
||||
order_id = request.env['sale.order'].with_user(request.env.ref("base.user_admin")).sale_order_create(
|
||||
company_id, kw['delivery_name'], kw['delivery_telephone'], kw['delivery_address'],
|
||||
kw['delivery_end_date'])
|
||||
kw['delivery_end_date'], kw['payments_way'], kw['pay_way'])
|
||||
i = 1
|
||||
# 给sale_order的default_code字段赋值
|
||||
aa = request.env['sale.order'].sudo().search([('name', '=', order_id.name)])
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
'category': 'sf',
|
||||
'website': 'https://www.sf.jikimo.com',
|
||||
'depends': ['mrp', 'base', 'sale', 'sf_manufacturing', 'web_widget_model_viewer', 'mrp_subcontracting', 'purchase_stock',
|
||||
'uom'],
|
||||
'uom','jikimo_frontend'],
|
||||
'data': [
|
||||
'data/product_data.xml',
|
||||
'data/uom_data.xml',
|
||||
|
||||
@@ -336,23 +336,24 @@
|
||||
</group>
|
||||
<group col="1" attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}">
|
||||
<group string="适合加工方式">
|
||||
<field name="suitable_machining_method_ids" string="" widget="many2many_checkboxes"/>
|
||||
<field name="suitable_machining_method_ids" string=""
|
||||
widget="custom_many2many_checkboxes"/>
|
||||
</group>
|
||||
<group>
|
||||
<group string="刀尖特征">
|
||||
<field name="blade_tip_characteristics_ids" string=""
|
||||
widget="many2many_checkboxes"/>
|
||||
widget="custom_many2many_checkboxes"/>
|
||||
</group>
|
||||
<group string="柄部类型">
|
||||
<field name="handle_type_ids" string="" widget="many2many_checkboxes"/>
|
||||
<field name="handle_type_ids" string="" widget="custom_many2many_checkboxes"/>
|
||||
</group>
|
||||
</group>
|
||||
<group>
|
||||
<group string="走刀方向">
|
||||
<field name="cutting_direction_ids" string="" widget="many2many_checkboxes"/>
|
||||
<field name="cutting_direction_ids" string="" widget="custom_many2many_checkboxes"/>
|
||||
</group>
|
||||
<group string="适合冷却液">
|
||||
<field name="suitable_coolant_ids" string="" widget="many2many_checkboxes"/>
|
||||
<field name="suitable_coolant_ids" string="" widget="custom_many2many_checkboxes"/>
|
||||
</group>
|
||||
</group>
|
||||
<notebook>
|
||||
|
||||
@@ -44,11 +44,9 @@ class SfMaintenanceEquipment(models.Model):
|
||||
overhaul_period = fields.Integer(string='预防检修频次')
|
||||
overhaul_duration = fields.Float(string='检修时长')
|
||||
|
||||
|
||||
overhaul_id = fields.Many2one('equipment.maintenance.standards', string='设备检修标准',
|
||||
domain="[('maintenance_type','=','检修')]")
|
||||
|
||||
|
||||
@api.onchange('eq_maintenance_id', 'overhaul_id')
|
||||
def _compute_equipment_maintenance_standards_ids(self):
|
||||
for record in self:
|
||||
@@ -145,7 +143,6 @@ class SfMaintenanceEquipment(models.Model):
|
||||
machine_tool_id = fields.Many2one('sf.machine_tool', '机床')
|
||||
sf_maintenance_logs_ids = fields.One2many('sf.maintenance.logs', 'maintenance_equipment_id', '设备故障日志')
|
||||
|
||||
|
||||
def name_get(self):
|
||||
result = []
|
||||
for parameter in self:
|
||||
@@ -156,7 +153,6 @@ class SfMaintenanceEquipment(models.Model):
|
||||
result.append((parameter.id, name))
|
||||
return result
|
||||
|
||||
|
||||
@api.constrains('rotate_speed')
|
||||
def _check_rotate_speed(self):
|
||||
if self.rotate_speed <= 0:
|
||||
@@ -478,14 +474,17 @@ class SfMaintenanceEquipment(models.Model):
|
||||
|
||||
image_id = fields.Many2many('maintenance.equipment.image', 'equipment_id', string='设备图文')
|
||||
|
||||
|
||||
class MaintenanceStandardImage(models.Model):
|
||||
_name = 'maintenance.equipment.image'
|
||||
_description = '设备图文展示'
|
||||
|
||||
_description = '能力特征库'
|
||||
|
||||
active = fields.Boolean('有效', default=True)
|
||||
name = fields.Char('加工能力')
|
||||
image = fields.Binary(string='设备图文')
|
||||
name = fields.Char('名称')
|
||||
image = fields.Binary(string='图文')
|
||||
type = fields.Selection(
|
||||
[('加工能力', '加工能力'), ('刀尖特征', '刀尖特征'), ('柄部类型', '柄部类型'), ('走刀方向', '走刀方向'), ('冷却液', '冷却液')],
|
||||
string='特征')
|
||||
equipment_id = fields.Many2many('maintenance.equipment', 'image_id', string='设备')
|
||||
|
||||
@api.model
|
||||
@@ -518,6 +517,3 @@ class MaintenanceStandardImage(models.Model):
|
||||
new_res.append([id, name, data_uri])
|
||||
# 返回新的结果列表
|
||||
return new_res
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -381,8 +381,9 @@
|
||||
<field name="name">maintenance.equipment.image.tree</field>
|
||||
<field name="model">maintenance.equipment.image</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="设备图文">
|
||||
<tree string="能力特征库">
|
||||
<field name="name"/>
|
||||
<field name="type"/>
|
||||
<field name="image" widget="image"/>
|
||||
<field name="equipment_id" invisible="1"/>
|
||||
<field name="active" invisible="1"/>
|
||||
@@ -394,11 +395,12 @@
|
||||
<field name="name">maintenance.equipment.image.form</field>
|
||||
<field name="model">maintenance.equipment.image</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="设备图文">
|
||||
<form string="能力特征库">
|
||||
<sheet>
|
||||
<group>
|
||||
<field name="name"/>
|
||||
<field name="image" widget="image"/>
|
||||
<field name="name" required="1"/>
|
||||
<field name="type" required="1"/>
|
||||
<field name="image" widget="image" required="1"/>
|
||||
<field name="equipment_id" invisible="1"/>
|
||||
<field name="active" invisible="1"/>
|
||||
</group>
|
||||
@@ -408,14 +410,14 @@
|
||||
</record>
|
||||
|
||||
<record id="action_maintenance_equipment_image" model="ir.actions.act_window">
|
||||
<field name="name">设备图文图文</field>
|
||||
<field name="name">能力特征库</field>
|
||||
<field name="res_model">maintenance.equipment.image</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[]</field>
|
||||
</record>
|
||||
<menuitem
|
||||
<menuitem
|
||||
id="maintenance_equipment_image_form"
|
||||
name="设备图文展示"
|
||||
name="能力特征库"
|
||||
parent="maintenance.menu_m_request"
|
||||
action="action_maintenance_equipment_image"
|
||||
groups="maintenance.group_equipment_manager,base.group_user"
|
||||
|
||||
@@ -91,15 +91,19 @@ class ResProductMo(models.Model):
|
||||
cutting_tool_coarse_medium_fine = fields.Selection([('粗', '粗'), ('中', '中'), ('精', '精')], '粗/中/精')
|
||||
cutting_tool_run_out_accuracy_max = fields.Float('端跳精度max', digits=(6, 1))
|
||||
cutting_tool_run_out_accuracy_min = fields.Float('端跳精度min', digits=(6, 1))
|
||||
suitable_machining_method_ids = fields.Many2many('sf.suitable.machining.method',
|
||||
'rel_suitable_machining_method_product_template', '适合加工方式')
|
||||
blade_tip_characteristics_ids = fields.Many2many('sf.blade.tip.characteristics',
|
||||
'rel_blade_tip_characteristics_product_template', '刀尖特征')
|
||||
handle_type_ids = fields.Many2many('sf.handle.type', 'rel_handle_type_product_template', '柄部类型')
|
||||
cutting_direction_ids = fields.Many2many('sf.cutting.direction', 'rel_cutting_direction_product_template',
|
||||
'走刀方向')
|
||||
suitable_coolant_ids = fields.Many2many('sf.suitable.coolant', 'rel_suitable_coolant_product_template',
|
||||
'适合冷却液')
|
||||
suitable_machining_method_ids = fields.Many2many('maintenance.equipment.image',
|
||||
'rel_machining_product_template', '适合加工方式',
|
||||
domain=[('type', '=', '加工能力')])
|
||||
blade_tip_characteristics_ids = fields.Many2many('maintenance.equipment.image',
|
||||
'rel_blade_tip_product_template', '刀尖特征',
|
||||
domain=[('type', '=', '刀尖特征')])
|
||||
handle_type_ids = fields.Many2many('maintenance.equipment.image', 'rel_handle_product_template', '柄部类型',
|
||||
domain=[('type', '=', '柄部类型')])
|
||||
cutting_direction_ids = fields.Many2many('maintenance.equipment.image', 'rel_cutting_product_template',
|
||||
'走刀方向', domain=[('type', '=', '走刀方向')])
|
||||
suitable_coolant_ids = fields.Many2many('maintenance.equipment.image', 'rel_coolant_product_template',
|
||||
'适合冷却液', domain=[('type', '=', '冷却液')])
|
||||
|
||||
|
||||
# @api.constrains('suitable_machining_method_ids')
|
||||
# def _check_suitable_machining_method_ids(self):
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
""",
|
||||
'category': 'sf',
|
||||
'website': 'https://www.sf.jikimo.com',
|
||||
'depends': ['sale_management', 'web_widget_model_viewer', 'sale_stock'],
|
||||
'depends': ['sale', 'web_widget_model_viewer'],
|
||||
'data': [
|
||||
'security/group_security.xml',
|
||||
'security/ir.model.access.csv',
|
||||
|
||||
@@ -16,6 +16,7 @@ import requests
|
||||
class QuickEasyOrder(models.Model):
|
||||
_name = 'quick.easy.order'
|
||||
_description = '简易下单'
|
||||
_order = 'id desc'
|
||||
|
||||
name = fields.Char('订单编号', default=lambda self: self.env['ir.sequence'].next_by_code('quick.easy.order'))
|
||||
model_length = fields.Float('长(mm)', digits=(16, 3))
|
||||
@@ -48,6 +49,7 @@ class QuickEasyOrder(models.Model):
|
||||
model_color_state = fields.Selection([
|
||||
('success', '成功'),
|
||||
('fail', '失败')], string='模型上色状态')
|
||||
processing_time = fields.Integer('加工时长(min)')
|
||||
|
||||
@api.depends('unit_price', 'quantity')
|
||||
def _compute_total_amount(self):
|
||||
|
||||
@@ -6,14 +6,16 @@ import base64
|
||||
class ReSaleOrder(models.Model):
|
||||
_inherit = 'sale.order'
|
||||
|
||||
deadline_of_delivery = fields.Date('交货截止日期')
|
||||
deadline_of_delivery = fields.Date('订单交期')
|
||||
person_of_delivery = fields.Char('交货人')
|
||||
telephone_of_delivery = fields.Char('交货人电话号码')
|
||||
address_of_delivery = fields.Char('交货人地址')
|
||||
payments_way = fields.Selection([('现结', '现结'), ('月结', '月结')], '结算方式', default='现结')
|
||||
pay_way = fields.Selection([('转账', '转账'), ('微信', '微信'), ('支付宝', '支付宝')], '支付方式')
|
||||
|
||||
# 业务平台分配工厂后在智能工厂先创建销售订单
|
||||
def sale_order_create(self, company_id, delivery_name, delivery_telephone, delivery_address,
|
||||
deadline_of_delivery):
|
||||
deadline_of_delivery, payments_way, pay_way):
|
||||
now_time = datetime.datetime.now()
|
||||
partner = self.get_customer()
|
||||
order_id = self.env['sale.order'].sudo().create({
|
||||
@@ -22,11 +24,12 @@ class ReSaleOrder(models.Model):
|
||||
'name': self.env['ir.sequence'].next_by_code('sale.order', sequence_date=now_time),
|
||||
'partner_id': partner.id,
|
||||
'state': 'draft',
|
||||
# 'user_id': user_id.id,
|
||||
'person_of_delivery': delivery_name,
|
||||
'telephone_of_delivery': delivery_telephone,
|
||||
'address_of_delivery': delivery_address,
|
||||
'deadline_of_delivery': deadline_of_delivery
|
||||
'deadline_of_delivery': deadline_of_delivery,
|
||||
'payments_way': payments_way,
|
||||
'pay_way': pay_way,
|
||||
})
|
||||
return order_id
|
||||
|
||||
@@ -49,7 +52,7 @@ class ReSaleOrder(models.Model):
|
||||
product.materials_id.name),
|
||||
'price_unit': product.list_price,
|
||||
'product_uom_qty': item['number'],
|
||||
'model_glb_file': base64.b64decode(item['model_file']),
|
||||
'model_glb_file': base64.b64decode(item['model_file']),
|
||||
}
|
||||
return self.env['sale.order.line'].create(vals)
|
||||
|
||||
|
||||
@@ -22,10 +22,12 @@
|
||||
<field name="customer_id" string="客户"/>
|
||||
<field name="material_id"/>
|
||||
<field name="material_model_id"/>
|
||||
<!-- <field name="parameter_ids" string="表面工艺参数" widget="many2many_tags"/>-->
|
||||
<!-- <field name="parameter_ids" string="表面工艺参数" widget="many2many_tags"/>-->
|
||||
<field name="quantity"/>
|
||||
<field name="unit_price"/>
|
||||
<field name="price"/>
|
||||
<field name="create_uid" string="创建人"/>
|
||||
<field name="create_date" string="创建时间"/>
|
||||
<field optional="hide" name="delivery_time"/>
|
||||
</tree>
|
||||
</field>
|
||||
@@ -74,6 +76,7 @@
|
||||
options="{'format': false}"/>
|
||||
</div>
|
||||
<field name="model_volume" attrs="{'invisible': [('model_file', '=', False)]}"/>
|
||||
<field name="processing_time"/>
|
||||
</group>
|
||||
</group>
|
||||
</sheet>
|
||||
|
||||
@@ -1,17 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<odoo>
|
||||
<data>
|
||||
<record id="view_order_tree_inherit_sf" model="ir.ui.view">
|
||||
<field name="name">sale.order.tree</field>
|
||||
<field name="model">sale.order</field>
|
||||
<field name="inherit_id" ref="sale_stock.view_order_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='name']" position="after">
|
||||
<!-- <attribute name="string">订单号</attribute>-->
|
||||
<field name="deadline_of_delivery"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="view_sale_order_form_inherit_sf">
|
||||
<field name="name">sale.order.form.inherit.sf</field>
|
||||
@@ -20,6 +9,8 @@
|
||||
<field name="arch" type="xml">
|
||||
<field name="payment_term_id" position="after">
|
||||
<field name="deadline_of_delivery"/>
|
||||
<field name="payments_way"/>
|
||||
<field name="pay_way"/>
|
||||
</field>
|
||||
<xpath expr="//field[@name='order_line']/tree/field[@name='name']" position="before">
|
||||
<field name="model_glb_file" widget="Viewer3D" optional="show"
|
||||
@@ -37,6 +28,9 @@
|
||||
<field name="model">sale.order</field>
|
||||
<field name="inherit_id" ref="sale_management.sale_order_form_quote"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="date_order" position="attributes">
|
||||
<attribute name="string">下单日期</attribute>
|
||||
</field>
|
||||
<field name="sale_order_template_id" position="after">
|
||||
<!-- <label for="person_of_delivery" string="交货信息"/>-->
|
||||
<!-- <div>-->
|
||||
@@ -52,19 +46,28 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_quotation_with_onboarding_tree_inherit_sf" model="ir.ui.view">
|
||||
<field name="name">sale.order.quotation.tree.inherit.sf</field>
|
||||
<field name="model">sale.order</field>
|
||||
<field name="inherit_id" ref="sale.view_quotation_tree_with_onboarding"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="name" position="attributes">
|
||||
<attribute name="string">订单号</attribute>
|
||||
</field>
|
||||
<field name="create_date" position="attributes">
|
||||
<attribute name="string">下单时间</attribute>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_quotation_tree_inherit_sf" model="ir.ui.view">
|
||||
<record id="view_order_tree_inherit_sf" model="ir.ui.view">
|
||||
<field name="name">sale.order.tree</field>
|
||||
<field name="model">sale.order</field>
|
||||
<field name="inherit_id" ref="sale.view_quotation_tree"/>
|
||||
<field name="mode">primary</field>
|
||||
<field name="inherit_id" ref="sale.view_order_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='name']" position="attributes">
|
||||
<field name="name" position="attributes">
|
||||
<attribute name="string">订单号</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='create_date']" position="attributes">
|
||||
<attribute name="string">下单时间</attribute>
|
||||
</xpath>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
</model-viewer>
|
||||
</t>
|
||||
<t t-if="!props.value">
|
||||
<div style="color:#D23F3A">当前制造订单暂无模型</div>
|
||||
<div style="color:#D23F3A">暂无模型</div>
|
||||
</t>
|
||||
|
||||
<!-- <model-viewer-->
|
||||
|
||||
Reference in New Issue
Block a user