0
(10)이 product.product
모델을 상속 Odoo에서 필드 정의를 무시하고 계산 필드로 설정하기 위해 기존의 standard_price
필드 정의를 대체하지 않습니다상속 모델은 내가 다음 코드 Odoo 10 모듈을 만든
class ProductProduct(models.Model):
_inherit = 'product.product'
standard_price = fields.Float(
'Cost', company_dependent=True,
digits=dp.get_precision('Product Price'),
groups="base.group_user",
compute='_compute_set_standard_price')
def _compute_set_standard_price(self):
.....
# calculation for the value
.....
self.standard_price = 121 #this value is an example
필드 정의를 계산 필드로 대체했지만 standard_price
필드가 0으로 설정되고 계산 방법을 트리거하지 않기 때문에 standard_price
이 121로 설정됩니다. Odoo v8의이 코드는 정상적으로 작동합니다.
상속 된 모델의 기존 필드 difinition을 재정의하는 방법은 무엇입니까?