Migrate to py3
This commit is contained in:
parent
b30484d9dc
commit
e59e421726
|
@ -1,7 +1,6 @@
|
||||||
# This file is part of product_special_price module for Tryton.
|
# This file is part of product_special_price module for Tryton.
|
||||||
# The COPYRIGHT file at the top level of this repository contains the full
|
# The COPYRIGHT file at the top level of this repository contains the full
|
||||||
# copyright notices and license terms.
|
# copyright notices and license terms.
|
||||||
|
|
||||||
from trytond.pool import Pool
|
from trytond.pool import Pool
|
||||||
from . import shop
|
from . import shop
|
||||||
from . import product
|
from . import product
|
||||||
|
|
|
@ -19,8 +19,7 @@ STATES = {
|
||||||
DEPENDS = ['active']
|
DEPENDS = ['active']
|
||||||
|
|
||||||
|
|
||||||
class Template:
|
class Template(metaclass=PoolMeta):
|
||||||
__metaclass__ = PoolMeta
|
|
||||||
__name__ = 'product.template'
|
__name__ = 'product.template'
|
||||||
special_price = fields.MultiValue(fields.Numeric(
|
special_price = fields.MultiValue(fields.Numeric(
|
||||||
"Special Price", digits=price_digits,
|
"Special Price", digits=price_digits,
|
||||||
|
@ -41,7 +40,6 @@ class Template:
|
||||||
class ProductSpecialPrice(ModelSQL, CompanyValueMixin):
|
class ProductSpecialPrice(ModelSQL, CompanyValueMixin):
|
||||||
"Product Special Price"
|
"Product Special Price"
|
||||||
__name__ = 'product.special_price'
|
__name__ = 'product.special_price'
|
||||||
|
|
||||||
template = fields.Many2One(
|
template = fields.Many2One(
|
||||||
'product.template', "Template", ondelete='CASCADE', select=True)
|
'product.template', "Template", ondelete='CASCADE', select=True)
|
||||||
special_price = fields.Numeric("Special Price", digits=price_digits)
|
special_price = fields.Numeric("Special Price", digits=price_digits)
|
||||||
|
@ -66,8 +64,7 @@ class ProductSpecialPrice(ModelSQL, CompanyValueMixin):
|
||||||
parent='template', fields=fields)
|
parent='template', fields=fields)
|
||||||
|
|
||||||
|
|
||||||
class Product:
|
class Product(metaclass=PoolMeta):
|
||||||
__metaclass__ = PoolMeta
|
|
||||||
__name__ = 'product.product'
|
__name__ = 'product.product'
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|
5
setup.py
5
setup.py
|
@ -7,10 +7,7 @@ from setuptools import setup
|
||||||
import re
|
import re
|
||||||
import os
|
import os
|
||||||
import io
|
import io
|
||||||
try:
|
from configparser import ConfigParser
|
||||||
from configparser import ConfigParser
|
|
||||||
except ImportError:
|
|
||||||
from ConfigParser import ConfigParser
|
|
||||||
|
|
||||||
MODULE = 'product_special_price'
|
MODULE = 'product_special_price'
|
||||||
PREFIX = 'trytonzz'
|
PREFIX = 'trytonzz'
|
||||||
|
|
4
shop.py
4
shop.py
|
@ -8,10 +8,8 @@ from trytond.pyson import Eval
|
||||||
__all__ = ['SaleShop']
|
__all__ = ['SaleShop']
|
||||||
|
|
||||||
|
|
||||||
class SaleShop:
|
class SaleShop(metaclass=PoolMeta):
|
||||||
__metaclass__ = PoolMeta
|
|
||||||
__name__ = 'sale.shop'
|
__name__ = 'sale.shop'
|
||||||
|
|
||||||
special_price = fields.Boolean('Apply Special Price')
|
special_price = fields.Boolean('Apply Special Price')
|
||||||
type_special_price = fields.Selection([
|
type_special_price = fields.Selection([
|
||||||
('price', 'Special Price'),
|
('price', 'Special Price'),
|
||||||
|
|
Loading…
Reference in New Issue