콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
3 답글
3512 화면

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
3237
2
3월 24
2077
0
12월 22
1687
2
11월 19
7005
1
5월 17
3395