[IMP] Allow to attach from compose wizard
By default we checked for an empty data dict in _get_report_values however the mail template sends a file type and editor key by default. We now check if the required company_id is in the dictionary. We also support supplying force_company in context for setting the company for auto generated emails. [UPD] README.rst [UPD] Update partner_statement.pot Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: account-financial-reporting-12.0/account-financial-reporting-12.0-partner_statement Translate-URL: https://translation.odoo-community.org/projects/account-financial-reporting-12-0/account-financial-reporting-12-0-partner_statement/
This commit is contained in:
committed by
Miquel Raïch
parent
83cde31664
commit
20d99a95ae
@@ -10,10 +10,17 @@ class StatementCommon(models.AbstractModel):
|
||||
_name = 'statement.common.wizard'
|
||||
_description = 'Statement Reports Common Wizard'
|
||||
|
||||
def _get_company(self):
|
||||
return (
|
||||
self.env['res.company'].browse(
|
||||
self.env.context.get('force_company')) or
|
||||
self.env.user.company_id
|
||||
)
|
||||
|
||||
name = fields.Char()
|
||||
company_id = fields.Many2one(
|
||||
comodel_name='res.company',
|
||||
default=lambda self: self.env.user.company_id,
|
||||
default=_get_company,
|
||||
string='Company',
|
||||
required=True,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user