Update to tryton 4.8
This commit is contained in:
parent
d9a8e6ad54
commit
36151a39f0
16
__init__.py
16
__init__.py
|
@ -1,18 +1,18 @@
|
|||
# The COPYRIGHT file at the top level of this repository contains the full
|
||||
# copyright notices and license terms.
|
||||
from trytond.pool import Pool
|
||||
from .product import *
|
||||
from .sale import *
|
||||
from . import product
|
||||
from . import sale
|
||||
|
||||
|
||||
def register():
|
||||
Pool.register(
|
||||
Template,
|
||||
Sale,
|
||||
SaleLine,
|
||||
SetQuantitiesStart,
|
||||
SetQuantitiesStartLine,
|
||||
product.Template,
|
||||
sale.Sale,
|
||||
sale.SaleLine,
|
||||
sale.SetQuantitiesStart,
|
||||
sale.SetQuantitiesStartLine,
|
||||
module='sale_pos_template_quantities', type_='model')
|
||||
Pool.register(
|
||||
SetQuantities,
|
||||
sale.SetQuantities,
|
||||
module='sale_pos_template_quantities', type_='wizard')
|
||||
|
|
2
sale.py
2
sale.py
|
@ -100,7 +100,7 @@ class SaleLine:
|
|||
},
|
||||
})
|
||||
|
||||
@fields.depends('template', 'quantity', 'unit', 'description',
|
||||
@fields.depends('template', 'quantity', 'unit', 'description', 'sale',
|
||||
'_parent_sale.party')
|
||||
def on_change_template(self):
|
||||
Template = Pool().get('product.template')
|
||||
|
|
6
sale.xml
6
sale.xml
|
@ -26,6 +26,12 @@
|
|||
<field name="name">sale_line_form</field>
|
||||
</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">
|
||||
<field name="name">Set Quantities</field>
|
||||
<field name="wiz_name">sale_pos.set_quantities</field>
|
||||
|
|
|
@ -8,7 +8,8 @@ Imports::
|
|||
>>> from dateutil.relativedelta import relativedelta
|
||||
>>> from decimal import Decimal
|
||||
>>> 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, \
|
||||
... get_company
|
||||
>>> from trytond.modules.account.tests.tools import create_fiscalyear, \
|
||||
|
@ -18,17 +19,9 @@ Imports::
|
|||
>>> from trytond.modules.product_variant.tests.tools import create_attributes
|
||||
>>> today = datetime.date.today()
|
||||
|
||||
Create database::
|
||||
Install account_invoice::
|
||||
|
||||
>>> config = config.set_trytond()
|
||||
>>> 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')
|
||||
>>> config = activate_modules('sale_pos_template_quantities')
|
||||
|
||||
Create company::
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[tryton]
|
||||
version=4.1.0
|
||||
version=4.8.0
|
||||
depends:
|
||||
product_variant
|
||||
sale_pos
|
||||
|
|
|
@ -7,6 +7,6 @@
|
|||
<field name="template"/>
|
||||
</xpath>
|
||||
<xpath expr="/tree/field[@name='unit']" position="after">
|
||||
<button name="set_quantities_wizard" string="Set Quantities"/>
|
||||
<button name="set_quantities_wizard"/>
|
||||
</xpath>
|
||||
</data>
|
||||
|
|
|
@ -7,6 +7,6 @@
|
|||
<field name="template"/>
|
||||
</xpath>
|
||||
<xpath expr="/tree/field[@name='unit']" position="after">
|
||||
<button name="set_quantities_wizard" string="Set Quantities"/>
|
||||
<button name="set_quantities_wizard"/>
|
||||
</xpath>
|
||||
</data>
|
||||
|
|
|
@ -7,6 +7,6 @@
|
|||
<field name="template"/>
|
||||
</xpath>
|
||||
<xpath expr="/tree/field[@name='unit']" position="after">
|
||||
<button name="set_quantities_wizard" string="Set Quantities"/>
|
||||
<button name="set_quantities_wizard"/>
|
||||
</xpath>
|
||||
</data>
|
||||
|
|
|
@ -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="Set Quantities">
|
||||
<form>
|
||||
<field name="template_line" invisible="1"/>
|
||||
<field name="n_lines" invisible="1"/>
|
||||
<label name="total_quantity"/>
|
||||
|
|
|
@ -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="Set Quantities">
|
||||
<form>
|
||||
<field name="attribute_value_x"/>
|
||||
<field name="total"/>
|
||||
<field name="unit_digits" invisible="1"/>
|
||||
|
|
|
@ -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. -->
|
||||
<tree string="Set Quantities" editable="bottom">
|
||||
<tree editable="bottom">
|
||||
<field name="attribute_value_x"/>
|
||||
<field name="total"/>
|
||||
<field name="unit_digits" tree_invisible="1"/>
|
||||
|
|
Loading…
Reference in New Issue