[FIX] website_sale_digital: get list of digital purchases by a user
The issue occurs when a user tries to download an attachment for a SO. So, when trying to retrieve digital purchases from the `account.move.line` object in `download_attachment` method because there is a difference in the method call and method definition. see: https://github.com/odoo/odoo/blob/7cd397b81f68ecac2fda5119cae1e1ce4dbfa8cf/addons/website_sale_digital/models/account_move_line.py#L9-L10 https://github.com/odoo/odoo/blob/7cd397b81f68ecac2fda5119cae1e1ce4dbfa8cf/addons/website_sale_digital/controllers/main.py#L60 sentry-4267581957 closes odoo/odoo#126318 X-original-commit: f6b585a182b0ad7d0a115b295481ef2d07f54169 Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
This commit is contained in:
@@ -57,7 +57,7 @@ class WebsiteSaleDigital(CustomerPortal):
|
||||
# Check if access can be granted through their purchases.
|
||||
res_model = attachment['res_model']
|
||||
res_id = attachment['res_id']
|
||||
digital_purchases = request.env['account.move.line'].get_digital_purchases()
|
||||
digital_purchases = request.env['account.move.line']._get_digital_purchases()
|
||||
if res_model == 'product.product':
|
||||
purchased_product_ids = digital_purchases
|
||||
elif res_model == 'product.template':
|
||||
|
||||
Reference in New Issue
Block a user