Migrate to python 3.

This commit is contained in:
Albert Cervera i Areny 2018-08-18 10:15:30 +02:00
parent c34a789be8
commit 846074ca4f
4 changed files with 8 additions and 14 deletions

View file

@ -9,8 +9,7 @@ from trytond.transaction import Transaction
__all__ = ['Template', 'Product', 'ProductCustomer']
class Template:
__metaclass__ = PoolMeta
class Template(metaclass=PoolMeta):
__name__ = "product.template"
product_customers = fields.One2Many('sale.product_customer',
'product', 'Customers',
@ -69,8 +68,7 @@ class Template:
return res
class Product:
__metaclass__ = PoolMeta
class Product(metaclass=PoolMeta):
__name__ = 'product.product'
customer_code = fields.Function(fields.Char('Customer Code'),
'get_customer_fields', searcher='search_customer_field')

View file

@ -9,8 +9,7 @@ from trytond.transaction import Transaction
__all__ = ['SaleLine']
class SaleLine:
__metaclass__ = PoolMeta
class SaleLine(metaclass=PoolMeta):
__name__ = 'sale.line'
@classmethod

View file

@ -5,10 +5,7 @@ from setuptools import setup
import re
import os
import io
try:
from configparser import ConfigParser
except ImportError:
from ConfigParser import ConfigParser
from configparser import ConfigParser
MODULE = 'sale_customer_product'
PREFIX = 'nantic'

View file

@ -150,7 +150,7 @@ Create an Inventory::
>>> inventory_line.save()
>>> Inventory.confirm([inventory.id], config.context)
>>> inventory.state
u'done'
'done'
Sale 5 products::
@ -178,10 +178,10 @@ Sale 5 products::
>>> Sale.confirm([sale.id], config.context)
>>> Sale.process([sale.id], config.context)
>>> sale.state
u'processing'
'processing'
>>> sale.reload()
>>> sale_line.description
u'[1111] Customer 1 Product'
'[1111] Customer 1 Product'
Sale 5 products::
@ -209,5 +209,5 @@ Sale 5 products::
>>> Sale.confirm([sale.id], config.context)
>>> Sale.process([sale.id], config.context)
>>> sale.state
u'processing'
'processing'
>>> sale.reload()