diff --git a/stock_valuation_xlsx/i18n/fr.po b/stock_valuation_xlsx/i18n/fr.po index 56664e4..7714453 100644 --- a/stock_valuation_xlsx/i18n/fr.po +++ b/stock_valuation_xlsx/i18n/fr.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 16.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-21 16:21+0000\n" -"PO-Revision-Date: 2024-10-21 16:21+0000\n" +"POT-Creation-Date: 2024-10-22 07:43+0000\n" +"PO-Revision-Date: 2024-10-22 07:44+0000\n" "Last-Translator: Alexis de Lattre \n" "Language-Team: \n" "Language: fr\n" @@ -54,6 +54,27 @@ msgstr "Coût" msgid "Cost Price Date" msgstr "Date du coût" +#. module: stock_valuation_xlsx +#. odoo-python +#: code:addons/stock_valuation_xlsx/wizard/stock_valuation_xlsx.py:0 +#, python-format +msgid "Cost Price Date: %s" +msgstr "Date du coût : %s" + +#. module: stock_valuation_xlsx +#. odoo-python +#: code:addons/stock_valuation_xlsx/wizard/stock_variation_xlsx.py:0 +#, python-format +msgid "Cost Price End Date: %s" +msgstr "Date du coût final : %s" + +#. module: stock_valuation_xlsx +#. odoo-python +#: code:addons/stock_valuation_xlsx/wizard/stock_variation_xlsx.py:0 +#, python-format +msgid "Cost Price Start Date: %s" +msgstr "Date du coût de départ : %s" + #. module: stock_valuation_xlsx #: model:ir.model.fields,field_description:stock_valuation_xlsx.field_stock_variation_xlsx__standard_price_end_date_type msgid "Cost Price for End Date" @@ -62,7 +83,7 @@ msgstr "Coût pour la date de fin" #. module: stock_valuation_xlsx #: model:ir.model.fields,field_description:stock_valuation_xlsx.field_stock_variation_xlsx__standard_price_start_date_type msgid "Cost Price for Start Date" -msgstr "Coût pour la date de début" +msgstr "Coût pour la date de départ" #. module: stock_valuation_xlsx #: model:ir.model.fields,field_description:stock_valuation_xlsx.field_stock_expiry_depreciation_rule__create_uid @@ -129,7 +150,7 @@ msgstr "Fin" #: code:addons/stock_valuation_xlsx/wizard/stock_variation_xlsx.py:0 #, python-format msgid "End Cost Price" -msgstr "Coût date de fin" +msgstr "Coût final" #. module: stock_valuation_xlsx #: model:ir.model.fields,field_description:stock_valuation_xlsx.field_stock_variation_xlsx__end_date @@ -149,12 +170,19 @@ msgstr "Temporalité de la date de fin" msgid "End Date is missing." msgstr "La date de fin est manquante." +#. module: stock_valuation_xlsx +#. odoo-python +#: code:addons/stock_valuation_xlsx/wizard/stock_variation_xlsx.py:0 +#, python-format +msgid "End Date: %s" +msgstr "Date de fin : %s" + #. module: stock_valuation_xlsx #. odoo-python #: code:addons/stock_valuation_xlsx/wizard/stock_variation_xlsx.py:0 #, python-format msgid "End Qty" -msgstr "Qté fin" +msgstr "Qté finale" #. module: stock_valuation_xlsx #. odoo-python @@ -205,6 +233,14 @@ msgstr "" "Générer un rapport XLSX pour la valorisation de la variation des stocks " "entre 2 dates" +#. module: stock_valuation_xlsx +#. odoo-python +#: code:addons/stock_valuation_xlsx/wizard/stock_valuation_xlsx.py:0 +#: code:addons/stock_valuation_xlsx/wizard/stock_variation_xlsx.py:0 +#, python-format +msgid "Generated from Odoo on %s by %s" +msgstr "Généré à partir d'Odoo le %s par %s" + #. module: stock_valuation_xlsx #: model:ir.model.fields,field_description:stock_valuation_xlsx.field_stock_valuation_xlsx__has_expiry_date msgid "Has Expiry Date" @@ -224,6 +260,13 @@ msgstr "ID" msgid "In Qty" msgstr "Qté entrée" +#. module: stock_valuation_xlsx +#. odoo-python +#: code:addons/stock_valuation_xlsx/wizard/stock_valuation_xlsx.py:0 +#, python-format +msgid "Inventory Date: %s" +msgstr "Date de l'inventaire : %s" + #. module: stock_valuation_xlsx #: model:ir.actions.act_window,name:stock_valuation_xlsx.stock_valuation_xlsx_action #: model:ir.ui.menu,name:stock_valuation_xlsx.stock_valuation_xlsx_menu @@ -316,6 +359,14 @@ msgstr "Présent" msgid "Product Barcode" msgstr "Code-barres du produit" +#. module: stock_valuation_xlsx +#. odoo-python +#: code:addons/stock_valuation_xlsx/wizard/stock_valuation_xlsx.py:0 +#: code:addons/stock_valuation_xlsx/wizard/stock_variation_xlsx.py:0 +#, python-format +msgid "Product Categories: %s" +msgstr "Catégories de produits : %s" + #. module: stock_valuation_xlsx #. odoo-python #: code:addons/stock_valuation_xlsx/wizard/stock_valuation_xlsx.py:0 @@ -375,13 +426,20 @@ msgstr "Début" #: code:addons/stock_valuation_xlsx/wizard/stock_variation_xlsx.py:0 #, python-format msgid "Start Cost Price" -msgstr "Coût date de début" +msgstr "Coût de départ" #. module: stock_valuation_xlsx #: model:ir.model.fields,field_description:stock_valuation_xlsx.field_stock_variation_xlsx__start_date #: model:ir.model.fields.selection,name:stock_valuation_xlsx.selection__stock_variation_xlsx__standard_price_start_date_type__start msgid "Start Date" -msgstr "Date de début" +msgstr "Date de départ" + +#. module: stock_valuation_xlsx +#. odoo-python +#: code:addons/stock_valuation_xlsx/wizard/stock_variation_xlsx.py:0 +#, python-format +msgid "Start Date: %s" +msgstr "Date de départ : %s" #. module: stock_valuation_xlsx #. odoo-python @@ -408,6 +466,20 @@ msgstr "Règles de dépréciation du stock" msgid "Stock Expiry Depreciation Rule" msgstr "Règle de dépréciation du stock pour la péremption" +#. module: stock_valuation_xlsx +#. odoo-python +#: code:addons/stock_valuation_xlsx/wizard/stock_valuation_xlsx.py:0 +#, python-format +msgid "Stock Valuation" +msgstr "Valorisation du stock" + +#. module: stock_valuation_xlsx +#. odoo-python +#: code:addons/stock_valuation_xlsx/wizard/stock_variation_xlsx.py:0 +#, python-format +msgid "Stock Valuation Variation" +msgstr "Variation de la valorisation du stock" + #. module: stock_valuation_xlsx #. odoo-python #: code:addons/stock_valuation_xlsx/wizard/stock_valuation_xlsx.py:0 @@ -422,6 +494,14 @@ msgstr "Valorisation du stock XLSX" msgid "Stock Variation XLSX" msgstr "Variation du stock XLSX" +#. module: stock_valuation_xlsx +#. odoo-python +#: code:addons/stock_valuation_xlsx/wizard/stock_valuation_xlsx.py:0 +#: code:addons/stock_valuation_xlsx/wizard/stock_variation_xlsx.py:0 +#, python-format +msgid "Stock location (children included): %s" +msgstr "Emplacement de stock (enfants inclus) : %s" + #. module: stock_valuation_xlsx #. odoo-python #: code:addons/stock_valuation_xlsx/wizard/stock_valuation_xlsx.py:0 diff --git a/stock_valuation_xlsx/i18n/stock_valuation_xlsx.pot b/stock_valuation_xlsx/i18n/stock_valuation_xlsx.pot index e3ac8f1..04324ca 100644 --- a/stock_valuation_xlsx/i18n/stock_valuation_xlsx.pot +++ b/stock_valuation_xlsx/i18n/stock_valuation_xlsx.pot @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 16.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-21 16:20+0000\n" -"PO-Revision-Date: 2024-10-21 16:20+0000\n" +"POT-Creation-Date: 2024-10-22 07:43+0000\n" +"PO-Revision-Date: 2024-10-22 07:43+0000\n" "Last-Translator: \n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -53,6 +53,27 @@ msgstr "" msgid "Cost Price Date" msgstr "" +#. module: stock_valuation_xlsx +#. odoo-python +#: code:addons/stock_valuation_xlsx/wizard/stock_valuation_xlsx.py:0 +#, python-format +msgid "Cost Price Date: %s" +msgstr "" + +#. module: stock_valuation_xlsx +#. odoo-python +#: code:addons/stock_valuation_xlsx/wizard/stock_variation_xlsx.py:0 +#, python-format +msgid "Cost Price End Date: %s" +msgstr "" + +#. module: stock_valuation_xlsx +#. odoo-python +#: code:addons/stock_valuation_xlsx/wizard/stock_variation_xlsx.py:0 +#, python-format +msgid "Cost Price Start Date: %s" +msgstr "" + #. module: stock_valuation_xlsx #: model:ir.model.fields,field_description:stock_valuation_xlsx.field_stock_variation_xlsx__standard_price_end_date_type msgid "Cost Price for End Date" @@ -148,6 +169,13 @@ msgstr "" msgid "End Date is missing." msgstr "" +#. module: stock_valuation_xlsx +#. odoo-python +#: code:addons/stock_valuation_xlsx/wizard/stock_variation_xlsx.py:0 +#, python-format +msgid "End Date: %s" +msgstr "" + #. module: stock_valuation_xlsx #. odoo-python #: code:addons/stock_valuation_xlsx/wizard/stock_variation_xlsx.py:0 @@ -199,6 +227,14 @@ msgstr "" msgid "Generate XLSX report for stock valuation variation between 2 dates" msgstr "" +#. module: stock_valuation_xlsx +#. odoo-python +#: code:addons/stock_valuation_xlsx/wizard/stock_valuation_xlsx.py:0 +#: code:addons/stock_valuation_xlsx/wizard/stock_variation_xlsx.py:0 +#, python-format +msgid "Generated from Odoo on %s by %s" +msgstr "" + #. module: stock_valuation_xlsx #: model:ir.model.fields,field_description:stock_valuation_xlsx.field_stock_valuation_xlsx__has_expiry_date msgid "Has Expiry Date" @@ -218,6 +254,13 @@ msgstr "" msgid "In Qty" msgstr "" +#. module: stock_valuation_xlsx +#. odoo-python +#: code:addons/stock_valuation_xlsx/wizard/stock_valuation_xlsx.py:0 +#, python-format +msgid "Inventory Date: %s" +msgstr "" + #. module: stock_valuation_xlsx #: model:ir.actions.act_window,name:stock_valuation_xlsx.stock_valuation_xlsx_action #: model:ir.ui.menu,name:stock_valuation_xlsx.stock_valuation_xlsx_menu @@ -308,6 +351,14 @@ msgstr "" msgid "Product Barcode" msgstr "" +#. module: stock_valuation_xlsx +#. odoo-python +#: code:addons/stock_valuation_xlsx/wizard/stock_valuation_xlsx.py:0 +#: code:addons/stock_valuation_xlsx/wizard/stock_variation_xlsx.py:0 +#, python-format +msgid "Product Categories: %s" +msgstr "" + #. module: stock_valuation_xlsx #. odoo-python #: code:addons/stock_valuation_xlsx/wizard/stock_valuation_xlsx.py:0 @@ -375,6 +426,13 @@ msgstr "" msgid "Start Date" msgstr "" +#. module: stock_valuation_xlsx +#. odoo-python +#: code:addons/stock_valuation_xlsx/wizard/stock_variation_xlsx.py:0 +#, python-format +msgid "Start Date: %s" +msgstr "" + #. module: stock_valuation_xlsx #. odoo-python #: code:addons/stock_valuation_xlsx/wizard/stock_variation_xlsx.py:0 @@ -400,6 +458,20 @@ msgstr "" msgid "Stock Expiry Depreciation Rule" msgstr "" +#. module: stock_valuation_xlsx +#. odoo-python +#: code:addons/stock_valuation_xlsx/wizard/stock_valuation_xlsx.py:0 +#, python-format +msgid "Stock Valuation" +msgstr "" + +#. module: stock_valuation_xlsx +#. odoo-python +#: code:addons/stock_valuation_xlsx/wizard/stock_variation_xlsx.py:0 +#, python-format +msgid "Stock Valuation Variation" +msgstr "" + #. module: stock_valuation_xlsx #. odoo-python #: code:addons/stock_valuation_xlsx/wizard/stock_valuation_xlsx.py:0 @@ -414,6 +486,14 @@ msgstr "" msgid "Stock Variation XLSX" msgstr "" +#. module: stock_valuation_xlsx +#. odoo-python +#: code:addons/stock_valuation_xlsx/wizard/stock_valuation_xlsx.py:0 +#: code:addons/stock_valuation_xlsx/wizard/stock_variation_xlsx.py:0 +#, python-format +msgid "Stock location (children included): %s" +msgstr "" + #. module: stock_valuation_xlsx #. odoo-python #: code:addons/stock_valuation_xlsx/wizard/stock_valuation_xlsx.py:0 diff --git a/stock_valuation_xlsx/wizard/stock_valuation_xlsx.py b/stock_valuation_xlsx/wizard/stock_valuation_xlsx.py index fff5d87..cefc7e9 100644 --- a/stock_valuation_xlsx/wizard/stock_valuation_xlsx.py +++ b/stock_valuation_xlsx/wizard/stock_valuation_xlsx.py @@ -6,6 +6,7 @@ from odoo import models, fields, api, _ from odoo.exceptions import UserError from dateutil.relativedelta import relativedelta from odoo.tools import float_is_zero, float_round +from odoo.tools.misc import format_datetime from io import BytesIO from datetime import datetime import xlsxwriter @@ -385,12 +386,9 @@ class StockValuationXlsx(models.TransientModel): j += 1 # HEADER - now_dt = fields.Datetime.context_timestamp(self, datetime.now()) - now_str = fields.Datetime.to_string(now_dt) + now_str = format_datetime(self.env, datetime.now()) if past_date: - stock_time_utc_dt = past_date - stock_time_dt = fields.Datetime.context_timestamp(self, stock_time_utc_dt) - stock_time_str = fields.Datetime.to_string(stock_time_dt) + stock_time_str = format_datetime(self.env, past_date) else: stock_time_str = now_str if standard_price_past_date: @@ -398,22 +396,23 @@ class StockValuationXlsx(models.TransientModel): else: standard_price_date_str = now_str i = 0 - sheet.write(i, 0, 'Odoo - Stock Valuation', styles['doc_title']) - sheet.set_row(0, 26) + sheet.write(i, 0, _('Stock Valuation'), styles['doc_title']) + sheet.set_row(i, 26) i += 1 - sheet.write(i, 0, 'Inventory Date: %s' % stock_time_str, styles['doc_subtitle']) + sheet.write(i, 0, _('Inventory Date: %s') % stock_time_str, styles['doc_subtitle']) i += 1 - sheet.write(i, 0, 'Cost Price Date: %s' % standard_price_date_str, styles['doc_subtitle']) + sheet.write(i, 0, _('Cost Price Date: %s') % standard_price_date_str, styles['doc_subtitle']) i += 1 - sheet.write(i, 0, 'Stock location (children included): %s' % self.location_id.complete_name, styles['doc_subtitle']) + sheet.write(i, 0, _('Stock location (children included): %s') % self.location_id.complete_name, styles['doc_subtitle']) if self.categ_ids: i += 1 - sheet.write(i, 0, 'Product Categories: %s' % ', '.join([categ.display_name for categ in self.categ_ids]), styles['doc_subtitle']) + sheet.write(i, 0, _('Product Categories: %s') % ', '.join([categ.display_name for categ in self.categ_ids]), styles['doc_subtitle']) i += 1 - sheet.write(i, 0, 'Generated on %s by %s' % (now_str, self.env.user.name), styles['regular_small']) + sheet.write(i, 0, _('Generated from Odoo on %s by %s') % (now_str, self.env.user.name), styles['regular_small']) # TITLE of COLS i += 2 + sheet.set_row(i, 26) for col in cols.values(): sheet.write(i, col['pos'], col['title'], styles['col_title']) diff --git a/stock_valuation_xlsx/wizard/stock_variation_xlsx.py b/stock_valuation_xlsx/wizard/stock_variation_xlsx.py index c2e599a..7433883 100644 --- a/stock_valuation_xlsx/wizard/stock_variation_xlsx.py +++ b/stock_valuation_xlsx/wizard/stock_variation_xlsx.py @@ -5,6 +5,7 @@ from odoo import models, fields, api, _ from odoo.exceptions import UserError from odoo.tools import float_is_zero, float_round +from odoo.tools.misc import format_datetime from io import BytesIO import base64 from datetime import datetime @@ -239,15 +240,10 @@ class StockVariationXlsx(models.TransientModel): j += 1 # HEADER - now_dt = fields.Datetime.context_timestamp(self, datetime.now()) - now_str = fields.Datetime.to_string(now_dt) - start_time_utc_dt = self.start_date - start_time_dt = fields.Datetime.context_timestamp(self, start_time_utc_dt) - start_time_str = fields.Datetime.to_string(start_time_dt) + now_str = format_datetime(self.env, datetime.now()) + start_time_str = format_datetime(self.env, self.start_date) if self.end_date_type == 'past': - end_time_utc_dt = self.end_date - end_time_dt = fields.Datetime.context_timestamp(self, end_time_utc_dt) - end_time_str = fields.Datetime.to_string(end_time_dt) + end_time_str = format_datetime(self.env, self.end_date) else: end_time_str = now_str if standard_price_start_date: @@ -259,26 +255,27 @@ class StockVariationXlsx(models.TransientModel): else: standard_price_end_date_str = now_str i = 0 - sheet.write(i, 0, 'Odoo - Stock Valuation Variation', styles['doc_title']) - sheet.set_row(0, 26) + sheet.write(i, 0, _('Stock Valuation Variation'), styles['doc_title']) + sheet.set_row(i, 26) i += 1 - sheet.write(i, 0, 'Start Date: %s' % start_time_str, styles['doc_subtitle']) + sheet.write(i, 0, _('Start Date: %s') % start_time_str, styles['doc_subtitle']) i += 1 - sheet.write(i, 0, 'Cost Price Start Date: %s' % standard_price_start_date_str, styles['doc_subtitle']) + sheet.write(i, 0, _('Cost Price Start Date: %s') % standard_price_start_date_str, styles['doc_subtitle']) i += 1 - sheet.write(i, 0, 'End Date: %s' % end_time_str, styles['doc_subtitle']) + sheet.write(i, 0, _('End Date: %s') % end_time_str, styles['doc_subtitle']) i += 1 - sheet.write(i, 0, 'Cost Price End Date: %s' % standard_price_end_date_str, styles['doc_subtitle']) + sheet.write(i, 0, _('Cost Price End Date: %s') % standard_price_end_date_str, styles['doc_subtitle']) i += 1 - sheet.write(i, 0, 'Stock location (children included): %s' % self.location_id.complete_name, styles['doc_subtitle']) + sheet.write(i, 0, _('Stock location (children included): %s') % self.location_id.complete_name, styles['doc_subtitle']) if self.categ_ids: i += 1 - sheet.write(i, 0, 'Product Categories: %s' % ', '.join([categ.display_name for categ in self.categ_ids]), styles['doc_subtitle']) + sheet.write(i, 0, _('Product Categories: %s') % ', '.join([categ.display_name for categ in self.categ_ids]), styles['doc_subtitle']) i += 1 - sheet.write(i, 0, 'Generated on %s by %s' % (now_str, self.env.user.name), styles['regular_small']) + sheet.write(i, 0, _('Generated from Odoo on %s by %s') % (now_str, self.env.user.name), styles['regular_small']) # TITLE of COLS i += 2 + sheet.set_row(i, 26) for col in cols.values(): sheet.write(i, col['pos'], col['title'], styles['col_title'])