Commit d0b7d9b1 by Yvon Kerdoncuff

#7095 export compta : fix retrieve_odoo_coop_data to use id instead of barcode_base

parent d42f6d4a
Pipeline #3953 failed with stage
in 0 seconds
...@@ -176,14 +176,14 @@ def make_daily_full_sum_up(lines): ...@@ -176,14 +176,14 @@ def make_daily_full_sum_up(lines):
def retrieve_odoo_coop_data (coop_ids): def retrieve_odoo_coop_data (coop_ids):
api = OdooAPI() api = OdooAPI()
fields = ['name', 'barcode_base'] fields = ['name', 'barcode_base', 'id']
cond = [['barcode_base', 'in', coop_ids ]] cond = [['id', 'in', coop_ids]]
coops = api.search_read('res.partner', cond, fields, 3000) coops = api.search_read('res.partner', cond, fields, 3000)
coops_dict = {} coops_dict = {}
for coop in coops: for coop in coops:
if not (str(coop['barcode_base']) in coops_dict.keys()): if not (str(coop['id']) in coops_dict.keys()):
coops_dict[str(coop['barcode_base'])] = \ coops_dict[str(coop['id'])] = \
str(coop['barcode_base']) + ' - ' + coop['name'].replace(';','') str(coop['barcode_base']) + ' - ' + coop['name'].replace(';','')
return coops_dict return coops_dict
......
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