Allow cancellation stock group to cancel running and done productions
Closes #13899
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
* Allow cancellation stock group to cancel running and done productions
|
||||
|
||||
Version 7.8.0 - 2025-12-15
|
||||
--------------------------
|
||||
|
||||
@@ -16,7 +16,7 @@ from trytond.modules.company.model import employee_field, set_employee
|
||||
from trytond.modules.product import price_digits, round_price
|
||||
from trytond.modules.stock.shipment import ShipmentAssignMixin
|
||||
from trytond.pool import Pool, PoolMeta
|
||||
from trytond.pyson import Bool, Eval, If
|
||||
from trytond.pyson import Bool, Eval, Id, If
|
||||
from trytond.transaction import Transaction
|
||||
|
||||
from .exceptions import CostWarning
|
||||
@@ -201,8 +201,12 @@ class Production(
|
||||
))
|
||||
cls._buttons.update({
|
||||
'cancel': {
|
||||
'invisible': ~Eval('state').in_(['request', 'draft',
|
||||
'assigned']),
|
||||
'invisible': (
|
||||
(Eval('state') == 'cancelled')
|
||||
| (Eval('state').in_(['running', 'done'])
|
||||
& ~Id('stock',
|
||||
'group_stock_cancellation').in_(
|
||||
Eval('context', {}).get('groups', [])))),
|
||||
'depends': ['state'],
|
||||
},
|
||||
'draft': {
|
||||
|
||||
Reference in New Issue
Block a user