mirror of
https://github.com/NaN-tic/trytond-sale_customer_product.git
synced 2023-12-14 02:33:06 +01:00
Migrate to python 3.
This commit is contained in:
parent
c34a789be8
commit
846074ca4f
4 changed files with 8 additions and 14 deletions
|
@ -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')
|
||||
|
|
3
sale.py
3
sale.py
|
@ -9,8 +9,7 @@ from trytond.transaction import Transaction
|
|||
__all__ = ['SaleLine']
|
||||
|
||||
|
||||
class SaleLine:
|
||||
__metaclass__ = PoolMeta
|
||||
class SaleLine(metaclass=PoolMeta):
|
||||
__name__ = 'sale.line'
|
||||
|
||||
@classmethod
|
||||
|
|
5
setup.py
5
setup.py
|
@ -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'
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue