Adapt sale_supply_supply_on_sale_multivalue.diff to latest default changes.
This commit is contained in:
parent
77d3a5cb13
commit
473405416a
|
@ -2,37 +2,40 @@ 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,
|
||||
purchase.Purchase,
|
||||
stock.ShipmentIn,
|
||||
product.Template,
|
||||
+ product.TemplateSupplyOnSale,
|
||||
product.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 @@
|
||||
@@ -1,18 +1,35 @@
|
||||
# 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.pool import Pool, PoolMeta
|
||||
+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(metaclass=PoolMeta):
|
||||
+class Template(CompanyMultiValueMixin, metaclass=PoolMeta):
|
||||
+ __name__ = 'product.template'
|
||||
+
|
||||
__name__ = 'product.template'
|
||||
|
||||
- supply_on_sale = fields.Boolean('Supply On Sale',
|
||||
- states={
|
||||
- 'invisible': ~Eval('purchasable') | ~Eval('salable'),
|
||||
- },
|
||||
- depends=['purchasable', 'salable'])
|
||||
+ supply_on_sale = fields.MultiValue(supply_on_sale)
|
||||
+ supply_on_sales = fields.One2Many(
|
||||
+ 'product.template.supply_on_sale', 'template', "Supply on sales")
|
||||
|
@ -43,21 +46,13 @@ diff -r a247523ff3db trytond/trytond/modules/sale_supply/product.py
|
|||
+ 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):
|
||||
|
|
Loading…
Reference in New Issue