How to go through a one2many field that contains text and the information obtained put it in a field that shows all the information together, that is, if the one2many field contains two lines, the information about the new field remains text1, text2. How can I achieve this, I thank you your answers?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Comptabilité
- Inventaire
- PoS
- Project
- MRP
Cette question a été signalée
Can you help me with a little more information?
I understand the following
The first field many2one contains the name "Josh", the second field many2one contains his age "25", requires that in the new field created you record, "Josh, 25" ??.
or exactly what do you require?
Yes, that's exactly what I want to do
To achieve what is required, it is necessary to have a calculated field, and configure it with the following code:
for record in self:
variable1 = record.campo_many2one_1.name if record.campo_many2one_1 else ''
variable2 = record.campo_many2one_2.name if record.campo_many2one_2 else ''
record['campo_concatenado'] = variable1 + ' - ' + variable2
Remember to replace variable1 & variable2 with a different name and also replace with the field names many2one and the calculated field
I attach a screenshot and a video of how what you require is working, within the code there is a "-" that can be modified, or if you like, tell me what the fields you have are called and I will gladly help you create the custom code you require
Screenshot:
https://ibb.co/m5PtcJN
Video:
https://watch.screencastify.com/v/VXgPf7pFSJklJxW3SoyV
Vous appréciez la discussion ? Ne vous contentez pas de lire, rejoignez-nous !
Créez un compte dès aujourd'hui pour profiter de fonctionnalités exclusives et échanger avec notre formidable communauté !
S'inscrirePublications associées | Réponses | Vues | Activité | |
---|---|---|---|---|
|
1
juin 22
|
2385 | ||
|
1
juin 22
|
1518 | ||
|
1
avr. 24
|
1284 | ||
|
1
mai 23
|
1917 | ||
|
0
sept. 22
|
1916 |