Skip to content

Commit

Permalink
Merge pull request #737 from Som-Energia/FIX_ccpp_lead_lang
Browse files Browse the repository at this point in the history
fix ccpp lead lang
  • Loading branch information
destanyol authored Oct 15, 2024
2 parents 8d7e5a7 + b01c7f2 commit 41287af
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions som_leads_polissa/giscedata_crm_lead.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def contract_pdf(self, cursor, uid, ids, context=None):
context["lead"] = True

lead = self.browse(cursor, uid, ids[0])
context["lang"] = lead.lang

preus_provisional_energia = {
"P1": lead.preu_fix_energia_p1,
Expand Down
4 changes: 4 additions & 0 deletions som_polissa_condicions_generals/models/report_backend_ccpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ def get_lang(self, cursor, uid, record_id, context=None):

pol_obj = self.pool.get("giscedata.polissa")
lang = pol_obj.browse(cursor, uid, record_id, context=context).titular.lang
if context.get("lang"):
lang = context.get("lang")
return lang

def get_pas01(self, cursor, uid, pol, context=None):
Expand Down Expand Up @@ -106,6 +108,8 @@ def get_titular_data(self, cursor, uid, pol, pas01, context=None):
data_firma = datetime.today()
res['sign_date'] = localize_period(data_firma, pol.titular.lang)
res['lang'] = pol.titular.lang
if context.get("lang"):
res['lang'] = context.get("lang")

return res

Expand Down

0 comments on commit 41287af

Please sign in to comment.