コンテンツへスキップ
メニュー
この質問にフラグが付けられました
3 返信
3358 ビュー

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 :)

アバター
破棄
最善の回答

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

アバター
破棄
著作者

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

最善の回答

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

アバター
破棄
関連投稿 返信 ビュー 活動
1
10月 24
1611
2
3月 24
1930
0
12月 22
1559
2
11月 19
6803
1
5月 17
3263