Upgrade to Tryton 4.8

This commit is contained in:
Albert Cervera i Areny 2018-10-28 01:33:30 +02:00
parent c52b9c09cb
commit d9f7e117c9
5 changed files with 13 additions and 28 deletions

View File

@ -5,12 +5,12 @@ from trytond.pool import Pool, PoolMeta
from trytond.pyson import Eval
__all__ = ['SaleInvoiceGroup', 'Sale', 'SaleLine']
__metaclass__ = PoolMeta
class SaleInvoiceGroup(ModelSQL, ModelView):
'Sale Invoice Group'
__name__ = 'sale.invoice.group'
__metaclass__ = PoolMeta
code = fields.Char('Code', required=True, readonly=True)
name = fields.Char('Name')
@ -46,6 +46,7 @@ class SaleInvoiceGroup(ModelSQL, ModelView):
class Sale:
__name__ = 'sale.sale'
__metaclass__ = PoolMeta
def get_completed_groups(self):
'Returns a list of completed groups'
@ -72,6 +73,7 @@ class Sale:
class SaleLine:
__name__ = 'sale.line'
__metaclass__ = PoolMeta
invoice_group = fields.Many2One('sale.invoice.group', 'Invoice Grouping',
ondelete='RESTRICT', depends=['type'], states={

View File

@ -9,26 +9,18 @@ Imports::
>>> from decimal import Decimal
>>> from operator import attrgetter
>>> from proteus import config, Model, Wizard
>>> from trytond.tests.tools import activate_modules
>>> from trytond.modules.company.tests.tools import create_company, \
... get_company
>>> from trytond.modules.account.tests.tools import create_fiscalyear, \
... create_chart, get_accounts, create_tax, set_tax_code
... create_chart, get_accounts, create_tax
>>> from trytond.modules.account_invoice.tests.tools import \
... set_fiscalyear_invoice_sequences, create_payment_term
>>> today = datetime.date.today()
Create database::
Activate sale_invoice_complete_line_grouping::
>>> config = config.set_trytond()
>>> config.pool.test = True
Install sale::
>>> Module = Model.get('ir.module')
>>> sale_module, = Module.find([
... ('name', '=', 'sale_invoice_complete_line_grouping')])
>>> Module.install([sale_module.id], config.context)
>>> Wizard('ir.module.install_upgrade').execute('upgrade')
>>> config = activate_modules('sale_invoice_complete_line_grouping')
Create company::
@ -119,7 +111,6 @@ Create product::
>>> unit, = ProductUom.find([('name', '=', 'Unit')])
>>> ProductTemplate = Model.get('product.template')
>>> Product = Model.get('product.product')
>>> product = Product()
>>> template = ProductTemplate()
>>> template.name = 'product'
>>> template.default_uom = unit
@ -127,14 +118,11 @@ Create product::
>>> template.purchasable = True
>>> template.salable = True
>>> template.list_price = Decimal('10')
>>> template.cost_price = Decimal('5')
>>> template.cost_price_method = 'fixed'
>>> template.account_expense = expense
>>> template.account_revenue = revenue
>>> template.save()
>>> product.template = template
>>> product.save()
>>> product2 = Product()
>>> product, = template.products
>>> template2 = ProductTemplate()
>>> template2.name = 'product2'
>>> template2.default_uom = unit
@ -142,14 +130,11 @@ Create product::
>>> template2.purchasable = True
>>> template2.salable = True
>>> template2.list_price = Decimal('10')
>>> template2.cost_price = Decimal('5')
>>> template2.cost_price_method = 'fixed'
>>> template2.account_expense = expense
>>> template2.account_revenue = revenue
>>> template2.save()
>>> product2.template = template2
>>> product2.save()
>>> product3 = Product()
>>> product2, = template2.products
>>> template3 = ProductTemplate()
>>> template3.name = 'product3'
>>> template3.default_uom = unit
@ -157,13 +142,11 @@ Create product::
>>> template3.purchasable = True
>>> template3.salable = True
>>> template3.list_price = Decimal('10')
>>> template3.cost_price = Decimal('5')
>>> template3.cost_price_method = 'fixed'
>>> template3.account_expense = expense
>>> template3.account_revenue = revenue
>>> template3.save()
>>> product3.template = template3
>>> product3.save()
>>> product3, = template3.products
Create payment term::

View File

@ -1,5 +1,5 @@
[tryton]
version=4.1.0
version=4.8.0
depends:
sale_invoice_complete
xml:

View File

@ -1,7 +1,7 @@
<?xml version="1.0"?>
<!-- The COPYRIGHT file at the top level of this repository contains the full
copyright notices and license terms. -->
<form string="Sale Invoice Group">
<form>
<label name="code"/>
<field name="code"/>
<label name="name"/>

View File

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<!-- The COPYRIGHT file at the top level of this repository contains the full
copyright notices and license terms. -->
<tree string="Sale Invoice Group">
<tree>
<field name="rec_name"/>
</tree>