!10819 Merge branch 'dev' of <a href="https://gitee.com/jinan-pengyusen-data/gzth">https://gitee.com/jinan-pengyusen-data/gzth</a> into dev_wang
Merge pull request !10819 from 李鹏宇/dev_wang
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from odoo import api, fields, models
|
||||
from odoo.exceptions import UserError
|
||||
import json
|
||||
|
||||
|
||||
@@ -276,6 +277,20 @@ class StockPicking(models.Model):
|
||||
}
|
||||
}
|
||||
|
||||
def action_revoke_receipt(self):
|
||||
"""撤回入库:仅系统管理员可操作,将入库状态回退到证明状态"""
|
||||
self.ensure_one()
|
||||
if not self.env.user.has_group('base.group_system'):
|
||||
raise UserError('只有系统管理员才能撤回入库!')
|
||||
if self.receipt_status != 'receipt':
|
||||
raise UserError('只有入库状态才能撤回!')
|
||||
self.write({
|
||||
'receipt_status': 'certification',
|
||||
'certifier_id': False,
|
||||
'certification_date': False,
|
||||
})
|
||||
return True
|
||||
|
||||
def action_acceptance(self):
|
||||
"""验收按钮:自动填充验收人和验收时间"""
|
||||
self.ensure_one()
|
||||
|
||||
@@ -32,6 +32,9 @@
|
||||
</xpath>
|
||||
<xpath expr="//header/button[@name='%(stock.act_stock_return_picking)d']" position="after">
|
||||
<button name="action_acceptance" string="验收" type="object" class="btn-primary" invisible="receipt_status != 'acceptance'"/>
|
||||
<button name="action_revoke_receipt" string="撤回入库" type="object" class="btn-secondary"
|
||||
invisible="receipt_status != 'receipt'"
|
||||
groups="base.group_system"/>
|
||||
</xpath>
|
||||
<xpath expr="//page[@name='operations']/field[@name='move_ids_without_package']" position="after">
|
||||
<group>
|
||||
|
||||
Reference in New Issue
Block a user