Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odpovědi
2146 Zobrazení

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
Zrušit
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.



Nejlepší odpověď

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
Zrušit
Autor Nejlepší odpověď

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
3
čvn 23
2203
1
čvn 23
2618
0
dub 21
1501
3
úno 21
17507
4
říj 20
6590