Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
My pos.category table contains a field 'available_for_customer'.
"""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)
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?
About This Community
This platform 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.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 3/18/16, 11:55 AM|
|Seen: 692 times|
|Last updated: 3/23/16, 9:45 AM|