优化采购和销售
This commit is contained in:
25
sf_sale/wizard/purchase_order_wizard.py
Normal file
25
sf_sale/wizard/purchase_order_wizard.py
Normal file
@@ -0,0 +1,25 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from odoo import models, api, fields
|
||||
from odoo.exceptions import UserError
|
||||
|
||||
|
||||
class PurchaseOrderWizard(models.TransientModel):
|
||||
_name = 'purchase.order.wizard'
|
||||
_description = '采购向导'
|
||||
|
||||
order_id = fields.Many2one('purchase.order')
|
||||
# check_state = fields.Selection([('pass', '通过'), ('back', '退回')], '处理意见', default='pass')
|
||||
check_audit = fields.Text('审核意见')
|
||||
|
||||
def submit(self):
|
||||
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.write({'check_status': 'fail', 'remark': self.check_audit})
|
||||
|
||||
def confirm(self):
|
||||
self.order_id.check_status = 'pending'
|
||||
Reference in New Issue
Block a user