minor fix

This commit is contained in:
wilsongomez 2022-04-18 13:15:11 -05:00
parent bc9d61f5dd
commit d56d62379a
2 changed files with 11 additions and 1 deletions

View File

@ -553,6 +553,7 @@ class WarehouseStockDetailedStart(ModelView):
], depends=['location_storage'])
location_storage = fields.One2Many('stock.location', None, 'Locations Storage')
to_date = fields.Date('To Date', required=True)
lot = fields.Boolean('Grouping Lot')
@staticmethod
def default_company():
@ -589,6 +590,7 @@ class WarehouseStockDetailed(Wizard):
'company': self.start.company.id,
'locations': location_ids,
'to_date': self.start.to_date,
'lot': self.start.lot,
}
return action, data
@ -604,6 +606,7 @@ class WarehouseStockDetailedReport(Report):
Company = pool.get('company.company')
Product = pool.get('product.product')
Location = pool.get('stock.location')
LotbyLocation = pool.get('stock.lots_by_locations')
if data['locations']:
ids_location = data['locations']
locations = Location.browse(ids_location)
@ -644,11 +647,16 @@ class WarehouseStockDetailedReport(Report):
stock_context['locations'] = [l.id]
with Transaction().set_context(stock_context):
prdts = Product.search(dom_products, order=[('code', 'ASC')])
if data['lot']:
prd_ids = [p.id for p in prdts]
print(prd_ids, 'ids')
prdts = LotbyLocation.search([('product' , 'in', prd_ids)])
for p in prdts:
add_({
'parent_name': l.parent.name if l.parent else '',
'name': l.name,
'product': p,
'product': p.product if data['lot'] else p,
'lot': p if data['lot'] else None,
})
products = values

View File

@ -6,5 +6,7 @@ this repository contains the full copyright notices and license terms. -->
<field name="company"/>
<label name="to_date"/>
<field name="to_date"/>
<label name="lot"/>
<field name="lot"/>
<field name="locations" colspan="4"/>
</form>