From ca310806bd343291c3d960828f1a7c763d2f417b Mon Sep 17 00:00:00 2001 From: Raimon Esteve Date: Fri, 26 Apr 2019 13:48:08 +0200 Subject: [PATCH] Upgrade to 5.1 --- __init__.py | 3 ++- ir.py | 14 ++++++++++++++ stock.xml | 9 +-------- tests/test_stock_lot_deactivatable.py | 2 +- tryton.cfg | 2 +- 5 files changed, 19 insertions(+), 11 deletions(-) create mode 100644 ir.py diff --git a/__init__.py b/__init__.py index 2ae25d2..8629ef5 100644 --- a/__init__.py +++ b/__init__.py @@ -1,12 +1,13 @@ # The COPYRIGHT file at the top level of this repository contains the full # copyright notices and license terms. from trytond.pool import Pool - +from . import ir from . import stock def register(): Pool.register( + ir.Cron, stock.Lot, stock.Move, stock.Period, diff --git a/ir.py b/ir.py new file mode 100644 index 0000000..950ae15 --- /dev/null +++ b/ir.py @@ -0,0 +1,14 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. +from trytond.pool import PoolMeta + + +class Cron(metaclass=PoolMeta): + __name__ = 'ir.cron' + + @classmethod + def __setup__(cls): + super().__setup__() + cls.method.selection.append( + ('stock.lot|deactivate_lots_without_stock', + "Deactivate Lots without Stock")) diff --git a/stock.xml b/stock.xml index dc65bad..2877241 100644 --- a/stock.xml +++ b/stock.xml @@ -30,16 +30,9 @@ - Deactivate Lots without Stock - - - + stock.lot|deactivate_lots_without_stock days - - - stock.lot - deactivate_lots_without_stock diff --git a/tests/test_stock_lot_deactivatable.py b/tests/test_stock_lot_deactivatable.py index c3a02d3..038228d 100644 --- a/tests/test_stock_lot_deactivatable.py +++ b/tests/test_stock_lot_deactivatable.py @@ -38,12 +38,12 @@ class StockLotDeactivatableTestCase(ModuleTestCase): 'name': 'Test Move.internal_quantity', 'type': 'goods', 'list_price': Decimal(1), - 'cost_price': Decimal(0), 'cost_price_method': 'fixed', 'default_uom': unit.id, }]) product, = Product.create([{ 'template': template.id, + 'cost_price': Decimal(0), }]) supplier, = Location.search([('code', '=', 'SUP')]) storage, = Location.search([('code', '=', 'STO')]) diff --git a/tryton.cfg b/tryton.cfg index 58b6ec8..c6820c0 100644 --- a/tryton.cfg +++ b/tryton.cfg @@ -1,5 +1,5 @@ [tryton] -version=4.9.0 +version=5.1.0 depends: stock_lot xml: