Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
3 Odgovori
3325 Prikazi

I created a function that computes the internal reference I need so I need directions on how to add it to the internal reference field. Thanks in advance :)

Avatar
Opusti
Best Answer

Hi,

Inherit the corresponding model and add the compute to corresponding field.

class ModelName(models.Model):
_inherit = "model.name"

so_line = fields.Char(compute='_compute_function_name')

To do it from user interface, use automated actions in odoo. See a use case here: https://www.youtube.com/watch?v=Cz5eM5FDmTE&list=PLqRRLx0cl0hq6DeOzGlfHyjgBxjN5jW90&index=1


Thanks

Avatar
Opusti
Avtor

So if the id of the internal reference is "default_code" do I write it instead of "so_line"? Will that override it?

Best Answer

For an option that does not  require you to build a module, and leverages the SEQUENCE model, see https://www.odoo.com/forum/help-1/question/can-i-assign-a-custom-field-the-value-of-a-sequence-without-a-module-143107

Avatar
Opusti
Related Posts Odgovori Prikazi Aktivnost
1
okt. 24
1535
2
mar. 24
1883
0
dec. 22
1540
2
nov. 19
6747
1
maj 17
3245