Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1749 Weergaven

Now I have records like fields 1 & 2,

and want record auto fill like field3

field1field2field3
d111
d122-1
d122-2
d133
d211-1
d211-2
d222
I try with count function in modle, 

but meet some difficulty

Here is my try

    @api.depends("field1", "field2")
def _compute_field3(self):
for rec in self:
if self.count(rec.field2) > 1:
rec.field3 = rec.field2 + "-" + #the subscript
# Maybe somthing like this
else:
rec.field3 = rec.field2
Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
1
jun. 25
15560
3
apr. 25
5824
2
jul. 24
3888
1
jan. 24
1923
1
jul. 22
2349