changeset d6382235d0aa in modules/production:default
details:
https://hg.tryton.org/modules/production?cmd=changeset;node=d6382235d0aa
description:
Add model, record and records attribute on Wizard
issue9421
review309861012
diffstat:
bom.py | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diffs (22 lines):
diff -r 2487e0ea0f34 -r d6382235d0aa bom.py
--- a/bom.py Sat Jun 06 10:30:11 2020 +0100
+++ b/bom.py Tue Jul 07 23:56:10 2020 +0200
@@ -2,7 +2,6 @@
# this repository contains the full copyright notices and license terms.
from trytond.model import ModelView, ModelSQL, DeactivableMixin, fields, Unique
from trytond.wizard import Wizard, StateView, Button
-from trytond.transaction import Transaction
from trytond.pyson import Eval
from trytond.pool import Pool
@@ -244,9 +243,8 @@
])
def default_start(self, fields):
- Product = Pool().get('product.product')
defaults = {}
- product = Product(Transaction().context['active_id'])
+ product = self.record
defaults['category'] = product.default_uom.category.id
if getattr(self.start, 'uom', None):
defaults['uom'] = self.start.uom.id