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']
|
||||
|
||||
|
||||
class Sale:
|
||||
__metaclass__ = PoolMeta
|
||||
class Sale(metaclass=PoolMeta):
|
||||
__name__ = 'sale.sale'
|
||||
|
||||
@classmethod
|
||||
|
|
4
setup.py
4
setup.py
|
@ -4,7 +4,7 @@
|
|||
from setuptools import setup
|
||||
import re
|
||||
import os
|
||||
import ConfigParser
|
||||
import configparser
|
||||
|
||||
MODULE = 'sale_processing2confirmed'
|
||||
PREFIX = 'nantic'
|
||||
|
@ -24,7 +24,7 @@ def get_require_version(name):
|
|||
major_version, minor_version + 1)
|
||||
return require
|
||||
|
||||
config = ConfigParser.ConfigParser()
|
||||
config = configparser.ConfigParser()
|
||||
config.readfp(open('tryton.cfg'))
|
||||
info = dict(config.items('tryton'))
|
||||
for key in ('depends', 'extras_depend', 'xml'):
|
||||
|
|
|
@ -204,7 +204,7 @@ Create an Inventory::
|
|||
>>> inventory_line.expected_quantity = 0.0
|
||||
>>> inventory.click('confirm')
|
||||
>>> inventory.state
|
||||
u'done'
|
||||
'done'
|
||||
|
||||
Create a sale::
|
||||
|
||||
|
@ -246,17 +246,17 @@ Process sale::
|
|||
|
||||
>>> sale.click('process')
|
||||
>>> sale.state
|
||||
u'processing'
|
||||
'processing'
|
||||
>>> len(sale.shipments), len(sale.shipment_returns), len(sale.invoices)
|
||||
(1, 0, 1)
|
||||
|
||||
Go back to confirmed on original sale::
|
||||
|
||||
>>> sale.state
|
||||
u'processing'
|
||||
'processing'
|
||||
>>> sale.click('draft')
|
||||
>>> sale.state
|
||||
u'draft'
|
||||
'draft'
|
||||
>>> len(sale.shipments), len(sale.shipment_returns), len(sale.invoices)
|
||||
(0, 0, 0)
|
||||
|
||||
|
@ -264,7 +264,7 @@ Process posted invoice sales::
|
|||
|
||||
>>> posted_invoice_sale.click('quote')
|
||||
>>> posted_invoice_sale.click('confirm')
|
||||
>>> posted_invoice_sale.click('process')
|
||||
>>> posted_invoice_sale.click('process')
|
||||
>>> invoices = [invoice for invoice in posted_invoice_sale.invoices]
|
||||
|
||||
Post invoice::
|
||||
|
@ -282,7 +282,7 @@ Draft invoice sale::
|
|||
... except UserError:
|
||||
... pass
|
||||
>>> posted_invoice_sale.state
|
||||
u'processing'
|
||||
'processing'
|
||||
|
||||
Validate Shipments::
|
||||
|
||||
|
@ -305,4 +305,4 @@ Draft shipment sale::
|
|||
... except:
|
||||
... pass
|
||||
>>> posted_shipment_sale.state
|
||||
u'processing'
|
||||
'processing'
|
||||
|
|
Loading…
Reference in a new issue