Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
1 Antworten
1630 Ansichten

In manufacturing order, there is a line item (move_raw_ids), it has to consume field and reserved field. I need to compare those two values are same respectively for every lines created. If any one of those lines are not equal, then i need to pass string to a field i created. As I'm a fresher, i do not know where these values are updated while clicking check availability button.

Any help is appreciatable!


Avatar
Verwerfen
Beste Antwort

Hi,

You can compare the values in both fields easily bu iterating the one2many field move_raw_ids over a for loop and if any mismatch happen, you can perform your operation.

Sample:

for line in self.move_raw_ids:

    if line.field_1 != line.field_2:

        #do your operation

You can reduce above lines using any operator in python.


If you are new to odoo development, have a look at this.

Odoo 14 Development: 

https://www.youtube.com/watch?v=I8FNdellz3Y&list=PLqRRLx0cl0homY1elJbSoWfeQbRKJ-oPO&index=2


Thanks

Avatar
Verwerfen
Autor

Thanks @niyas for helping on moment. Sorry for late reply.

Verknüpfte Beiträge Antworten Ansichten Aktivität
1
Juli 25
2521
2
Juli 25
7972
2
Juli 25
4406
2
Juli 25
4124
2
Juni 25
2708