Skip to content

Commit

Permalink
[FIX] stock: dropshiping delivery slip in client's language
Browse files Browse the repository at this point in the history
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#122789

X-original-commit: 2604caa
Signed-off-by: Adrien Widart (awt) <awt@odoo.com>
Signed-off-by: Walid Hanniche (waha) <waha@odoo.com>
  • Loading branch information
HANNICHE-Walid committed May 27, 2023
1 parent c31af99 commit af07642
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions addons/stock/models/stock_picking.py
Original file line number Diff line number Diff line change
Expand Up @@ -1602,3 +1602,6 @@ def _attach_sign(self):
body=message,
)
return True

def _get_report_lang(self):
return self.move_ids and self.move_ids[0].partner_id.lang or self.partner_id.lang or self.env.lang
4 changes: 2 additions & 2 deletions addons/stock/report/report_deliveryslip.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<template id="report_delivery_document">
<t t-call="web.html_container">
<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_ids and o.move_ids[0].partner_id) or False"/>

<t t-set="address">
Expand Down Expand Up @@ -273,7 +273,7 @@

<template id="report_deliveryslip">
<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>
</template>
</odoo>

0 comments on commit af07642

Please sign in to comment.