Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
2 Odpowiedzi
2186 Widoki

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)]




Awatar
Odrzuć
Autor

Hi still docent work after trying the guide

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



Najlepsza odpowiedź

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

Awatar
Odrzuć
Autor Najlepsza odpowiedź

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)]



Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
3
cze 23
2227
1
cze 23
2658
0
kwi 21
1541
3
lut 21
17569
4
paź 20
6654