update to 4.7

This commit is contained in:
?ngel ?lvarez 2018-09-27 15:05:00 +02:00
parent d77da8fce8
commit c38f8dd543
5 changed files with 12 additions and 27 deletions

View file

@ -1,10 +1,10 @@
# The COPYRIGHT file at the top level of this repository contains the full
# copyright notices and license terms.
from trytond.pool import Pool
from .inventory import *
from . import inventory
def register():
Pool.register(
InventoryLine,
inventory.InventoryLine,
module='stock_inventory_expected_quantity', type_='model')

View file

@ -5,11 +5,11 @@ from trytond.pool import Pool, PoolMeta
from trytond.transaction import Transaction
__all__ = ['InventoryLine']
__metaclass__ = PoolMeta
class InventoryLine:
__name__ = 'stock.inventory.line'
__metaclass__ = PoolMeta
@staticmethod
def _compute_expected_quantity(inventory, product, lot=None):
@ -33,8 +33,8 @@ class InventoryLine:
inactive_lots=True):
if Lot and lot:
pbl = Product.products_by_location(
[inventory.location.id], product_ids=[product],
grouping=('product', 'lot'))
[inventory.location.id], grouping_filter=[[product],
[lot]], grouping=('product', 'lot'))
return pbl[(inventory.location.id, product, lot)]
pbl = Product.products_by_location(
[inventory.location.id], grouping=('product',))

View file

@ -12,24 +12,17 @@ Imports::
>>> from dateutil.relativedelta import relativedelta
>>> from decimal import Decimal
>>> from proteus import config, Model, Wizard
>>> from trytond.tests.tools import activate_modules
>>> from trytond.modules.company.tests.tools import create_company, \
... get_company
>>> today = datetime.date.today()
Create database::
>>> config = config.set_trytond()
>>> config.pool.test = True
Install stock_inventory_expected_quantity Module::
>>> Module = Model.get('ir.module')
>>> module, = Module.find([
... ('name', '=', 'stock_inventory_expected_quantity')])
>>> module.click('install')
>>> module, = Module.find([('name', '=', 'stock_lot')])
>>> module.click('install')
>>> Wizard('ir.module.install_upgrade').execute('upgrade')
>>> config = activate_modules(['stock_inventory_expected_quantity',
... 'stock_lot'])
Create company::

View file

@ -12,22 +12,14 @@ Imports::
>>> from dateutil.relativedelta import relativedelta
>>> from decimal import Decimal
>>> from proteus import config, Model, Wizard
>>> from trytond.tests.tools import activate_modules
>>> from trytond.modules.company.tests.tools import create_company, \
... get_company
>>> today = datetime.date.today()
Create database::
>>> config = config.set_trytond()
>>> config.pool.test = True
Install stock_inventory_expected_quantity Module::
>>> Module = Model.get('ir.module')
>>> module, = Module.find([
... ('name', '=', 'stock_inventory_expected_quantity')])
>>> module.click('install')
>>> Wizard('ir.module.install_upgrade').execute('upgrade')
>>> config = activate_modules('stock_inventory_expected_quantity')
Create company::

View file

@ -1,5 +1,5 @@
[tryton]
version=4.1.0
version=4.7.0
depends:
stock
extras_depend: