mirror of
https://github.com/NaN-tic/trytond-stock_lot_jreport.git
synced 2023-12-14 03:53:01 +01:00
Upgrade to tryton 4.8
This commit is contained in:
parent
0157ebbe1a
commit
5874a7bb10
5
stock.py
5
stock.py
|
@ -5,10 +5,8 @@ from trytond.model import fields
|
|||
from trytond.modules.jasper_reports.jasper import JasperReport
|
||||
from trytond.pool import Pool, PoolMeta
|
||||
from trytond.transaction import Transaction
|
||||
|
||||
from dateutil.relativedelta import relativedelta
|
||||
|
||||
|
||||
__all__ = ['Lot', 'LotReport']
|
||||
|
||||
|
||||
|
@ -29,7 +27,6 @@ class Lot:
|
|||
|
||||
configuration = pool.get('stock.configuration')(1)
|
||||
|
||||
products = list(set(l.product for l in lots))
|
||||
location_ids = (configuration.warehouse and
|
||||
[configuration.warehouse.id] or [])
|
||||
|
||||
|
@ -40,7 +37,7 @@ class Lot:
|
|||
lag_days = configuration.lag_days or 0
|
||||
stock_date_end = Date.today() + relativedelta(days=int(lag_days))
|
||||
with Transaction().set_context({'stock_date_end': stock_date_end}):
|
||||
quantities = cls._get_quantity(lots, name, location_ids, products,
|
||||
quantities = cls._get_quantity(lots, name, location_ids,
|
||||
grouping=('product', 'lot'))
|
||||
return quantities
|
||||
|
||||
|
|
|
@ -36,9 +36,10 @@ class TestCase(ModuleTestCase):
|
|||
supplier, = Location.search([('code', '=', 'SUP')])
|
||||
customer, = Location.search([('code', '=', 'CUS')])
|
||||
storage, = Location.search([('code', '=', 'STO')])
|
||||
warehouse, = Location.search([('code', '=', 'WH')])
|
||||
|
||||
StockConfiguration.create([{
|
||||
'warehouse': storage.id,
|
||||
'warehouse': warehouse.id,
|
||||
'lag_days': 1,
|
||||
}])
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[tryton]
|
||||
version=4.1.0
|
||||
version=4.8.0
|
||||
depends:
|
||||
product_template_form_quantity
|
||||
stock_lot
|
||||
|
|
Loading…
Reference in a new issue