Skip to content
Snippets Groups Projects
Commit ef4bfc56 authored by Walid's avatar Walid
Browse files

[FIX] stock: dropshiping delivery slip in client's language


Steps to reprodue:
- Create a dropshipped product
- Sell the product to a client with a different language set
- Print the delivery slip

Bug:
delivery slip is currently being printed in the vendor's language

Fix:
Print the delivery slip in the client language when possible

opw-3193015

closes odoo/odoo#122706

X-original-commit: 832b4145
Signed-off-by: default avatarAdrien Widart (awt) <awt@odoo.com>
Signed-off-by: default avatarWalid Hanniche (waha) <waha@odoo.com>
parent 5fb84ba5
No related branches found
No related tags found
No related merge requests found
...@@ -1531,3 +1531,6 @@ class Picking(models.Model): ...@@ -1531,3 +1531,6 @@ class Picking(models.Model):
body=message, body=message,
) )
return True return True
def _get_report_lang(self):
return self.move_lines and self.move_lines[0].partner_id.lang or self.partner_id.lang or self.env.lang
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<template id="report_delivery_document"> <template id="report_delivery_document">
<t t-call="web.html_container"> <t t-call="web.html_container">
<t t-call="web.external_layout"> <t t-call="web.external_layout">
<t t-set="o" t-value="o.with_context(lang=o.partner_id.lang or o.env.lang)" /> <t t-set="o" t-value="o.with_context(lang=o._get_report_lang())" />
<t t-set="partner" t-value="o.partner_id or (o.move_lines and o.move_lines[0].partner_id) or False"/> <t t-set="partner" t-value="o.partner_id or (o.move_lines and o.move_lines[0].partner_id) or False"/>
<t t-set="address"> <t t-set="address">
...@@ -272,7 +272,7 @@ ...@@ -272,7 +272,7 @@
<template id="report_deliveryslip"> <template id="report_deliveryslip">
<t t-foreach="docs" t-as="o"> <t t-foreach="docs" t-as="o">
<t t-call="stock.report_delivery_document" t-lang="o.partner_id.lang or o.env.lang"/> <t t-call="stock.report_delivery_document" t-lang="o._get_report_lang()"/>
</t> </t>
</template> </template>
</odoo> </odoo>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment