Skip to content
This repository has been archived by the owner on Apr 28, 2022. It is now read-only.

Commit

Permalink
[FIX] Sudo on attribute values related products for price calculation…
Browse files Browse the repository at this point in the history
… and image update
  • Loading branch information
PCatinean committed Mar 21, 2017
1 parent a0ff8d8 commit ac44da3
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion product_configurator/models/product.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def _get_option_values(self, value_ids, pricelist):
price set to them"""
value_obj = self.env['product.attribute.value'].with_context({
'pricelist': pricelist.id})
values = value_obj.browse(value_ids).filtered(
values = value_obj.sudo().browse(value_ids).filtered(
lambda x: x.product_id.price)
return values

Expand Down
2 changes: 1 addition & 1 deletion product_configurator/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# -*- coding: utf-8 -*-

from . import test_configuration_rules
from . import test_configuration_rules
6 changes: 0 additions & 6 deletions product_configurator/tests/test_configuration_rules.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
# -*- coding: utf-8 -*-
###########################################################
# © 2016 Pledra (<http://www.pledra.com/>) #
# Author: Paul Cătinean #
# Proprietary license, usage and/or distribution strictly #
# prohibited in absence of signed license agreement #
###########################################################

from odoo.tests.common import TransactionCase

Expand Down
4 changes: 2 additions & 2 deletions website_product_configurator/data/config_layout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -175,14 +175,14 @@
</input>
</label>
<div class="form-control col-xs-12" style="height: auto;">
<img class="img-rounded img-responsive img-center mt8" t-att-src="website.image_url(value.product_id, 'image') if value.product_id.image else '/web/static/src/img/placeholder.png'"/>
<img class="img-rounded img-responsive img-center mt8" t-att-src="('data:image/*;base64,' + value.product_id.sudo().image) if value.product_id.sudo().image else '/web/static/src/img/placeholder.png'"/>
<!-- TODO use currency from pricelist -->
<!-- TODO have tiles be the same height without forcing height -->
<div class="mt8">
<strong t-field="value.name"/>
</div>

<span t-field="value.product_id.lst_price"
<span t-field="value.product_id.sudo().lst_price"
t-options='{
"widget": "monetary",
"display_currency": "user_id.partner_id.property_product_pricelist.currency_id"}'/>
Expand Down

0 comments on commit ac44da3

Please sign in to comment.