Update to tryton 4.8

This commit is contained in:
Albert Cervera i Areny 2018-09-03 09:53:19 +02:00
parent d9a8e6ad54
commit 36151a39f0
11 changed files with 26 additions and 27 deletions

View File

@ -1,18 +1,18 @@
# The COPYRIGHT file at the top level of this repository contains the full # The COPYRIGHT file at the top level of this repository contains the full
# copyright notices and license terms. # copyright notices and license terms.
from trytond.pool import Pool from trytond.pool import Pool
from .product import * from . import product
from .sale import * from . import sale
def register(): def register():
Pool.register( Pool.register(
Template, product.Template,
Sale, sale.Sale,
SaleLine, sale.SaleLine,
SetQuantitiesStart, sale.SetQuantitiesStart,
SetQuantitiesStartLine, sale.SetQuantitiesStartLine,
module='sale_pos_template_quantities', type_='model') module='sale_pos_template_quantities', type_='model')
Pool.register( Pool.register(
SetQuantities, sale.SetQuantities,
module='sale_pos_template_quantities', type_='wizard') module='sale_pos_template_quantities', type_='wizard')

View File

@ -100,7 +100,7 @@ class SaleLine:
}, },
}) })
@fields.depends('template', 'quantity', 'unit', 'description', @fields.depends('template', 'quantity', 'unit', 'description', 'sale',
'_parent_sale.party') '_parent_sale.party')
def on_change_template(self): def on_change_template(self):
Template = Pool().get('product.template') Template = Pool().get('product.template')

View File

@ -26,6 +26,12 @@
<field name="name">sale_line_form</field> <field name="name">sale_line_form</field>
</record> </record>
<record model="ir.model.button" id="sale_line_set_quantities_wizard_button">
<field name="name">set_quantities_wizard</field>
<field name="string">Set Quantities</field>
<field name="model" search="[('model', '=', 'sale.line')]"/>
</record>
<record model="ir.action.wizard" id="wizard_set_quantities"> <record model="ir.action.wizard" id="wizard_set_quantities">
<field name="name">Set Quantities</field> <field name="name">Set Quantities</field>
<field name="wiz_name">sale_pos.set_quantities</field> <field name="wiz_name">sale_pos.set_quantities</field>

View File

@ -8,7 +8,8 @@ Imports::
>>> from dateutil.relativedelta import relativedelta >>> from dateutil.relativedelta import relativedelta
>>> from decimal import Decimal >>> from decimal import Decimal
>>> from operator import attrgetter >>> from operator import attrgetter
>>> from proteus import config, Model, Wizard, Report >>> from proteus import config, Model, Wizard
>>> from trytond.tests.tools import activate_modules
>>> from trytond.modules.company.tests.tools import create_company, \ >>> from trytond.modules.company.tests.tools import create_company, \
... get_company ... get_company
>>> from trytond.modules.account.tests.tools import create_fiscalyear, \ >>> from trytond.modules.account.tests.tools import create_fiscalyear, \
@ -18,17 +19,9 @@ Imports::
>>> from trytond.modules.product_variant.tests.tools import create_attributes >>> from trytond.modules.product_variant.tests.tools import create_attributes
>>> today = datetime.date.today() >>> today = datetime.date.today()
Create database:: Install account_invoice::
>>> config = config.set_trytond() >>> config = activate_modules('sale_pos_template_quantities')
>>> config.pool.test = True
Install sale::
>>> Module = Model.get('ir.module')
>>> sale_module, = Module.find([('name', '=', 'sale_pos_template_quantities')])
>>> sale_module.click('install')
>>> Wizard('ir.module.install_upgrade').execute('upgrade')
Create company:: Create company::

View File

@ -1,5 +1,5 @@
[tryton] [tryton]
version=4.1.0 version=4.8.0
depends: depends:
product_variant product_variant
sale_pos sale_pos

View File

@ -7,6 +7,6 @@
<field name="template"/> <field name="template"/>
</xpath> </xpath>
<xpath expr="/tree/field[@name='unit']" position="after"> <xpath expr="/tree/field[@name='unit']" position="after">
<button name="set_quantities_wizard" string="Set Quantities"/> <button name="set_quantities_wizard"/>
</xpath> </xpath>
</data> </data>

View File

@ -7,6 +7,6 @@
<field name="template"/> <field name="template"/>
</xpath> </xpath>
<xpath expr="/tree/field[@name='unit']" position="after"> <xpath expr="/tree/field[@name='unit']" position="after">
<button name="set_quantities_wizard" string="Set Quantities"/> <button name="set_quantities_wizard"/>
</xpath> </xpath>
</data> </data>

View File

@ -7,6 +7,6 @@
<field name="template"/> <field name="template"/>
</xpath> </xpath>
<xpath expr="/tree/field[@name='unit']" position="after"> <xpath expr="/tree/field[@name='unit']" position="after">
<button name="set_quantities_wizard" string="Set Quantities"/> <button name="set_quantities_wizard"/>
</xpath> </xpath>
</data> </data>

View File

@ -1,7 +1,7 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<!-- The COPYRIGHT file at the top level of this repository contains the full <!-- The COPYRIGHT file at the top level of this repository contains the full
copyright notices and license terms. --> copyright notices and license terms. -->
<form string="Set Quantities"> <form>
<field name="template_line" invisible="1"/> <field name="template_line" invisible="1"/>
<field name="n_lines" invisible="1"/> <field name="n_lines" invisible="1"/>
<label name="total_quantity"/> <label name="total_quantity"/>

View File

@ -1,7 +1,7 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<!-- The COPYRIGHT file at the top level of this repository contains the full <!-- The COPYRIGHT file at the top level of this repository contains the full
copyright notices and license terms. --> copyright notices and license terms. -->
<form string="Set Quantities"> <form>
<field name="attribute_value_x"/> <field name="attribute_value_x"/>
<field name="total"/> <field name="total"/>
<field name="unit_digits" invisible="1"/> <field name="unit_digits" invisible="1"/>

View File

@ -1,7 +1,7 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<!-- The COPYRIGHT file at the top level of this repository contains the full <!-- The COPYRIGHT file at the top level of this repository contains the full
copyright notices and license terms. --> copyright notices and license terms. -->
<tree string="Set Quantities" editable="bottom"> <tree editable="bottom">
<field name="attribute_value_x"/> <field name="attribute_value_x"/>
<field name="total"/> <field name="total"/>
<field name="unit_digits" tree_invisible="1"/> <field name="unit_digits" tree_invisible="1"/>