summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src
diff options
context:
space:
mode:
authorNans Lefebvre <len@odoo.com>2019-09-11 12:15:00 +0000
committerfw-bot <otis@odoo.com>2019-09-17 11:36:57 +0000
commit66e1049d85d486fc9bba3537f60b6362db6eceaa (patch)
tree19d39f999651fd97f86a2acded06cec34e31252e /addons/web_editor/static/src
parentd82db0a6bd3471018b24be9064298a28c3209212 (diff)
[FIX] sale: get correct journal to create corresponding invoice
Be in company C1. Create the invoice I for a SO in company C2. The invoice is created on the default account.journal for C1. This happens when e.g. C2 is a child company of C1. Then I is accessible from C1, but not from C2 as reading the journal violates the multi-company record rules. Note that if company_id == False, then self.env['account.invoice'].with_context(company_id=company_id) .default_get(['journal_id'])['journal_id'] returns False, and in that case, it would raise below. To keep with the existing behaviour, we put a fallback on self.env.user.company_id.id which means that the values we pass are: 'company_id': False, 'journal_id': J for some J in company C which is flaky, but won't trigger any extra errors. opw 2068291 closes odoo/odoo#37002 X-original-commit: 427280d9760a71e6ca2961bcf4a2f9f157e6dddd Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
Diffstat (limited to 'addons/web_editor/static/src')
0 files changed, 0 insertions, 0 deletions