Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
8254 Lượt xem

I need additional types for res.partner model.

By default it have 4  (contact, invoice, delivery, other).

Client needs add 2 (additional_phone, additional_mail).

In inherited module I redefine this field:

type = fields.Selection(
[('contact', 'Contact'),
('addmail','Additional Mail'),
('addphone','Additional Phone'),
('invoice', 'Invoice address'),
('delivery', 'Shipping address'),
('other', 'Other address')], 'Address Type',

help="Used to select automatically the right address according to the context in sales and purchases documents."),
during module installation there was no errors. But when trying open contact form or list it crushes to Internal Server Error.

Log:  2017-03-30 11:48:18,963 10732 INFO A7test openerp.addons.base.ir.ir_ui_view: Field `type` does not exist

Error context:

View `res.partner.kanban`

[view_id: 125, xml_id: base.res_partner_kanban_view, model: res.partner, parent_id: n/a]

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi Anar

You could do it like this:

type = fields.Selection(selection_add=[('addmail','Additional Mail'),('addphone','Additional Phone')])


Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
4
thg 2 25
2740
1
thg 8 24
2245
2
thg 11 24
3400
3
thg 10 23
14926
2
thg 2 23
2521