This question has been flagged
1 Reply
2868 Views

i have 2 classes in my module ;

class A:

'b_id' : fields.many2one('B'),

class B :

_rec_name = "'name'

'name' : fields.char('name'),

'counter': fields.integer('counter')

what i need is that whenever i select an object of a (from b_id) , to increment its counter.

any help please ??

Avatar
Discard
Best Answer

you mean you want to know how many A objects are linked to your B object?

Avatar
Discard
Author

i want to know each object of A is how many times linked to B ; example: a1--->2 times, a2--->4 times,....

I don't understand. With your current classes, A can only be linked one time as the b_id is many2one.