Migration to 4.2

This commit is contained in:
Sergio Morillo 2017-07-28 18:55:49 +02:00
parent 69b522cd94
commit c4cdd83499
29 changed files with 50 additions and 66 deletions

View File

@ -1,2 +1,3 @@
Version 4.2.0 - 2017-07-27
Version 4.0.3 - 2016-08-19
* Initial release

View File

@ -3,9 +3,9 @@
from trytond.pool import Pool
from .configuration import Configuration
from .unit_load import (UnitLoad, UnitLoadMove, MoveUnitLoad,
MoveUnitLoadStart, UnitLoadLabel, DropUnitLoad,
DropUnitLoadStart, DropUnitLoadFailed, DropUnitLoadFailedProduct,
BatchDropUnitLoad, BatchDropUnitLoadData, BatchDropUnitLoadConfirm)
MoveUnitLoadStart, UnitLoadLabel, DropUnitLoad,
DropUnitLoadStart, DropUnitLoadFailed, DropUnitLoadFailedProduct,
BatchDropUnitLoad, BatchDropUnitLoadData, BatchDropUnitLoadConfirm)
from .stock import (Move, UnitLoadsByLocations,
UnitLoadsByLocationsStart)
from .shipment import ShipmentOut, ShipmentInternal

View File

@ -35,9 +35,7 @@
<record model="ir.action.act_window" id="act_uls_by_locations">
<field name="name">Unit loads</field>
<field name="res_model">stock.unit_load</field>
<field name="window_name" eval="False"/>
<field name="domain" eval="[('quantity', '!=', 0.0)]" pyson="1"/>
<field name="window_name" eval="True"/>
</record>
<record model="ir.action.act_window.view" id="act_unit_load_qty_view1">
<field name="sequence" eval="10"/>

View File

@ -5,6 +5,7 @@ Batch Drop unit load
Imports::
>>> import datetime
>>> from trytond.tests.tools import activate_modules
>>> from proteus import config, Model, Wizard, Report
>>> from dateutil.relativedelta import relativedelta
>>> from decimal import Decimal
@ -22,10 +23,7 @@ Create database::
Install unit load Module::
>>> Module = Model.get('ir.module')
>>> module, = Module.find([('name', '=', 'stock_unit_load')])
>>> module.click('install')
>>> Wizard('ir.module.install_upgrade').execute('upgrade')
>>> config = activate_modules('stock_unit_load')
Create company::

View File

@ -5,6 +5,7 @@ Drop unit load
Imports::
>>> import datetime
>>> from trytond.tests.tools import activate_modules
>>> from proteus import config, Model, Wizard, Report
>>> from dateutil.relativedelta import relativedelta
>>> from decimal import Decimal
@ -22,10 +23,7 @@ Create database::
Install unit load Module::
>>> Module = Model.get('ir.module')
>>> module, = Module.find([('name', '=', 'stock_unit_load')])
>>> module.click('install')
>>> Wizard('ir.module.install_upgrade').execute('upgrade')
>>> config = activate_modules('stock_unit_load')
Create company::

View File

@ -5,6 +5,7 @@ Check unit load creation
Imports::
>>> import datetime
>>> from trytond.tests.tools import activate_modules
>>> from proteus import config, Model, Wizard, Report
>>> from dateutil.relativedelta import relativedelta
>>> from decimal import Decimal
@ -22,10 +23,7 @@ Create database::
Install unit load Module::
>>> Module = Model.get('ir.module')
>>> module, = Module.find([('name', '=', 'stock_unit_load')])
>>> module.click('install')
>>> Wizard('ir.module.install_upgrade').execute('upgrade')
>>> config = activate_modules('stock_unit_load')
Create company::

View File

@ -5,6 +5,7 @@ Check unit load creation
Imports::
>>> import datetime
>>> from trytond.tests.tools import activate_modules
>>> from proteus import config, Model, Wizard, Report
>>> from dateutil.relativedelta import relativedelta
>>> from decimal import Decimal
@ -22,10 +23,7 @@ Create database::
Install unit load Module::
>>> Module = Model.get('ir.module')
>>> module, = Module.find([('name', '=', 'stock_unit_load')])
>>> module.click('install')
>>> Wizard('ir.module.install_upgrade').execute('upgrade')
>>> config = activate_modules('stock_unit_load')
Create company::

View File

@ -11,13 +11,11 @@ class StockUnitLoadTestCase(ModuleTestCase):
"""Test Stock Unit Load module"""
module = 'stock_unit_load'
def setUp(self):
super(StockUnitLoadTestCase, self).setUp()
def suite():
suite = trytond.tests.test_tryton.suite()
suite.addTests(unittest.TestLoader().loadTestsFromTestCase(StockUnitLoadTestCase))
suite.addTests(unittest.TestLoader().loadTestsFromTestCase(
StockUnitLoadTestCase))
suite.addTests(doctest.DocFileSuite(
'scenario_stock_unit_load.rst',
setUp=doctest_setup, tearDown=doctest_teardown, encoding='utf-8',

View File

@ -1,5 +1,5 @@
[tryton]
version=4.0.3
version=4.2.0
depends:
ir
res

View File

@ -181,7 +181,7 @@ class UnitLoad(ModelView, ModelSQL):
states={'readonly': (Eval('state') != 'draft')
| (Eval('production_state') == 'done')},
depends=['uom_digits', 'production_state', 'state']),
'on_change_with_quantity_per_case', setter='set_quantity_per_case')
'get_quantity_per_case', setter='set_quantity_per_case')
cases_digits = fields.Function(fields.Integer('Cases Digits'),
'on_change_with_cases_digits')
@ -797,7 +797,7 @@ class UnitLoad(ModelView, ModelSQL):
self.quantity = self.quantity_per_case * self.cases_quantity
self.on_change_quantity()
def on_change_with_quantity_per_case(self, name=None):
def get_quantity_per_case(self, name=None):
if self.quantity and self.cases_quantity and self.uom:
return self.uom.round(self.quantity / self.cases_quantity)
return None
@ -957,7 +957,7 @@ class UnitLoad(ModelView, ModelSQL):
@fields.depends(*MOVE_CHANGES)
def on_change_quantity(self):
self.quantity_per_case = self.on_change_with_quantity_per_case()
self.quantity_per_case = self.get_quantity_per_case()
self.explode_production_moves()
@fields.depends(*MOVE_CHANGES)

View File

@ -8,4 +8,4 @@
<label name="ul_production_type"/>
<field name="ul_production_type"/>
</xpath>
</data>
</data>

View File

@ -6,4 +6,4 @@
<label name="unit_load"/>
<field name="unit_load"/>
</xpath>
</data>
</data>

View File

@ -5,4 +5,4 @@
<xpath expr="/tree" position="inside">
<field name="unit_load"/>
</xpath>
</data>
</data>

View File

@ -6,14 +6,9 @@ this repository contains the full copyright notices and license terms. -->
<label name="ul_quantity"/>
<field name="ul_quantity"/>
</xpath>
<xpath expr="/form/field[@name='moves']" position="replace">
<notebook>
<page id="uls" string="ULs">
<field name="unit_loads" colspan="4" widget="many2many"/>
</page>
<page id="moves" string="Moves">
<field name="moves" colspan="4"/>
</page>
</notebook>
<xpath expr="/form/notebook/page[@name='moves']" position="before">
<page id="uls" string="ULs">
<field name="unit_loads" colspan="4" widget="many2many"/>
</page>
</xpath>
</data>
</data>

View File

@ -7,4 +7,4 @@ this repository contains the full copyright notices and license terms. -->
<field name="unit_loads" colspan="4" widget="many2many"/>
</page>
</xpath>
</data>
</data>

View File

@ -1,9 +1,9 @@
<?xml version="1.0"?>
<!-- The COPYRIGHT file at the top level of this repository contains the full
copyright notices and license terms. -->
<form string="UL Batch dropping" col="2">
<form col="2">
<image name="tryton-dialog-warning" xexpand="0" xfill="0"/>
<separator string="Following ULs are going to be dropped. Please confirm the action."
id="confirm"/>
<field name="unit_loads" colspan="2"/>
</form>
</form>

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="UL Batch dropping">
<form>
<label name="location"/>
<field name="location"/>
<label name="delay_"/>
@ -11,4 +11,4 @@
<label name="end_date"/>
<field name="end_date"/>
<field name="unit_loads" colspan="4" widget="many2many"/>
</form>
</form>

View File

@ -1,9 +1,9 @@
<?xml version="1.0"?>
<!-- The COPYRIGHT file at the top level of this repository contains the full
copyright notices and license terms. -->
<form string="Dropping UL product data">
<form>
<label name="product"/>
<field name="product"/>
<label name="location"/>
<field name="location"/>
</form>
</form>

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. -->
<tree string="Dropping UL product data" editable="bottom">
<tree editable="bottom">
<field name="product"/>
<field name="location"/>
</tree>
</tree>

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="Unit loads by Locations">
<form>
<label name="forecast_date"/>
<field name="forecast_date"/>
</form>
</form>

View File

@ -1,9 +1,9 @@
<?xml version="1.0"?>
<!-- The COPYRIGHT file at the top level of this repository contains the full
copyright notices and license terms. -->
<form string="Dropping UL data">
<form>
<label name="location"/>
<field name="location"/>
<newline/>
<field name="products" colspan="4"/>
</form>
</form>

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="Start dropping UL">
<form>
<label name="location"/>
<field name="location"/>
<newline/>
@ -9,4 +9,4 @@
<field name="start_date"/>
<label name="end_date"/>
<field name="end_date"/>
</form>
</form>

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="Unit load" col="6" cursor="warehouse">
<form col="6" cursor="warehouse">
<label name="code"/>
<field name="code"/>
<label name="company"/>

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="UL moves">
<form>
<label name="unit_load"/>
<field name="unit_load"/>
<newline/>
@ -19,4 +19,4 @@
<field name="uom"/>
<label name="state"/>
<field name="state"/>
</form>
</form>

View File

@ -1,10 +1,10 @@
<?xml version="1.0"?>
<!-- The COPYRIGHT file at the top level of this repository contains the full
copyright notices and license terms. -->
<form string="Start moving UL">
<form>
<label name="planned_date"/>
<field name="planned_date"/>
<newline/>
<label name="location"/>
<field name="location"/>
</form>
</form>

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. -->
<tree string="Unit load moves">
<tree>
<field name="state"/>
<field name="start_date" widget="date"/>
<field name="start_date" widget="time" string="Start Time" />

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. -->
<tree string="Unit loads">
<tree>
<field name="code"/>
<field name="start_date" widget="date"/>
<field name="product"/>

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. -->
<tree string="Unit loads">
<tree>
<field name="code"/>
<field name="start_date" widget="date"/>
<field name="product"/>
@ -9,4 +9,4 @@
<field name="cases_quantity"/>
<field name="uom"/>
<field name="state"/>
</tree>
</tree>