parent
35cac8a2b6
commit
0a3fcdaa1a
|
@ -0,0 +1,63 @@
|
|||
diff -r a247523ff3db trytond/trytond/modules/sale_supply/__init__.py
|
||||
--- a/trytond/trytond/modules/sale_supply/__init__.py Mon May 06 15:14:01 2019 +0200
|
||||
+++ b/trytond/trytond/modules/sale_supply/__init__.py Mon May 13 11:30:56 2019 +0200
|
||||
@@ -16,6 +16,7 @@
|
||||
Purchase,
|
||||
ShipmentIn,
|
||||
Template,
|
||||
+ TemplateSupplyOnSale,
|
||||
Product,
|
||||
module='sale_supply', type_='model')
|
||||
Pool.register(
|
||||
diff -r a247523ff3db trytond/trytond/modules/sale_supply/product.py
|
||||
--- a/trytond/trytond/modules/sale_supply/product.py Mon May 06 15:14:01 2019 +0200
|
||||
+++ b/trytond/trytond/modules/sale_supply/product.py Mon May 13 11:29:50 2019 +0200
|
||||
@@ -1,20 +1,37 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
-from trytond.model import fields
|
||||
-from trytond.pool import PoolMeta
|
||||
+from trytond.model import fields, ModelSQL
|
||||
+from trytond.modules.company.model import (CompanyMultiValueMixin,
|
||||
+ CompanyValueMixin)
|
||||
+from trytond.pool import Pool, PoolMeta
|
||||
from trytond.pyson import Eval
|
||||
|
||||
-__all__ = ['Template', 'Product']
|
||||
+__all__ = ['Template', 'Product', 'TemplateSupplyOnSale']
|
||||
+
|
||||
+supply_on_sale = fields.Boolean('Supply On Sale', states={
|
||||
+ 'invisible': ~Eval('purchasable') | ~Eval('salable'),
|
||||
+ }, depends=['purchasable', 'salable'])
|
||||
+
|
||||
+class Template(CompanyMultiValueMixin, metaclass=PoolMeta):
|
||||
+ __name__ = 'product.template'
|
||||
+
|
||||
+ supply_on_sale = fields.MultiValue(supply_on_sale)
|
||||
+ supply_on_sales = fields.One2Many(
|
||||
+ 'product.template.supply_on_sale', 'template', "Supply on sales")
|
||||
+
|
||||
+ @classmethod
|
||||
+ def multivalue_model(cls, field):
|
||||
+ pool = Pool()
|
||||
+ if field == 'supply_on_sale':
|
||||
+ return pool.get('product.template.supply_on_sale')
|
||||
+ return super(Template, cls).multivalue_model(field)
|
||||
|
||||
|
||||
-class Template(metaclass=PoolMeta):
|
||||
- __name__ = 'product.template'
|
||||
-
|
||||
- supply_on_sale = fields.Boolean('Supply On Sale',
|
||||
- states={
|
||||
- 'invisible': ~Eval('purchasable') | ~Eval('salable'),
|
||||
- },
|
||||
- depends=['purchasable', 'salable'])
|
||||
+class TemplateSupplyOnSale(ModelSQL, CompanyValueMixin):
|
||||
+ "Template Supply On Sale"
|
||||
+ __name__ = 'product.template.supply_on_sale'
|
||||
+ template = fields.Many2One('product.template', 'Product Template')
|
||||
+ supply_on_sale = supply_on_sale
|
||||
|
||||
|
||||
class Product(metaclass=PoolMeta):
|
1
series
1
series
|
@ -11,6 +11,7 @@ issue4030.diff # [analytic_account] Not selected root accounts in analytic accou
|
|||
analitic_line_company_rules.diff # [analytic_account] Not selected root accounts in analytic account lines
|
||||
|
||||
sale_list_price.diff # [sale] Can't convert to currency with list price is null (multicompany)
|
||||
sale_supply_supply_on_sale_multivalue.diff # [sale_supply] supply_on_sale field multvalue #035100
|
||||
|
||||
lock_stock_move.diff # [stock] Function to overwrite if lock table or not
|
||||
issue4482.diff # [stock] stock inventory misses company access rule
|
||||
|
|
Loading…
Reference in New Issue