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

Hello All,

I want to add one field in side the sale order module by custom module how can I add?

Thanks in advance.

아바타
취소
베스트 답변

Prince,

Here you go!

#class file yourfile.py

#Example With APi.

from openerp import models, fields, api,

class sale_order(models.Model)

    _inherit = 'sale.order'

    your_field = fields.Char("Your Field Label")

    #instead Char you apply any type of field whatever you need from this field list you can use

    #Char,Integer,Date,Float,Many2one,One2many,Many2many,Related etc...

    #First later of each field type must be capital in odoo  v8. if you follow the v8 codding standard,

#Example Without Api (With v7 codding standard)

from openerp.osv import osv, fields

class sale_order(osv.Model)

    _inherit = 'sale.order'

    _columns = {

    'your_field':fields.char("Label of your Field", size=64),

}

#Now in xml file you can add this field by using xpath concept by inherting exsisting view.

Let me know if you face any difficuties on this.

Regards,

Anil.

 

 

 

 

아바타
취소
베스트 답변

just create a class in your customer module, and inside that class you inherit that sales order model. Then use of xpath create field in customer xml file.

아바타
취소
관련 게시물 답글 화면 활동
1
2월 24
2294
1
7월 18
6580
1
5월 16
3154
1
3월 16
5717
0
5월 15
6911