[FIX] website_sale_aplicoop: Remove redundant string= attributes and fix OCA linting warnings

- Remove redundant string= from 17 field definitions where name matches string value (W8113)
- Convert @staticmethod to instance methods in selection methods for proper self.env._() access
- Fix W8161 (prefer-env-translation) by using self.env._() instead of standalone _()
- Fix W8301/W8115 (translation-not-lazy) by proper placement of % interpolation outside self.env._()
- Remove unused imports of odoo._ from group_order.py and sale_order_extension.py
- All OCA linting warnings in website_sale_aplicoop main models are now resolved

Changes:
- website_sale_aplicoop/models/group_order.py: 21 field definitions cleaned
- website_sale_aplicoop/models/sale_order_extension.py: 5 field definitions cleaned + @staticmethod conversion
- Consistent with OCA standards for addon submission
This commit is contained in:
snt 2026-02-18 17:54:43 +01:00
parent 5c89795e30
commit 6fbc7b9456
73 changed files with 5386 additions and 4354 deletions

View file

@ -18,7 +18,7 @@
var pickupDate = '<t t-esc="pickup_date or ''"/>';
var homeDelivery = <t t-esc="home_delivery and 'true' or 'false'"/>;
var sameGroupOrder = <t t-esc="same_group_order and 'true' or 'false'"/>;
console.log('load_from_history template: groupOrderId=', groupOrderId);
console.log('load_from_history template: saleOrderName=', saleOrderName);
console.log('load_from_history template: pickupDay=', pickupDay);
@ -27,16 +27,16 @@
console.log('load_from_history template: sameGroupOrder=', sameGroupOrder);
console.log('load_from_history template: itemsJson type=', typeof itemsJson);
console.log('load_from_history template: itemsJson value=', itemsJson);
// If itemsJson is already a string, use it directly; if it's an array, stringify it
var itemsJsonString = (typeof itemsJson === 'string') ? itemsJson : JSON.stringify(itemsJson);
// Store items to sessionStorage
sessionStorage['load_from_history_' + groupOrderId] = itemsJsonString;
// Store sale order name separately
sessionStorage['load_from_history_order_name_' + groupOrderId] = saleOrderName;
// Store pickup fields ONLY if from same group order
if (sameGroupOrder === 'true') {
sessionStorage['load_from_history_pickup_day_' + groupOrderId] = pickupDay;
@ -46,10 +46,10 @@
} else {
console.log('Skipped saving pickup fields (different group order - will use current group order days)');
}
console.log('Saved to sessionStorage[load_from_history_' + groupOrderId + ']:', itemsJsonString);
console.log('Saved order name to sessionStorage[load_from_history_order_name_' + groupOrderId + ']:', saleOrderName);
// Redirect to group order page
// The JavaScript on that page will detect this and load the items
window.location.href = '/eskaera/' + groupOrderId;