addons-cm/website_sale_aplicoop/models/js_translations.py
snt 6fbc7b9456 [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
2026-02-18 17:54:43 +01:00

175 lines
4.8 KiB
Python

# Part of Odoo. See LICENSE file for full copyright and licensing details.
"""
JavaScript Translation Strings
This file ensures that all JavaScript-related translatable strings are imported
into Odoo's translation system during module initialization.
CRITICAL: All strings that are dynamically rendered via JavaScript labels must
be included here with _() to ensure they are captured by Odoo's translation
extraction and loaded into the database.
See: docs/TRANSLATIONS_MASTER.md - "JavaScript Translations Must Be in js_translations.py"
"""
from odoo import _
def _register_translations():
"""
Register all JavaScript translation strings.
Called by Odoo's translation extraction system.
These calls populate the POT/PO files for translation.
"""
# ========================
# Action Labels
# ========================
_("Save Cart")
_("Reload Cart")
_("Browse Product Categories")
_("Proceed to Checkout")
_("Confirm Order")
_("Back to Cart")
_("Remove Item")
_("Add to Cart")
_("Save as Draft")
_("Load Draft")
_("Browse Product Categories")
# ========================
# Draft Modal Labels
# ========================
_("Draft Already Exists")
_("A saved draft already exists for this week.")
_("You have two options:")
_("Option 1: Merge with Existing Draft")
_("Combine your current cart with the existing draft.")
_("Existing draft has")
_("Current cart has")
_("item(s)")
_(
"Products will be merged by adding quantities. If a product exists in both, quantities will be combined."
)
_("Option 2: Replace with Current Cart")
_("Delete the old draft and save only the current cart items.")
_("The existing draft will be permanently deleted.")
_("Merge")
_("Replace")
# ========================
# Draft Save/Load Confirmations
# ========================
_("Are you sure you want to save this cart as draft? Items to save: ")
_("You will be able to reload this cart later.")
_("Are you sure you want to load your last saved draft?")
_("This will replace the current items in your cart")
_("with the saved draft.")
# ========================
# Cart Messages (All Variations)
# ========================
_("Your cart is empty")
_("This order's cart is empty.")
_("This order's cart is empty")
_("added to cart")
_("items")
_("Your cart has been restored")
# ========================
# Confirmation & Validation
# ========================
_("Confirmation")
_("Confirm")
_("Cancel")
_("Please enter a valid quantity")
# ========================
# Error Messages
# ========================
_("Error: Order ID not found")
_("No draft orders found for this week")
_("Connection error")
_("Error loading order")
_("Error loading draft")
_("Unknown error")
_("Error saving cart")
_("Error processing response")
# ========================
# Success Messages
# ========================
_("Cart saved as draft successfully")
_("Draft order loaded successfully")
_("Draft merged successfully")
_("Draft replaced successfully")
_("Order loaded")
_("Thank you! Your order has been confirmed.")
_("Quantity updated")
# ========================
# Field Labels
# ========================
_("Product")
_("Supplier")
_("Price")
_("Quantity")
_("Subtotal")
_("Total")
# ========================
# Checkout Page Labels
# ========================
_("Home Delivery")
_("Delivery Information")
_(
"Delivery Information: Your order will be delivered at {pickup_day} {pickup_date}"
)
_("Your order will be delivered the day after pickup between 11:00 - 14:00")
_("Important")
_(
"Once you confirm this order, you will not be able to modify it. Please review carefully before confirming."
)
# ========================
# Search & Filter Labels
# ========================
_("Search")
_("Search products...")
_("No products found")
_("Categories")
_("All categories")
# ========================
# Category Labels
# ========================
_("Order Type")
_("Order Period")
_("Cutoff Day")
_("Pickup Day")
_("Store Pickup Day")
_("Open until")
# ========================
# Portal Page Labels (New)
# ========================
_("Load in Cart")
_("Consumer Group")
_("Delivery Information")
_("Delivery Date:")
_("Pickup Date:")
_("Delivery Notice:")
_("No special delivery instructions")
_("Pickup Location:")
# ========================
# Day Names (Required for translations)
# ========================
_("Monday")
_("Tuesday")
_("Wednesday")
_("Thursday")
_("Friday")
_("Saturday")
_("Sunday")