mirror of
https://github.com/NaN-tic/trytond-sale_processing2confirmed.git
synced 2023-12-14 03:32:57 +01:00
Migrate to python 3
This commit is contained in:
parent
22c3f402bf
commit
d2c1581444
3
sale.py
3
sale.py
|
@ -8,8 +8,7 @@ from trytond.transaction import Transaction
|
||||||
__all__ = ['Sale']
|
__all__ = ['Sale']
|
||||||
|
|
||||||
|
|
||||||
class Sale:
|
class Sale(metaclass=PoolMeta):
|
||||||
__metaclass__ = PoolMeta
|
|
||||||
__name__ = 'sale.sale'
|
__name__ = 'sale.sale'
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|
4
setup.py
4
setup.py
|
@ -4,7 +4,7 @@
|
||||||
from setuptools import setup
|
from setuptools import setup
|
||||||
import re
|
import re
|
||||||
import os
|
import os
|
||||||
import ConfigParser
|
import configparser
|
||||||
|
|
||||||
MODULE = 'sale_processing2confirmed'
|
MODULE = 'sale_processing2confirmed'
|
||||||
PREFIX = 'nantic'
|
PREFIX = 'nantic'
|
||||||
|
@ -24,7 +24,7 @@ def get_require_version(name):
|
||||||
major_version, minor_version + 1)
|
major_version, minor_version + 1)
|
||||||
return require
|
return require
|
||||||
|
|
||||||
config = ConfigParser.ConfigParser()
|
config = configparser.ConfigParser()
|
||||||
config.readfp(open('tryton.cfg'))
|
config.readfp(open('tryton.cfg'))
|
||||||
info = dict(config.items('tryton'))
|
info = dict(config.items('tryton'))
|
||||||
for key in ('depends', 'extras_depend', 'xml'):
|
for key in ('depends', 'extras_depend', 'xml'):
|
||||||
|
|
|
@ -204,7 +204,7 @@ Create an Inventory::
|
||||||
>>> inventory_line.expected_quantity = 0.0
|
>>> inventory_line.expected_quantity = 0.0
|
||||||
>>> inventory.click('confirm')
|
>>> inventory.click('confirm')
|
||||||
>>> inventory.state
|
>>> inventory.state
|
||||||
u'done'
|
'done'
|
||||||
|
|
||||||
Create a sale::
|
Create a sale::
|
||||||
|
|
||||||
|
@ -246,17 +246,17 @@ Process sale::
|
||||||
|
|
||||||
>>> sale.click('process')
|
>>> sale.click('process')
|
||||||
>>> sale.state
|
>>> sale.state
|
||||||
u'processing'
|
'processing'
|
||||||
>>> len(sale.shipments), len(sale.shipment_returns), len(sale.invoices)
|
>>> len(sale.shipments), len(sale.shipment_returns), len(sale.invoices)
|
||||||
(1, 0, 1)
|
(1, 0, 1)
|
||||||
|
|
||||||
Go back to confirmed on original sale::
|
Go back to confirmed on original sale::
|
||||||
|
|
||||||
>>> sale.state
|
>>> sale.state
|
||||||
u'processing'
|
'processing'
|
||||||
>>> sale.click('draft')
|
>>> sale.click('draft')
|
||||||
>>> sale.state
|
>>> sale.state
|
||||||
u'draft'
|
'draft'
|
||||||
>>> len(sale.shipments), len(sale.shipment_returns), len(sale.invoices)
|
>>> len(sale.shipments), len(sale.shipment_returns), len(sale.invoices)
|
||||||
(0, 0, 0)
|
(0, 0, 0)
|
||||||
|
|
||||||
|
@ -264,7 +264,7 @@ Process posted invoice sales::
|
||||||
|
|
||||||
>>> posted_invoice_sale.click('quote')
|
>>> posted_invoice_sale.click('quote')
|
||||||
>>> posted_invoice_sale.click('confirm')
|
>>> posted_invoice_sale.click('confirm')
|
||||||
>>> posted_invoice_sale.click('process')
|
>>> posted_invoice_sale.click('process')
|
||||||
>>> invoices = [invoice for invoice in posted_invoice_sale.invoices]
|
>>> invoices = [invoice for invoice in posted_invoice_sale.invoices]
|
||||||
|
|
||||||
Post invoice::
|
Post invoice::
|
||||||
|
@ -282,7 +282,7 @@ Draft invoice sale::
|
||||||
... except UserError:
|
... except UserError:
|
||||||
... pass
|
... pass
|
||||||
>>> posted_invoice_sale.state
|
>>> posted_invoice_sale.state
|
||||||
u'processing'
|
'processing'
|
||||||
|
|
||||||
Validate Shipments::
|
Validate Shipments::
|
||||||
|
|
||||||
|
@ -305,4 +305,4 @@ Draft shipment sale::
|
||||||
... except:
|
... except:
|
||||||
... pass
|
... pass
|
||||||
>>> posted_shipment_sale.state
|
>>> posted_shipment_sale.state
|
||||||
u'processing'
|
'processing'
|
||||||
|
|
Loading…
Reference in a new issue