Skip to content

Commit

Permalink
Merge PR #104 into 12.0
Browse files Browse the repository at this point in the history
Signed-off-by legalsylvain
  • Loading branch information
github-grap-bot committed Nov 18, 2024
2 parents 2602c31 + fcd4bf3 commit 8c8df7c
Show file tree
Hide file tree
Showing 13 changed files with 335 additions and 92 deletions.
10 changes: 5 additions & 5 deletions joint_buying_account/i18n/fr.po
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ msgstr ""
"Plural-Forms: \n"

#. module: joint_buying_account
#: code:addons/joint_buying_account/wizards/joint_buying_invoice_commission_wizard_line.py:179
#: code:addons/joint_buying_account/wizards/joint_buying_invoice_commission_wizard_line.py:195
#, python-format
msgid "\n"
"- Non-commissioned sale: %s ; %.2f €"
Expand Down Expand Up @@ -50,7 +50,7 @@ msgid "Commission VAT 20% Excl"
msgstr "Commission 20% HT"

#. module: joint_buying_account
#: code:addons/joint_buying_account/wizards/joint_buying_invoice_commission_wizard_line.py:165
#: code:addons/joint_buying_account/wizards/joint_buying_invoice_commission_wizard_line.py:181
#, python-format
msgid "Commission on %s deposited on %s\n"
"- Ordered Amount : %.2f €\n"
Expand Down Expand Up @@ -118,13 +118,13 @@ msgid "ID"
msgstr ""

#. module: joint_buying_account
#: code:addons/joint_buying_account/wizards/joint_buying_invoice_commission_wizard_line.py:124
#: code:addons/joint_buying_account/wizards/joint_buying_invoice_commission_wizard_line.py:139
#, python-format
msgid "Incorrect fiscal settings block the possibility to generate commission invoices : Incorrect tax type on the tax %s"
msgstr "Le paramétrage fiscal incorrect empêche de générer des factures de commission : type de taxe incorrect sur la taxe %s"

#. module: joint_buying_account
#: code:addons/joint_buying_account/wizards/joint_buying_invoice_commission_wizard_line.py:114
#: code:addons/joint_buying_account/wizards/joint_buying_invoice_commission_wizard_line.py:129
#, python-format
msgid "Incorrect fiscal settings block the possibility to generate commission invoices : Too many taxes %s"
msgstr "Le paramétrage fiscal incorrect empêche de générer des factures de commissions : Trop de taxes %s"
Expand Down Expand Up @@ -245,7 +245,7 @@ msgid "Wizard"
msgstr "Assistant"

#. module: joint_buying_account
#: code:addons/joint_buying_account/wizards/joint_buying_invoice_commission_wizard_line.py:196
#: code:addons/joint_buying_account/wizards/joint_buying_invoice_commission_wizard_line.py:212
#, python-format
msgid "You should define a local partner for the supplier %s."
msgstr "Vous devez définir un partenaire local pour le fournisseur %s."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,17 @@ class JointbuyingInvoiceCommissionWizardLine(models.TransientModel):
string="Detail", compute="_compute_grouped_order_info"
)

def datetime_to_string(self, dt, partner=False):
if not partner or not partner.lang:
partner = self.env.user.partner_id
if not partner or not partner.lang:
partner = self.env.user.company_id.partner_id
lang = self.env["res.lang"].search([("code", "=", partner.lang)])
date_tz_user = fields.Datetime.context_timestamp(
self, fields.Datetime.from_string(dt)
)
return date_tz_user.strftime(lang.date_format)

@api.depends("wizard_id.max_deposit_date", "partner_id")
def _compute_grouped_order_info(self):
for line in self:
Expand All @@ -63,7 +74,7 @@ def _compute_grouped_order_info(self):
)
line.grouped_order_detail = "\n".join(
[
f"- {x['name']} - {x['deposit_date'].strftime('%m/%d/%Y')}"
f"- {x['name']} - {self.datetime_to_string(x['deposit_date'])}"
f" - {x['amount_untaxed']:.2f} €"
for x in all_data
]
Expand Down Expand Up @@ -166,14 +177,15 @@ def _prepare_invoice_line(self, invoice, grouped_order):
and x.amount_untaxed != 0.0
)
base = sum(valid_orders.mapped("amount_untaxed"))

description = _(
"Commission on %s deposited on %s\n"
"- Ordered Amount : %.2f €\n"
"- %d Customers: %s\n"
"- Rate : %.2f %%"
) % (
grouped_order.name,
grouped_order.deposit_date.strftime("%m/%d/%Y"),
self.datetime_to_string(grouped_order.deposit_date, self.local_partner_id),
base,
len(valid_orders),
"-".join(valid_orders.mapped("customer_id.joint_buying_code")),
Expand Down
2 changes: 1 addition & 1 deletion joint_buying_base/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Joint Buying - Base",
"version": "12.0.6.2.0",
"version": "12.0.7.0.0",
"category": "GRAP - Logistics",
"author": "GRAP,La Jardinière,Hashbang",
"website": "https://github.com/grap/odoo-addons-logistics",
Expand Down
94 changes: 48 additions & 46 deletions joint_buying_base/i18n/fr.po
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-12-13 20:27+0000\n"
"PO-Revision-Date: 2023-12-13 20:27+0000\n"
"POT-Creation-Date: 2024-04-05 10:18+0000\n"
"PO-Revision-Date: 2024-04-05 10:18+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
Expand All @@ -16,7 +16,7 @@ msgstr ""
"Plural-Forms: \n"

#. module: joint_buying_base
#: code:addons/joint_buying_base/models/joint_buying_tour.py:310
#: code:addons/joint_buying_base/models/joint_buying_tour.py:288
#, python-format
msgid "%s (copy)"
msgstr "%s (copie)"
Expand All @@ -32,19 +32,19 @@ msgid "<b>Company Address:</b>"
msgstr "<b>Adresse de la société:</b>"

#. module: joint_buying_base
#: code:addons/joint_buying_base/models/joint_buying_tour.py:241
#: code:addons/joint_buying_base/models/joint_buying_tour.py:205
#, python-format
msgid "<i>Delivery and pick-up</i>"
msgstr "<i>Livraison et retrait</i>"

#. module: joint_buying_base
#: code:addons/joint_buying_base/models/joint_buying_tour.py:237
#: code:addons/joint_buying_base/models/joint_buying_tour.py:201
#, python-format
msgid "<i>Truck loading</i>"
msgstr "<i>Chargement du camion</i>"

#. module: joint_buying_base
#: code:addons/joint_buying_base/models/joint_buying_tour.py:239
#: code:addons/joint_buying_base/models/joint_buying_tour.py:203
#, python-format
msgid "<i>Truck unloading</i>"
msgstr "<i>Déchargement du camion</i>"
Expand All @@ -65,7 +65,7 @@ msgid "<span class=\"oe_inline\"> ( On </span>"
msgstr "<span class=\"oe_inline\"> ( Dans </span>"

#. module: joint_buying_base
#: code:addons/joint_buying_base/models/joint_buying_tour.py:234
#: code:addons/joint_buying_base/models/joint_buying_tour.py:198
#, python-format
msgid "<span style='color: green'><b>Pause</b></span>"
msgstr ""
Expand Down Expand Up @@ -102,7 +102,17 @@ msgstr "<strong>Durée</strong>"

#. module: joint_buying_base
#: model_terms:ir.ui.view,arch_db:joint_buying_base.report_joint_buying_tour_document
msgid "<strong>Payload (kg)</strong>"
msgid "<strong>Loaded Amount Untaxed</strong>"
msgstr "Montant HT chargé"

#. module: joint_buying_base
#: model_terms:ir.ui.view,arch_db:joint_buying_base.report_joint_buying_tour_document
msgid "<strong>Loaded Weight</strong>"
msgstr "Poids chargé"

#. module: joint_buying_base
#: model_terms:ir.ui.view,arch_db:joint_buying_base.report_joint_buying_tour_document
msgid "<strong>Payload</strong>"
msgstr "<strong>Charge Utile (kg)</strong>"

#. module: joint_buying_base
Expand Down Expand Up @@ -262,6 +272,7 @@ msgstr "Annuler"
#. module: joint_buying_base
#: model:ir.model.fields,field_description:joint_buying_base.field_joint_buying_tour__carrier_id
#: model:ir.model.fields,field_description:joint_buying_base.field_joint_buying_tour_type__carrier_id
#: model_terms:ir.ui.view,arch_db:joint_buying_base.view_joint_buying_tour_search
msgid "Carrier"
msgstr "Transporteur"

Expand Down Expand Up @@ -328,11 +339,6 @@ msgstr "Code affiché pour la tournée"
msgid "Commission"
msgstr ""

#. module: joint_buying_base
#: model_terms:ir.ui.view,arch_db:joint_buying_base.view_res_partner_form
msgid "Commission Agreement"
msgstr "Accord de commission"

#. module: joint_buying_base
#: model_terms:ir.ui.view,arch_db:joint_buying_base.view_res_partner_form
msgid "Commission Rate"
Expand Down Expand Up @@ -402,11 +408,6 @@ msgstr "Étiquettes de contact"
msgid "Cost"
msgstr "Coût"

#. module: joint_buying_base
#: model:ir.model.fields,field_description:joint_buying_base.field_joint_buying_tour__cost_chart
msgid "Cost Chart"
msgstr "Graphique des coûts"

#. module: joint_buying_base
#: model_terms:ir.ui.view,arch_db:joint_buying_base.view_joint_buying_tour_form
msgid "Cost allocation"
Expand Down Expand Up @@ -459,6 +460,7 @@ msgstr "Devise"
#: model:res.company,overdue_msg:joint_buying_base.company_CRB
#: model:res.company,overdue_msg:joint_buying_base.company_EDC
#: model:res.company,overdue_msg:joint_buying_base.company_ELD
#: model:res.company,overdue_msg:joint_buying_base.company_LOG
#: model:res.company,overdue_msg:joint_buying_base.company_LSE
#: model:res.company,overdue_msg:joint_buying_base.company_PZI
#: model:res.company,overdue_msg:joint_buying_base.company_TOU
Expand Down Expand Up @@ -524,7 +526,7 @@ msgid "Distance"
msgstr ""

#. module: joint_buying_base
#: code:addons/joint_buying_base/models/joint_buying_tour.py:133
#: code:addons/joint_buying_base/models/joint_buying_tour.py:139
#, python-format
msgid "Draft Tour"
msgstr "Tournée en brouillon"
Expand Down Expand Up @@ -860,7 +862,7 @@ msgid "Journey"
msgstr "Trajet"

#. module: joint_buying_base
#: code:addons/joint_buying_base/models/joint_buying_tour.py:229
#: code:addons/joint_buying_base/models/joint_buying_tour.py:193
#, python-format
msgid "Journey from %s to %s"
msgstr "Trajet de %s à %s"
Expand Down Expand Up @@ -929,6 +931,16 @@ msgstr "Ligne"
msgid "Load"
msgstr "Charger"

#. module: joint_buying_base
#: model:ir.model.fields,field_description:joint_buying_base.field_joint_buying_tour__loaded_amount_untaxed
msgid "Loaded Amount Untaxed"
msgstr "Montant HT chargé"

#. module: joint_buying_base
#: model:ir.model.fields,field_description:joint_buying_base.field_joint_buying_tour__loaded_weight
msgid "Loaded Weight"
msgstr "Poids chargé"

#. module: joint_buying_base
#: model_terms:ir.ui.view,arch_db:joint_buying_base.report_joint_buying_tour_document_request_lines
msgid "Loading"
Expand All @@ -953,7 +965,7 @@ msgid "Manager"
msgstr "Gestionnaire"

#. module: joint_buying_base
#: code:addons/joint_buying_base/models/joint_buying_transport_request.py:198
#: code:addons/joint_buying_base/models/joint_buying_transport_request.py:213
#: selection:joint.buying.transport.request,request_type:0
#, python-format
msgid "Manual"
Expand All @@ -964,6 +976,11 @@ msgstr "Manuel"
msgid "Manual Description"
msgstr "Description (Manuelle)"

#. module: joint_buying_base
#: model:ir.model.fields,field_description:joint_buying_base.field_joint_buying_transport_request__manual_supplier_id
msgid "Manual Supplier"
msgstr "Fournisseur manuel"

#. module: joint_buying_base
#: model:ir.model.fields,field_description:joint_buying_base.field_joint_buying_carrier__message_has_error
#: model:ir.model.fields,field_description:joint_buying_base.field_joint_buying_tour__message_has_error
Expand Down Expand Up @@ -1125,8 +1142,8 @@ msgstr "Planifiée"

#. module: joint_buying_base
#: model_terms:ir.ui.view,arch_db:joint_buying_base.view_joint_buying_transport_request_search
msgid "Positive Amount"
msgstr "Montant positif"
msgid "Positive Amount or Manual"
msgstr "Montant positif ou Demande manuelle"

#. module: joint_buying_base
#: model:res.partner.category,name:joint_buying_base.partner_category_poultry
Expand All @@ -1140,6 +1157,7 @@ msgstr "Demande"

#. module: joint_buying_base
#: model:ir.model.fields,field_description:joint_buying_base.field_joint_buying_transport_request__request_type
#: model_terms:ir.ui.view,arch_db:joint_buying_base.view_joint_buying_transport_request_search
msgid "Request Type"
msgstr "Type de demande"

Expand All @@ -1158,12 +1176,6 @@ msgid "Route information is given as an indication only!<br/>\n"
msgstr "Les prévisions de trajets sont données à titre indicatif seulement ! <br/>\n"
" Il peut y avoir des bouchons, des retards, des imprévus, etc..."

#. module: joint_buying_base
#: code:addons/joint_buying_base/models/joint_buying_tour.py:161
#, python-format
msgid "Salary"
msgstr "Salaire"

#. module: joint_buying_base
#: model:ir.model.fields,field_description:joint_buying_base.field_joint_buying_tour__salary_cost
#: model:ir.model.fields,field_description:joint_buying_base.field_joint_buying_tour_line__salary_cost
Expand All @@ -1173,7 +1185,7 @@ msgstr "Coût des salaires"
#. module: joint_buying_base
#: selection:joint.buying.transport.request,request_type:0
msgid "Sale Order"
msgstr "Commande de vente"
msgstr "Bon de commande"

#. module: joint_buying_base
#: model:ir.model.fields,field_description:joint_buying_base.field_joint_buying_tour_line__sequence
Expand Down Expand Up @@ -1301,6 +1313,7 @@ msgid "Summary"
msgstr "Résumé"

#. module: joint_buying_base
#: model:ir.model.fields,field_description:joint_buying_base.field_joint_buying_transport_request__supplier_id
#: model_terms:ir.ui.view,arch_db:joint_buying_base.view_res_partner_form
msgid "Supplier"
msgstr "Fournisseur"
Expand Down Expand Up @@ -1368,12 +1381,6 @@ msgstr "A calculer"
msgid "Today"
msgstr "Aujourd'hui"

#. module: joint_buying_base
#: code:addons/joint_buying_base/models/joint_buying_tour.py:163
#, python-format
msgid "Toll"
msgstr "Péage"

#. module: joint_buying_base
#: model:ir.model.fields,field_description:joint_buying_base.field_joint_buying_tour__toll_cost
msgid "Toll Cost"
Expand Down Expand Up @@ -1468,6 +1475,7 @@ msgstr "Texte d'arbre"

#. module: joint_buying_base
#: model:ir.model.fields,field_description:joint_buying_base.field_joint_buying_tour__type_id
#: model_terms:ir.ui.view,arch_db:joint_buying_base.view_joint_buying_tour_search
msgid "Type"
msgstr ""

Expand Down Expand Up @@ -1529,12 +1537,6 @@ msgstr "Utilisateurs"
msgid "Vegetable"
msgstr "Légumes"

#. module: joint_buying_base
#: code:addons/joint_buying_base/models/joint_buying_tour.py:162
#, python-format
msgid "Vehicle"
msgstr "Véhicule"

#. module: joint_buying_base
#: model:ir.model.fields,field_description:joint_buying_base.field_joint_buying_tour__vehicle_cost
#: model:ir.model.fields,field_description:joint_buying_base.field_joint_buying_tour_line__vehicle_cost
Expand Down Expand Up @@ -1573,7 +1575,7 @@ msgid "Wizard"
msgstr "Assistant"

#. module: joint_buying_base
#: code:addons/joint_buying_base/models/res_partner.py:155
#: code:addons/joint_buying_base/models/res_partner.py:145
#, python-format
msgid "You can not create a customer joint buying partner. You should ask to you ERP manager to do it via the creation of a company."
msgstr "Vous ne pouvez pas créer un client pour les commandes groupées. Vous devez demander au responsable de l'ERP de le faire, via la création d'une société."
Expand All @@ -1597,13 +1599,13 @@ msgid "You can not create this item. Please ask to the logistic Manager."
msgstr "Vous ne pouvez pas créer cet élément. Veuillez demander au responsable logistique."

#. module: joint_buying_base
#: code:addons/joint_buying_base/models/res_partner.py:265
#: code:addons/joint_buying_base/models/res_partner.py:255
#, python-format
msgid "You can not delete this partner because it is related to a company for joint Buyings. Please archive it."
msgstr "Vous ne pouvez pas supprimer ce contact, car il est lié à une société pour les commandes groupées. Vous pouvez simplement l'archiver."

#. module: joint_buying_base
#: code:addons/joint_buying_base/models/res_partner.py:140
#: code:addons/joint_buying_base/models/res_partner.py:130
#, python-format
msgid "You can not link the supplier %s to the Joint Buying partner %s because you have other suppliers that are still related to him : \n"
"\n"
Expand Down Expand Up @@ -1631,7 +1633,7 @@ msgid "You can not update this item because you are not responsible for it"
msgstr "Vous ne pouvez pas mettre à jour cet élément, car vous n'en êtes pas responsable."

#. module: joint_buying_base
#: code:addons/joint_buying_base/models/res_partner.py:254
#: code:addons/joint_buying_base/models/res_partner.py:244
#, python-format
msgid "You can not update this partner this way you should ask to your ERP Manager to update this field via the related company."
msgstr "Vous ne pouvez pas mettre à jour ce contact de cette manière, vous devez demander au responsable de votre ERP de mettre à jour les données, via la société associée."
Expand Down
15 changes: 15 additions & 0 deletions joint_buying_base/migrations/12.0.7.0.0/end-migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import logging

from openupgradelib import openupgrade

_logger = logging.getLogger(__name__)


@openupgrade.migrate()
def migrate(env, version):
TransportRequest = env["joint.buying.transport.request"]
requests = TransportRequest.search([])
_logger.info(f"Recompute Supplier field for {len(requests)} transport requests ...")
requests._compute_supplier_id()
_logger.info(f"Recompute Request Type for {len(requests)} transport requests ...")
requests._compute_request_type()
Loading

0 comments on commit 8c8df7c

Please sign in to comment.