Odoo Help

3

0
1 Jawaban
3
Avatar

Manish Kumar Bohra India

--Manish Kumar Bohra--
10998
| 6 5 10
Bikaner, India
--Manish Kumar Bohra--


Manish Kumar Bohra India
25/10/18 05.28

Solution for above problem

@api.multi
def action_optional_flag_add(self):
m1 = []
for m in self.wizard:
if m.services:
aa = (m.services.id, m.check_box)
m1.append(aa)
count_num = dict(Counter(m1))
res_allrecord = []
for val in count_num:
res_allrecord.append(val[0])
list_res = list(set(res_allrecord))

res_True = []
for val in count_num:
if val[1] != False:
res_True.append(val)
count = Counter([x for (x, y) in res_True])
rec5 = dict(count)

for list_val in list_res:
if list_val not in rec5:
rec5[list_val] = 0
output = dict(count)

for key, value in rec5.items():
if value > 1:
raise ValidationError("Please Select Atlease One Item from Flag")
if value == 0:
raise ValidationError("Please Select Atlease One Item from Flag")
Mengajukan pertanyaan
Keep Informed
1 Follower(s)
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