Register Product and override MissingFunction fields
issue5087
This commit is contained in:
1 parent
446f70ca69
commit
f0c5087aff
2 files changed
+22
-1
No files matched your search
@@ -12,6 +12,7 @@ def register():
|
||||
Move,
|
||||
Category,
|
||||
Template,
|
||||
Product,
|
||||
Configuration,
|
||||
FiscalYear,
|
||||
AccountMove,
|
||||
|
||||
+21
-1
@@ -12,7 +12,7 @@ from trytond.pool import Pool, PoolMeta
|
||||
from trytond.modules.account_product import MissingFunction
|
||||
from trytond.modules.product import price_digits, TemplateFunction
|
||||
|
||||
__all__ = ['Category', 'Template', 'UpdateCostPriceAsk',
|
||||
__all__ = ['Category', 'Template', 'Product', 'UpdateCostPriceAsk',
|
||||
'UpdateCostPriceShowMove', 'UpdateCostPrice']
|
||||
__metaclass__ = PoolMeta
|
||||
|
||||
@@ -180,6 +180,26 @@ class Template:
|
||||
})
|
||||
|
||||
|
||||
class Product:
|
||||
__name__ = 'product.product'
|
||||
# Avoid raise of UserError from MissingFunction
|
||||
account_stock_used = fields.Function(
|
||||
fields.Many2One('account.account', 'Account Stock Used'),
|
||||
'get_template')
|
||||
account_stock_supplier_used = fields.Function(
|
||||
fields.Many2One('account.account', 'Account Stock Supplier Used'),
|
||||
'get_template')
|
||||
account_stock_customer_used = fields.Function(
|
||||
fields.Many2One('account.account', 'Account Stock Customer Used'),
|
||||
'get_template')
|
||||
account_stock_production_used = fields.Function(
|
||||
fields.Many2One('account.account', 'Account Stock Production Used'),
|
||||
'get_template')
|
||||
account_stock_lost_found_used = fields.Function(
|
||||
fields.Many2One('account.account', 'Account Stock Lost and Found'),
|
||||
'get_template')
|
||||
|
||||
|
||||
class UpdateCostPriceAsk(ModelView):
|
||||
'Update Cost Price Ask'
|
||||
__name__ = 'product.update_cost_price.ask'
|
||||
|
||||
Reference in new issue
Block a user