Add button to process requisition
issue9109 review274941016
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
* Add button to process requisition
|
||||
|
||||
Version 5.4.0 - 2019-11-04
|
||||
* Bug fixes (see mercurial logs for details)
|
||||
* Remove domain constraint on unit
|
||||
|
||||
@@ -189,6 +189,13 @@ class PurchaseRequisition(Workflow, ModelSQL, ModelView):
|
||||
'invisible': Eval('state') != 'waiting',
|
||||
'depends': ['state'],
|
||||
},
|
||||
'process': {
|
||||
'invisible': ~Eval('state').in_(
|
||||
['approved', 'processing']),
|
||||
'icon': If(Eval('state') == 'approved',
|
||||
'tryton-forward', 'tryton-refresh'),
|
||||
'depends': ['state'],
|
||||
},
|
||||
'reject': {
|
||||
'invisible': Eval('state') != 'waiting',
|
||||
'depends': ['state'],
|
||||
@@ -382,6 +389,7 @@ class PurchaseRequisition(Workflow, ModelSQL, ModelView):
|
||||
pass
|
||||
|
||||
@classmethod
|
||||
@ModelView.button
|
||||
def process(cls, requisitions):
|
||||
done = []
|
||||
process = []
|
||||
|
||||
@@ -209,6 +209,16 @@ this repository contains the full copyright notices and license terms.
|
||||
<field name="group" ref="group_purchase_requisition_approval"/>
|
||||
</record>
|
||||
|
||||
<record model="ir.model.button" id="requisition_process_button">
|
||||
<field name="name">process</field>
|
||||
<field name="string">Process</field>
|
||||
<field name="model" search="[('model', '=', 'purchase.requisition')]"/>
|
||||
</record>
|
||||
<record model="ir.model.button-res.group" id="requisition_process_button_group_purchase_requisition_approval">
|
||||
<field name="button" ref="requisition_process_button"/>
|
||||
<field name="group" ref="group_purchase_requisition_approval"/>
|
||||
</record>
|
||||
|
||||
<record model="ir.model.button" id="requisition_reject_button">
|
||||
<field name="name">reject</field>
|
||||
<field name="string">Reject</field>
|
||||
|
||||
@@ -38,5 +38,6 @@ this repository contains the full copyright notices and license terms. -->
|
||||
<button name="draft"/>
|
||||
<button name="wait" icon="tryton-forward"/>
|
||||
<button name="approve" icon="tryton-ok"/>
|
||||
<button name="process"/>
|
||||
</group>
|
||||
</form>
|
||||
|
||||
Reference in New Issue
Block a user