Commit 3e0c1125 by Administrator

Merge branch…

Merge branch '7653-newly-opened-shelf-removed-from-local-storage-when-loading-shelfs-page' into 'migration-v12'

to avoid unwanted deletion of local storage (by false detection of changed local…

See merge request !281
parents f89645c8 65e1e9f3
Pipeline #4150 failed with stage
in 0 seconds
......@@ -938,4 +938,6 @@ def delete_pair_core(data):
child_member_update_fields['cooperative_state'] = "gone"
api.update("res.partner", [child_contact['suppleant_member_id']], child_member_update_fields)
if 'gone' in data and 'parent' in data['gone']:
cm = CagetteMember(parent['id'])
cm.unsubscribe_member()
api.update("res.partner", [parent['id']], {'cooperative_state': "gone", "is_former_associated_people": True})
......@@ -199,27 +199,33 @@ class ExportPOS(View):
'CB_DEJ': 0,
'CHQ_DEJ': 0,
'MonA': 0,
'NON_CATEGORISABLE': 0,
'TOTAL': 0}
sub_total = 0
cb = chq = csh = cbd = chqd = mona = 0
cb = chq = csh = cbd = chqd = mona = nocat = 0
coop_logger.info("payments : %s", s['payments'])
for p in s['payments']:
# p['name'] is a sequence generated string
# Test order is important as CHEQDEJ contains CHEQ for ex.
# p['journal'] could be used but easier to change in Odoo interface
# p['name'] does not contain information about payment method
# therefore, we use p['journal'], despite it's risky because
# it's easy to change in Odoo interface
# adding NON_CATEGORISABLE column allows at least to show potential errors
# Test order is important.
sub_amount = round(float(p['total_amount']), 2) if p['total_amount'] else 0.00
if 'CSH' in p['name']:
if 'Espèces' in p['journal']:
csh = sub_amount
elif 'CHEQDEJ' in p['name']:
elif 'Chèques Déj' in p['journal']:
chqd = sub_amount
elif 'CHEQ' in p['name']:
elif 'Chèques' in p['journal']:
chq = sub_amount
elif 'CBDEJ' in p['name']:
elif 'CB Déj' in p['journal']:
cbd = sub_amount
elif 'CB' in p['name']:
#for CB, first is v9 syntax used for la cagette and second is v12 syntax used for la cagette
elif 'Carte Bancaire' in p['journal'] or 'Cartes bancaires' in p['journal']:
cb = sub_amount
elif 'MonA' in p['name'] or 'MonA' in p['journal']:
elif 'MonA' in p['journal']:
mona = sub_amount
else:
nocat = sub_amount
sub_total += sub_amount
totals[key]['CB'] += cb
totals[key]['CSH'] += csh
......@@ -227,13 +233,14 @@ class ExportPOS(View):
totals[key]['CB_DEJ'] += cbd
totals[key]['CHQ_DEJ'] += chqd
totals[key]['MonA'] += mona
totals[key]['NON_CATEGORISABLE'] += nocat
totals[key]['TOTAL'] += round(sub_total, 2)
details_lines.append([mois, s['mm_dates']['min'], s['mm_dates']['max'], s['caisse'], s['name'],
cb, csh, chq, cbd, chqd, mona, sub_total])
cb, csh, chq, cbd, chqd, mona, nocat, sub_total])
wb = Workbook()
ws1 = wb.create_sheet("Totaux " + mois, 0)
ws2 = wb.create_sheet("Détails " + mois, 1)
ws1.append(['date', 'CB', 'CSH', 'CHQ', 'CB_DEJ', 'CHQ_DEJ', 'MonA', 'Total'])
ws1.append(['date', 'CB', 'CSH', 'CHQ', 'CB_DEJ', 'CHQ_DEJ', 'MonA', 'NON_CATEGORISABLE', 'Total'])
for day in sorted(totals):
cb = totals[day]['CB']
csh = totals[day]['CSH']
......@@ -241,9 +248,10 @@ class ExportPOS(View):
cbd = totals[day]['CB_DEJ']
chqd = totals[day]['CHQ_DEJ']
mona = totals[day]['MonA']
nocat = totals[day]['NON_CATEGORISABLE']
total = totals[day]['TOTAL']
ws1.append([day, cb, csh, chq, cbd, chqd, mona, total])
ws2.append(['mois', 'min_date', 'max_date', 'Caisse', 'session', 'CB', 'CSH','CHQ', 'CB_DEJ', 'CHQ_DEJ', 'MonA', 'total'])
ws1.append([day, cb, csh, chq, cbd, chqd, mona, nocat, total])
ws2.append(['mois', 'min_date', 'max_date', 'Caisse', 'session', 'CB', 'CSH','CHQ', 'CB_DEJ', 'CHQ_DEJ', 'MonA', 'NON_CATEGORISABLE', 'total'])
for row in details_lines:
ws2.append(row)
wb_name = 'export_sessions__' + mois + '.xlsx'
......
......@@ -107,6 +107,8 @@ class CagetteProduct(models.Model):
v = round(float(price) / float(product['volume']), 2)
if directory != "/product_labels/" or (directory == "/product_labels/" and k != "meal_voucher_ok"):
# add parameter to text unless it's for a product label and parameter is meal_voucher_ok
if str(v) == "0.0" and k == "price_weight_net":
v = ''
txt += k + '=' + str(v).strip() + "\r\n"
if directory == '/labels/' and meal_voucher_found is False:
txt += 'meal_voucher_ok=' + "\r\n"
......
......@@ -213,6 +213,8 @@ def update_orders(request):
if update is not True:
errors.append(order_line['id'])
if update is True:
spu = m.stock_picking_update(order_line)
# If update succeded, and supplier shortage set, try to register the supplier shortage
if update is True and 'supplier_shortage' in order_line:
......
......@@ -319,7 +319,8 @@ $(document).ready(function() {
if (
stored_shelf !== null
&& stored_shelf.ongoing_inv_start_datetime !== undefined
&& shelf.ongoing_inv_start_datetime !== stored_shelf.ongoing_inv_start_datetime
&& shelf.ongoing_inv_start_datetime //stored_sheld.ongoing_inv_start_datetime MUST be cleaned for comparison
!== stored_shelf.ongoing_inv_start_datetime.replace("T", " ").split(".")[0]
) {
localStorage.removeItem('shelf_' + shelf.id);
}
......
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