Commit ef5c7747 authored by Xiaowu Zhang's avatar Xiaowu Zhang

erp5_trade: add ean13 code column

parent 09dd7750
...@@ -72,14 +72,14 @@ if group_by == "client": ...@@ -72,14 +72,14 @@ if group_by == "client":
total_stat_list = [('total amount', 'total amount'),] total_stat_list = [('total amount', 'total amount'),]
else: else:
if group_by == "product": if group_by == "product":
selection_columns = [('product_reference', "Product Reference", ), ('product', "Product")] selection_columns = [('product_reference', "Product Reference", ), ('product', "Product"), ('ean13_code', 'Ean13 code')]
stat_columns = [('product', "product")] stat_columns = [('product', "product")]
elif group_by == "function": elif group_by == "function":
function_title = context.AccountingTransactionLine_getFunctionBaseCategoryTitle() function_title = context.AccountingTransactionLine_getFunctionBaseCategoryTitle()
selection_columns = [('product', function_title)] selection_columns = [('product', function_title)]
stat_columns = [('product', "product")] stat_columns = [('product', "product")]
else: else:
selection_columns = [('client', "Client"), ('product_reference', "Product Reference", ), ('product', "Product")] selection_columns = [('client', "Client"), ('product_reference', "Product Reference", ), ('product', "Product"), ('ean13_code', 'Ean13 code')]
stat_columns = [('client', "client"), ('product', "product")] stat_columns = [('client', "client"), ('product', "product")]
for x in interval_list: for x in interval_list:
interval_column_list.extend([("Amount %s" %x,"Amount %s" %x), ("Quantity %s" %x,"Quantity %s" %x)]) interval_column_list.extend([("Amount %s" %x,"Amount %s" %x), ("Quantity %s" %x,"Quantity %s" %x)])
......
...@@ -139,7 +139,10 @@ for result in result_list: ...@@ -139,7 +139,10 @@ for result in result_list:
else: else:
product_title = line.getResourceTitle() product_title = line.getResourceTitle()
resource_value = line.getResourceValue() resource_value = line.getResourceValue()
resource_title_dict[product_title] = resource_value.getReference() resource_title_dict[product_title] = {
'reference': resource_value.getReference(),
'ean13_code': resource_value.getEan13Code()
}
if price_type == 'sale_price': if price_type == 'sale_price':
total_price = line.getTotalPrice() total_price = line.getTotalPrice()
...@@ -205,7 +208,9 @@ if len(client_dict): ...@@ -205,7 +208,9 @@ if len(client_dict):
for product_title in line_product_dict.keys(): for product_title in line_product_dict.keys():
obj = Object(uid="new_") obj = Object(uid="new_")
obj['product'] = product_title obj['product'] = product_title
obj['product_reference'] = resource_title_dict.get(product_title) obj['product_reference'] = resource_title_dict.get(product_title)['reference']
obj['ean13_code'] = resource_title_dict.get(product_title)['ean13_code']
line_total_amount = 0 line_total_amount = 0
line_total_quantity = 0 line_total_quantity = 0
for period in period_list: for period in period_list:
...@@ -257,7 +262,8 @@ else: ...@@ -257,7 +262,8 @@ else:
for product_title in product_dict.keys(): for product_title in product_dict.keys():
obj = Object(uid="new_") obj = Object(uid="new_")
obj['product'] = product_title obj['product'] = product_title
obj['product_reference'] = resource_title_dict.get(product_title) obj['product_reference'] = resource_title_dict.get(product_title)['reference']
obj['ean13_code'] = resource_title_dict.get(product_title)['ean13_code']
line_total_amount = 0 line_total_amount = 0
line_total_quantity = 0 line_total_quantity = 0
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment