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.

0

[SOLVED] [V8] Is it possible to concatenate fields after filter them?

By
FEDERICO LEONI
on 5/8/15, 7:52 PM 512 views


I'm creating a new view for a personalized POS module for my restaurant. It's a specific view for kitchen, already filtered to show just kitchen's related items of a POS order.

Now I would like to show a particular series of product with the name starting with "#" as a unique in a column populated by a new field side by side with the "standard" products. In fact I'm speaking of a set of instructions coded as products to be available on POS and since I was unable to edit the js and css of the pos for suit my needs I decided to create kitchen instructions as a product (service). In my POS there are 3 categories that are not products but instructions (ADD, SUBTRACT, ADDITIONAL NOTE).

What I would like to archive is a view like:

Product 
Note
Quantity
[1007] Pom. Secchi
# + Búfala # - Mussarela
1
[2002] Nutella banana
# + Mussarela
1
[3002] Fanta Uva 350ml

1

The original view is: 

Product
Category
Quantity
[1007] Pom. Secchi
Piadine
1
# + Búfala
Extra-Rid
1
# - Mussarela
Extra-Rid
1
[2002] Nutella banana
Piadine Dolci
1
# + Mussarela
Extra-Rid
1
[3002] Fanta Uva 350ml
Bebida
1

I know I can group field values in a unique, new field with fields.function(_get_concatenate_values) but my problem is how to filter the products before write them respecting the id sequence for the new view. Other than this I need to select just the "#" product between two internal code starting with "[code]" and this is the hard thing to do.

Someone could gently drive me to the right direction?


EDIT:

I can see added pictures on my post during creation/edit but not when I save the post. Is because I don't have enough Karma? 

0
FEDERICO LEONI
On 6/17/15, 12:35 PM

Solved creating a new module and using directly python and psycopg2. Was complicated but works!

Why don't you open source this somewhere on Github for others to learn from Federico? :D I think quite some people would like that.

Yenthe
on 6/30/15, 8:40 AM

Nah Yenthe, it's not a "quality job" for now. Is just a bunch of .py and sql query mixed with xml. And all need to be optimized. There are so many things still not working as I would. Beside, the module is incomplete and needs some manual works to have it done for example I was unable to build the server actions I need on my templates.xml. Lack of documentation, again. But I'll think on it when I'll have it completely working on V9. Probably I'll need some help from the outside and Git could be a good solution for a alpha/beta test.

FEDERICO LEONI
on 7/2/15, 1:12 PM

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: 5/8/15, 7:52 PM
Seen: 512 times
Last updated: 6/17/15, 12:36 PM