[CLN] website_sale_digital: account_invoice.py
* Right file name * Right class name * privatize method not meant to be called in rpc Part-of: odoo/odoo#116026
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
import base64
|
||||
@@ -16,7 +15,7 @@ class WebsiteSaleDigital(CustomerPortal):
|
||||
|
||||
@http.route()
|
||||
def portal_order_page(self, order_id=None, **post):
|
||||
response = super(WebsiteSaleDigital, self).portal_order_page(order_id=order_id, **post)
|
||||
response = super().portal_order_page(order_id=order_id, **post)
|
||||
if not 'sale_order' in response.qcontext:
|
||||
return response
|
||||
order = response.qcontext['sale_order']
|
||||
@@ -68,7 +67,7 @@ class WebsiteSaleDigital(CustomerPortal):
|
||||
# Check if the user has bought the associated product
|
||||
res_model = attachment['res_model']
|
||||
res_id = attachment['res_id']
|
||||
purchased_products = request.env['account.move.line'].get_digital_purchases()
|
||||
purchased_products = request.env['account.move.line']._get_digital_purchases()
|
||||
|
||||
if res_model == 'product.product':
|
||||
if res_id not in purchased_products:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from . import account_invoice
|
||||
from . import account_move_line
|
||||
from . import ir_attachment
|
||||
from . import product_product
|
||||
from . import product_template
|
||||
|
||||
+2
-4
@@ -1,14 +1,12 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import models
|
||||
|
||||
|
||||
class AccountInvoiceLine(models.Model):
|
||||
|
||||
class AccountMoveLine(models.Model):
|
||||
_inherit = ['account.move.line']
|
||||
|
||||
def get_digital_purchases(self):
|
||||
def _get_digital_purchases(self):
|
||||
partner = self.env.user.partner_id
|
||||
|
||||
# Get paid invoices
|
||||
Reference in New Issue
Block a user