Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
2 Replies
2120 Tampilan

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
Buang
Penulis

Hi still docent work after trying the guide

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



Jawaban Terbai

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
Buang
Penulis Jawaban Terbai

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
Buang
Post Terkait Replies Tampilan Aktivitas
3
Jun 23
2192
1
Jun 23
2572
0
Apr 21
1483
3
Feb 21
17493
4
Okt 20
6576