Accept Merge Request #1008: (feature/制造代码优化 -> develop)

Merge Request: 去掉销售订单加工状态

Created By: @马广威
Accepted By: @马广威
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1008?initial=true
This commit is contained in:
马广威
2024-05-11 23:38:58 +08:00
committed by Coding
6 changed files with 28 additions and 27 deletions

View File

@@ -166,5 +166,5 @@ class jdElcp(http.Controller):
return json.dumps({'statusCode': 415, 'statusMessage': '订单号不能为空'}, ensure_ascii=False) return json.dumps({'statusCode': 415, 'statusMessage': '订单号不能为空'}, ensure_ascii=False)
aa = request.env['sale.order'].sudo().search([('name', '=', kw['orderNo'])]) aa = request.env['sale.order'].sudo().search([('name', '=', kw['orderNo'])])
if aa: if aa:
aa.schedule_status = 'received' # aa.schedule_status = 'received'
return json.dumps({'statusCode': 200, 'statusMessage': '修改成功'}, ensure_ascii=False) return json.dumps({'statusCode': 200, 'statusMessage': '修改成功'}, ensure_ascii=False)

View File

@@ -226,8 +226,8 @@ class Manufacturing_Connect(http.Controller):
if production_obj: if production_obj:
production_obj.sudo().work_order_state = '已完成' production_obj.sudo().work_order_state = '已完成'
production_obj.write({'state': 'completed'}) production_obj.write({'state': 'completed'})
request.env['sale.order'].sudo().search( # request.env['sale.order'].sudo().search(
[('name', '=', production_obj.origin)]).write({'schedule_status': 'to deliver'}) # [('name', '=', production_obj.origin)]).write({'schedule_status': 'to deliver'})
except Exception as e: except Exception as e:
res = {'Succeed': False, 'ErrorCode': 202, 'Error': e} res = {'Succeed': False, 'ErrorCode': 202, 'Error': e}

View File

@@ -248,7 +248,7 @@ class StockRule(models.Model):
sale_order = self.env['sale.order'].sudo().search([('name', '=', production.origin)]) sale_order = self.env['sale.order'].sudo().search([('name', '=', production.origin)])
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({
'name': production.name, 'name': production.name,
'order_deadline': sale_order.deadline_of_delivery, 'order_deadline': sale_order.deadline_of_delivery,

View File

@@ -221,9 +221,9 @@ class sf_production_plan(models.Model):
record.sudo().production_id.schedule_state = '已排' record.sudo().production_id.schedule_state = '已排'
record.sudo().production_id.process_state = '待装夹' record.sudo().production_id.process_state = '待装夹'
# self.env['sale.order'].browse(record.production_id.origin).schedule_status = 'to process' # self.env['sale.order'].browse(record.production_id.origin).schedule_status = 'to process'
sale_obj = self.env['sale.order'].search([('name', '=', record.origin)]) # sale_obj = self.env['sale.order'].search([('name', '=', record.origin)])
if 'S' in sale_obj.name: # if 'S' in sale_obj.name:
sale_obj.schedule_status = 'to process' # sale_obj.schedule_status = 'to process'
mrp_production_ids = record.production_id._get_children().ids mrp_production_ids = record.production_id._get_children().ids
print('mrp_production_ids', mrp_production_ids) print('mrp_production_ids', mrp_production_ids)
for i in mrp_production_ids: for i in mrp_production_ids:
@@ -313,8 +313,8 @@ class sf_production_plan(models.Model):
aa.schedule_state = '未排' aa.schedule_state = '未排'
# self.env['sale.order'].browse(record.production_id.origin).schedule_status = 'to shedule' # self.env['sale.order'].browse(record.production_id.origin).schedule_status = 'to shedule'
sale_obj = self.env['sale.order'].search([('name', '=', self.origin)]) sale_obj = self.env['sale.order'].search([('name', '=', self.origin)])
if 'S' in sale_obj.name: # if 'S' in sale_obj.name:
sale_obj.schedule_status = 'to schedule' # sale_obj.schedule_status = 'to schedule'
return self.date_planned_finished return self.date_planned_finished
def liucheng_cs(self): def liucheng_cs(self):

View File

@@ -33,10 +33,10 @@ class ReSaleOrder(models.Model):
payments_way = fields.Selection([('现结', '现结'), ('月结', '月结')], '结算方式', default='现结', tracking=True) payments_way = fields.Selection([('现结', '现结'), ('月结', '月结')], '结算方式', default='现结', tracking=True)
pay_way = fields.Selection([('转账', '转账'), ('微信', '微信'), ('支付宝', '支付宝')], '支付方式') pay_way = fields.Selection([('转账', '转账'), ('微信', '微信'), ('支付宝', '支付宝')], '支付方式')
check_status = fields.Selection([('pending', '待审核'), ('approved', '已审核'), ('fail', '不通过')], '审核状态') check_status = fields.Selection([('pending', '待审核'), ('approved', '已审核'), ('fail', '不通过')], '审核状态')
schedule_status = fields.Selection( # schedule_status = fields.Selection(
[('to schedule', '待排程'), ('to process', '待加工'), ('to deliver', '待发货'), ('to receive', '待收货'), # [('to schedule', '待排程'), ('to process', '待加工'), ('to deliver', '待发货'), ('to receive', '待收货'),
('received', '已收货')], # ('received', '已收货')],
'进度状态') # '进度状态')
payment_term_id = fields.Many2one( payment_term_id = fields.Many2one(
comodel_name='account.payment.term', comodel_name='account.payment.term',
string="交付条件", string="交付条件",

View File

@@ -70,7 +70,7 @@
</xpath> </xpath>
<xpath expr="//form/header/button[@name='action_confirm']" position="after"> <xpath expr="//form/header/button[@name='action_confirm']" position="after">
<field name="check_status" invisible="1"/> <field name="check_status" invisible="1"/>
<field name="schedule_status" invisible="1"/> <!-- <field name="schedule_status" invisible="1"/> -->
<button name="sf_sale.action_sale_order_check_wizard" string="审核" type="action" <button name="sf_sale.action_sale_order_check_wizard" string="审核" type="action"
context="{'default_order_id':active_id}" groups="sf_base.group_sale_director" context="{'default_order_id':active_id}" groups="sf_base.group_sale_director"
attrs="{'invisible': ['|',('check_status','in', ['approved',False,'fail']),('state', 'in', ['cancel'])]}" attrs="{'invisible': ['|',('check_status','in', ['approved',False,'fail']),('state', 'in', ['cancel'])]}"
@@ -84,14 +84,14 @@
<xpath expr="//form/header/button[@name='action_confirm'][2]" position="replace"> <xpath expr="//form/header/button[@name='action_confirm'][2]" position="replace">
<button name="action_confirm" data-hotkey="v" <button name="action_confirm" data-hotkey="v"
string="确认" type="object" context="{'validate_analytic': True}" string="确认" type="object" context="{'validate_analytic': True}"
attrs="{'invisible': ['|','&amp;',('check_status', '!=', 'approved'),('state', 'in', ['draft','cancel']),'&amp;','&amp;',('check_status', '=', 'approved'),('state', 'in', ['sale','cancel']),('schedule_status', 'not in', False)]}"/> attrs="{'invisible': ['|','&amp;',('check_status', '!=', 'approved'),('state', 'in', ['draft','cancel']),'&amp;',('check_status', '=', 'approved'),('state', 'in', ['sale','cancel'])]}"/>
</xpath> </xpath>
<xpath expr="//form/header/button[@name='action_cancel']" position="attributes"> <xpath expr="//form/header/button[@name='action_cancel']" position="attributes">
<attribute name="attrs">{'invisible': ['|','&amp;',('state', 'in', <attribute name="attrs">{'invisible': ['|','&amp;',('state', 'in',
['cancel','draft']),('check_status', ['cancel','draft']),('check_status',
'in', 'in',
[False,'approved']),'&amp;','&amp;',('check_status', '=', 'approved'),('state', 'in', [False,'approved']),'&amp;',('check_status', '=', 'approved'),('state', 'in',
['sale','cancel','draft']),('schedule_status', 'not in', False)]} ['sale','cancel','draft'])]}
</attribute> </attribute>
</xpath> </xpath>
<xpath expr="//form/header/button[@name='action_draft']" position="attributes"> <xpath expr="//form/header/button[@name='action_draft']" position="attributes">
@@ -112,7 +112,7 @@
<field name="deadline_of_delivery" attrs="{'readonly': [('state', 'in', ('sale','cancel'))]}"/> <field name="deadline_of_delivery" attrs="{'readonly': [('state', 'in', ('sale','cancel'))]}"/>
<field name="payments_way" attrs="{'readonly': [('state', 'in', ('sale','cancel'))]}"/> <field name="payments_way" attrs="{'readonly': [('state', 'in', ('sale','cancel'))]}"/>
<field name="pay_way" attrs="{'readonly': [('state', 'in', ('sale','cancel'))]}"/> <field name="pay_way" attrs="{'readonly': [('state', 'in', ('sale','cancel'))]}"/>
<field name="schedule_status" readonly="1"/> <!-- <field name="schedule_status" readonly="1"/> -->
</field> </field>
<xpath expr="//field[@name='order_line']/tree/field[@name='name']" position="before"> <xpath expr="//field[@name='order_line']/tree/field[@name='name']" position="before">
<field name="model_glb_file" widget="Viewer3D" optional="show" <field name="model_glb_file" widget="Viewer3D" optional="show"
@@ -222,20 +222,21 @@
<field name="inherit_id" ref="sale.view_order_tree"/> <field name="inherit_id" ref="sale.view_order_tree"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<tree position="attributes"> <tree position="attributes">
<attribute name="default_order">schedule_status desc,date_order asc</attribute> <!-- <attribute name="default_order">schedule_status desc,date_order asc</attribute> -->
<attribute name="default_order">date_order asc</attribute>
<attribute name="create">False</attribute> <attribute name="create">False</attribute>
</tree> </tree>
<field name="name" position="attributes"> <field name="name" position="attributes">
<attribute name="string">订单号</attribute> <attribute name="string">订单号</attribute>
</field> </field>
<field name="amount_total" position="after"> <!-- <field name="amount_total" position="after"> -->
<field name="schedule_status" widget="badge" <!-- <field name="schedule_status" widget="badge" -->
decoration-success="schedule_status == 'received'" <!-- decoration-success="schedule_status == 'received'" -->
decoration-warning="schedule_status == 'to process'" <!-- decoration-warning="schedule_status == 'to process'" -->
decoration-danger="schedule_status == 'to receive'" <!-- decoration-danger="schedule_status == 'to receive'" -->
decoration-muted="schedule_status == 'to process'" <!-- decoration-muted="schedule_status == 'to process'" -->
decoration-info="schedule_status == 'to schedule'"/> <!-- decoration-info="schedule_status == 'to schedule'"/> -->
</field> <!-- </field> -->
</field> </field>
</record> </record>