저는 Odoo v8.0에서 beginer입니다. 모듈 "판매"에 사용자 정의 필드를 추가하고 싶습니다. 오류는 "type_customer
필드가 존재하지 않습니다"Odoo 8 : 모든 모듈에 사용자 정의 필드 추가
내 코드는 여기에 있습니다.
__init__.py
:
from . import modify_type_quotation
__openerp__.py
:
{
'name' : "Modify report template",
'description' : """Modify report template for Quotation/Sale report""",
'author' : "Nhu Van Tran",
'category' : "Tools",
'depends' : ['sale'],
'data' : ['modify_create_quotation.xml'],
'demo' : [],
'installable' : True,
}
modify_type_quotation.py
:
# -*- coding: utf-8 -*-
from openerp import models, fields
class modify_print_content(models.Model):
_inherit = "sale.order"
_description = "Modify Print Content"
type_customer = fields.selection([
('Commercial', 'Commercial Customer'),
('Residential', 'Risidential Customer'),
], string = "Type of Customer", help = "Type of Customer", default = "Commercial", required = True)
및 modify_create_quotation.xml
: