Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[product_usability][10.0]: wrong price history link (fixed on 12.0) #96

Open
rvalyi opened this issue Jun 19, 2019 · 1 comment
Open

Comments

@rvalyi
Copy link
Member

rvalyi commented Jun 19, 2019

when you click on the "Show History" button of the standard price, you should see the several price history items related to the related product variant.

The problem is the implementation filter the wrong items, the ones with the ids of the related product variants (usually only one) while it should be the ones which match the product variants through their product_id key.

class ProductTemplate(models.Model):
    _inherit = 'product.template'

[...]

    def show_product_price_history(self):
        self.ensure_one()
        products = self.env['product.product'].search(
            [('product_tmpl_id', '=', self._context['active_id'])])
        action = self.env['ir.actions.act_window'].for_xml_id(
            'product_usability', 'product_price_history_action')
        action.update({
            'domain': "[('id', 'in', %s)]" % products.ids,
        })
        return action

indeed the domain should be "[('product_id', 'in', %s)]" % products.ids

rvalyi added a commit that referenced this issue Jun 19, 2019
bealdav added a commit that referenced this issue Jun 20, 2019
@bealdav bealdav closed this as completed Jun 20, 2019
@rvalyi rvalyi reopened this Jun 20, 2019
@rvalyi
Copy link
Member Author

rvalyi commented Jun 20, 2019

Hello, I'll leave the issue open with a modified title as we still have it on v10. Hopefully I fix it today.

@rvalyi rvalyi changed the title [product_usability][10.0][12.0]: wrong price history link [product_usability][10.0]: wrong price history link (fixed on 12.0) Jun 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants