mirror of
https://bitbucket.org/presik/trytonpsk-stock_co.git
synced 2023-12-14 05:43:05 +01:00
fix report shipment detailed add analytic account
This commit is contained in:
parent
98e84b8f31
commit
6cfed8e4bb
2 changed files with 10 additions and 1 deletions
11
shipment.py
11
shipment.py
|
@ -497,10 +497,13 @@ class ShipmentDetailedReport(Report):
|
||||||
'quantity', 'to_location.name', 'from_location.name', 'shipment.reference',
|
'quantity', 'to_location.name', 'from_location.name', 'shipment.reference',
|
||||||
'effective_date', 'shipment.number'
|
'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():
|
if 'operation_center' in fields.keys():
|
||||||
fields_names.append('shipment.operation_center.rec_name')
|
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':
|
if type_shipment_ == 'in':
|
||||||
fields_names.append('shipment.supplier.name')
|
fields_names.append('shipment.supplier.name')
|
||||||
elif type_shipment_ == 'out':
|
elif type_shipment_ == 'out':
|
||||||
|
@ -522,6 +525,11 @@ class ShipmentDetailedReport(Report):
|
||||||
except:
|
except:
|
||||||
oc = ''
|
oc = ''
|
||||||
|
|
||||||
|
try:
|
||||||
|
analytic = m['shipment.']['analytic_account.']['rec_name']
|
||||||
|
except:
|
||||||
|
analytic = ''
|
||||||
|
|
||||||
if type_shipment_ == 'in':
|
if type_shipment_ == 'in':
|
||||||
party = m['shipment.']['supplier.']['name']
|
party = m['shipment.']['supplier.']['name']
|
||||||
elif type_shipment_ == 'out':
|
elif type_shipment_ == 'out':
|
||||||
|
@ -540,6 +548,7 @@ class ShipmentDetailedReport(Report):
|
||||||
value = {
|
value = {
|
||||||
'party': party,
|
'party': party,
|
||||||
'oc': oc,
|
'oc': oc,
|
||||||
|
'analytic': analytic,
|
||||||
'product': product['name'],
|
'product': product['name'],
|
||||||
'code': product['code'],
|
'code': product['code'],
|
||||||
'cost_price': cost_price,
|
'cost_price': cost_price,
|
||||||
|
|
Binary file not shown.
Loading…
Reference in a new issue