fix report shipment detailed add analytic account

This commit is contained in:
wilsongomez 2022-09-10 10:09:53 -05:00
parent 98e84b8f31
commit 6cfed8e4bb
2 changed files with 10 additions and 1 deletions

View File

@ -497,10 +497,13 @@ class ShipmentDetailedReport(Report):
'quantity', 'to_location.name', 'from_location.name', 'shipment.reference',
'effective_date', 'shipment.number'
]
fields = ModelShipment.fields_get(fields_names=['operation_center', 'customer', 'supplier', 'incoming_moves'])
fields = ModelShipment.fields_get(fields_names=['operation_center', 'customer', 'supplier', 'incoming_moves', 'analytic_account'])
if 'operation_center' in fields.keys():
fields_names.append('shipment.operation_center.rec_name')
if 'analytic_account' in fields.keys():
fields_names.append('shipment.analytic_account.rec_name')
if type_shipment_ == 'in':
fields_names.append('shipment.supplier.name')
elif type_shipment_ == 'out':
@ -522,6 +525,11 @@ class ShipmentDetailedReport(Report):
except:
oc = ''
try:
analytic = m['shipment.']['analytic_account.']['rec_name']
except:
analytic = ''
if type_shipment_ == 'in':
party = m['shipment.']['supplier.']['name']
elif type_shipment_ == 'out':
@ -540,6 +548,7 @@ class ShipmentDetailedReport(Report):
value = {
'party': party,
'oc': oc,
'analytic': analytic,
'product': product['name'],
'code': product['code'],
'cost_price': cost_price,

Binary file not shown.