1.修复销售总监看不到销售订单2.优化销售审核向导3.优化销售

This commit is contained in:
jinling.yang
2023-12-20 17:45:29 +08:00
parent ef47597cf9
commit bbb5ddb177
5 changed files with 69 additions and 57 deletions

View File

@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
from odoo import models, api, fields
from odoo.exceptions import UserError
class saleOrderCheckWizard(models.TransientModel):
@@ -8,9 +9,17 @@ class saleOrderCheckWizard(models.TransientModel):
_description = '报价/销售订单审核向导'
order_id = fields.Many2one('sale.order')
check_state = fields.Selection([('pass', '通过'), ('back', '退回')], '审核状态', default='pass')
# check_state = fields.Selection([('pass', '通过'), ('back', '退回')], '处理意见', default='pass')
check_audit = fields.Text('审核意见')
def submit(self):
self.order_id.check_status = 'unchecked' if not self.check_state == 'pass' else 'checked'
self.order_id.message_ids = '1'
self.order_id.check_status = 'approved'
self.order_id.remark = self.check_audit
def back(self):
if not self.check_audit:
raise UserError('请输入原因')
else:
self.order_id.check_status = 'fail'
self.order_id.remark = self.check_audit

View File

@@ -6,20 +6,22 @@
<field name="arch" type="xml">
<form>
<field name="order_id" invisible="True"/>
<group>
<field name="check_state" required="True"/>
<field name="check_audit" attrs="{'required': [('check_state', '=', 'back')]}"/>
</group>
<group>
<!-- <field name="check_state" widget="radio" options="{'horizontal': true}" required="True" string=""/>-->
<field name="check_audit" placeholder="原因.." nolabel="1" colspan="2"/>
</group>
<footer>
<button string="提交" name="submit" type="object" class="oe_highlight"/>
<button string="取消" class="btn btn-secondary" special="cancel"/>
<button string="通过" name="submit" type="object" class="oe_highlight"/>
<button string="退回" name="back" type="object" class="btn btn-secondary" />
<!-- <button string="提交" name="submit" type="object" class="oe_highlight"/>-->
<!-- <button string="取消" class="btn btn-secondary" special="cancel"/>-->
</footer>
</form>
</field>
</record>
<record id="action_sale_order_check_wizard" model="ir.actions.act_window">
<field name="name">销售订单审核向导</field>
<field name="name">审核</field>
<field name="res_model">sale.order.check.wizard</field>
<field name="view_mode">form</field>
<field name="target">new</field>