[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:
Graeme Gellatly
2019-05-29 04:48:57 +12:00
committed by Miquel Raïch
parent 83cde31664
commit 20d99a95ae
15 changed files with 4881 additions and 1383 deletions

View File

@@ -138,9 +138,11 @@ class ActivityStatement(models.AbstractModel):
@api.multi
def _get_report_values(self, docids, data):
if not data:
data = {}
if 'company_id' not in data:
wiz = self.env["activity.statement.wizard"].with_context(
active_ids=docids, model="res.partner"
)
data = wiz.create({})._prepare_statement()
data.update(wiz.create({})._prepare_statement())
data['amount_field'] = 'amount'
return super()._get_report_values(docids, data)