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

When I set foo to 0, this error pops up:

The operation cannot be completed:
- Create/update: a mandatory field is not set.
- Delete: another model requires the record being deleted. If possible, archive it instead.

Model: ir.config_parameter (ir.config_parameter), Field: Value (value)

Code:

foo = fields.Integer()

@api.multi
def set_values(self):
  ir_config_param_obj = self.env['ir.config_parameter'].sudo()
  ir_config_param_obj.set_param('my_module.foo', self.foo)

Why is this and how can I set the value to 0?

아바타
취소
작성자 베스트 답변

I solved it by using 'ir.values' instead of 'ir.config_parameter'

아바타
취소
베스트 답변

I hope it will help you to understand https://www.odoo.com/forum/help-1/question/how-to-use-the-default-settings-value-in-custom-module-field-128543

아바타
취소
관련 게시물 답글 화면 활동
4
2월 17
14162
2
4월 25
3597
5
3월 25
19202
1
6월 24
1911
1
5월 24
1933