diff options
| author | Nicolas (vin) <vin@odoo.com> | 2020-11-03 11:10:45 +0000 |
|---|---|---|
| committer | Nicolas (vin) <vin@odoo.com> | 2020-11-03 11:10:45 +0000 |
| commit | 3df9da9a712e719812b14085a4020e8a78db656a (patch) | |
| tree | e4c3f31799edfbf6575dd2ebbce35926b39a870f /addons/account/wizard | |
| parent | 1b273d4c11e3e8d8583de302b71b2522a71f4d1d (diff) | |
[IMP] account: Fix the context when 'uploading' the sample bill
During the accounting tour, users are invited to upload one of their
bill, send one by mail, or use a sample bill.
For the last one, the returned action which opens a list view with the
new move does not have the correct context, which makes clicking on
'create' launch the creation of a journal entry and not a vendor bill.
This will make sure the context is correctly set in this case.
task id #2368810
closes odoo/odoo#61247
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
Diffstat (limited to 'addons/account/wizard')
| -rw-r--r-- | addons/account/wizard/account_tour_upload_bill.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/addons/account/wizard/account_tour_upload_bill.py b/addons/account/wizard/account_tour_upload_bill.py index 3611f419625..fdfac251cbc 100644 --- a/addons/account/wizard/account_tour_upload_bill.py +++ b/addons/account/wizard/account_tour_upload_bill.py @@ -40,6 +40,8 @@ class AccountTourUploadBill(models.TransientModel): return def _action_list_view_bill(self, bill_ids=[]): + context = dict(self._context) + context['default_move_type'] = 'in_invoice' return { 'name': _('Generated Documents'), 'domain': [('id', 'in', bill_ids)], @@ -47,7 +49,7 @@ class AccountTourUploadBill(models.TransientModel): 'res_model': 'account.move', 'views': [[False, "tree"], [False, "form"]], 'type': 'ir.actions.act_window', - 'context': self._context + 'context': context } def apply(self): |
