Skip to Content
Menu
This question has been flagged
2 Replies
2155 Views

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
Discard
Author

Hi still docent work after trying the guide

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



Best Answer

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
Discard
Author Best Answer

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
Discard
Related Posts Replies Views Activity
3
Jun 23
2207
1
Jun 23
2633
0
Apr 21
1527
3
Feb 21
17520
4
Oct 20
6600