İçereği Atla
Menü
Bu soru işaretlendi
2 Cevaplar
2191 Görünümler

Hi, I've been watching a lot of videos on youtube about how to make custom fields in the Edit view: Form tap.

but i was not able to make this. everybody i've watched was XML lines starting with "field ... " but not mine.

are somebody able to help me out with this?

I need to add an Attention field to the customer and a discount field


I've added the code found below:



{
'partner_id': parent.partner_id,
'quantity': product_uom_qty,
'pricelist': parent.pricelist_id,
'uom':product_uom,
'company_id': parent.company_id,
'default_description_sale': name,
'default_rent_ok': 1,
'rental_products': True,
}


['|', ('sale_ok', '=', True), ('rent_ok', '=', True),
'|', ('company_id', '=', False), ('company_id', '=', parent.company_id)]

{
'no_open': True,
'rent': True,
'temporal': True,
}


{
'partner_id': parent.partner_id,
'quantity': product_uom_qty,
'pricelist': parent.pricelist_id,
'uom':product_uom,
'company_id': parent.company_id,
'default_description_sale': name,
'default_rent_ok': 1,
'rental_products': True,
}


['|', ('sale_ok', '=', True), ('rent_ok', '=', True),
'|', ('company_id', '=', False), ('company_id', '=', parent.company_id)]

{
'no_open': True,
'rent': True,
'temporal': True,
}



['|', ('sale_ok', '=', True), ('rent_ok', '=', True),
'|', ('company_id', '=', False), ('company_id', '=', parent.company_id)]




Avatar
Vazgeç
Üretici

Hi still docent work after trying the guide

I was trying to post the failed code I get, but I am not allowed to.



En İyi Yanıt

Hi,

First of all sorry to say that, i dint understand the purpose of the added code in the question. To add a new field to any view, the process is as follows:

1. Add the new field to the model: either from code or UI. if you have studio just you need to drag and drop

2. Inherit the view and add the created field in the required position.


Detailed steps:  How to Add Custom Field From User Interface In Odoo


Thanks

Avatar
Vazgeç
Üretici En İyi Yanıt

Hi, I've tried to follow your guide, I do not have studio.

the issue with he guide is that there's no field called

I've sent the code from odoo below so you can see how it looks 


what I really want is a field where I can with the Rental order a name, so i can easlly see what the job is





{
'partner_id': parent.partner_id,
'quantity': product_uom_qty,
'pricelist': parent.pricelist_id,
'uom':product_uom,
'company_id': parent.company_id,
'default_lst_price': price_unit,
'default_description_sale': name,
'default_rent_ok': 1,
'rental_products': True,
}


['|', ('sale_ok', '=', True), ('rent_ok', '=', True),
'|', ('company_id', '=', False), ('company_id', '=', parent.company_id)]

{
'no_open': True,
'rent': True,
'temporal': True,
}


{
'partner_id': parent.partner_id,
'quantity': product_uom_qty,
'pricelist': parent.pricelist_id,
'uom':product_uom,
'company_id': parent.company_id,
'default_list_price': price_unit,
'default_description_sale': name,
'default_rent_ok': 1,
'rental_products': True,
}


['|', ('sale_ok', '=', True), ('rent_ok', '=', True),
'|', ('company_id', '=', False), ('company_id', '=', parent.company_id)]

{
'no_open': True,
'rent': True,
'temporal': True,
}



['|', ('sale_ok', '=', True), ('rent_ok', '=', True),
'|', ('company_id', '=', False), ('company_id', '=', parent.company_id)]



Avatar
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
3
Haz 23
2230
1
Haz 23
2662
0
Nis 21
1557
3
Şub 21
17583
4
Eki 20
6659