Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

1

Update point of sale displayed values

By
Maarten Wijnants
on 3/18/16, 11:55 AM 288 views

My pos.category table contains a field 'available_for_customer'.

class schakel_category_model(models.Model):

"""The product category model."""

_inherit = 'pos.category'

available_for_customer = fields.Integer('Available', help="The available quantity for the current customer.", default=0)

During a point of sale session, every time the customer is changed, this 'available_for_customer' field is recalculated. 

I show the value of this field in the ProductCategoriesWidget after the categories name.

<templates id="template" xml:space="preserve">

<t t-extend="CategorySimpleButton"> <!-- static/src/xml/pos.xml 190 -->

<!-- Show the available qty next to the category name in the category selector -->

<t t-jquery=".category-simple-button" t-operation="append">

(<t t-esc="category.available_for_customer" /> available for you)

</t>

</t>

</templates>

Everything seems to work, but when I select a customer, the value that is shown is not updated and it always shows the value that is first loaded when the pos session is started. I can however use the correct value to prevent the user from buying too much, but the old value is still displayed.

Is there a way to reload the ProductCategoriesWidget, so the updated values are shown?

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 3/18/16, 11:55 AM
Seen: 288 times
Last updated: 3/23/16, 9:45 AM