def _compute_partner_biography(self): for track in self: if not track.partner_biography: track.partner_biography = track.partner_id.website_description elif track.partner_id and is_html_empty(track.partner_biography) and \ not is_html_empty(track.partner_id.website_description): track.partner_biography = track.partner_id.website_description
def _compute_invoice_terms_html(self): term_template = self.env.ref("account.account_default_terms_and_conditions", False) if not term_template: return for company in self.filtered(lambda company: is_html_empty(company.invoice_terms_html) and company.terms_type == 'html'): company.invoice_terms_html = term_template._render({'company_name': company.name, 'company_country': company.country_id.name}, engine='ir.qweb')
def _compute_invoice_terms_html(self): for company in self.filtered(lambda company: is_html_empty(company.invoice_terms_html) and company.terms_type == 'html'): html = self.env['ir.qweb']._render('account.account_default_terms_and_conditions', {'company_name': company.name, 'company_country': company.country_id.name}, raise_if_not_found=False) if html: company.invoice_terms_html = html
def action_lost_reason_apply(self): self.ensure_one() leads = self.env['crm.lead'].browse(self.env.context.get('active_ids')) if not is_html_empty(self.lost_feedback): leads._track_set_log_message( '<div style="margin-bottom: 4px;"><p>%s:</p>%s<br /></div>' % (_('Lost Comment'), self.lost_feedback)) res = leads.action_set_lost(lost_reason_id=self.lost_reason_id.id) return res