Odoo 10Odoo는 다른 모듈의 필드를 검색합니다.
제품에서 판매 주문으로 필드를 복사하려고합니다. 제품의 필드는 default_code입니다. 판매 단위 모듈의 코드 복사가 이미 단가와 세금 등을 받고 있기 때문에 시도했지만 작동하지 않습니다.
from odoo import api, models, fields
class myfieldsinsaleorder(models.Model):
_inherit = 'sale.order.line'
squaremtr = fields.Float("SQ Meter Required")
boxes = fields.Float("Suggested Boxes")
squarebox = fields.Char("Meters Per Box")
@api.onchange('product_id', 'default_code', 'price_unit', 'product_uom', 'product_uom_qty', 'tax_id')
def _onchange_discount(self):
self.discount = 0.0
self.squarebox = 'default_code'