I have created a new tab "Amenities" in the Inventory App under products. In the tab, various check boxes like Swimming Pool, Park, Parking, Gym etc have been added. Now I want to show the Amenities on the website, which are checked under amenities section.
How this task can be achieved? I am working odoo online, I dont have access to the code.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Kế toán
- Tồn kho
- PoS
- Project
- MRP
Câu hỏi này đã bị gắn cờ
Hi,
Create a Python model that extends the product.template
model to add your custom boolean field. You can do this by creating a
Python file in your custom module's directory, for example, models/product.py, and define your model like this:
from odoo import models, fields
class ProductTemplate(models.Model):
_inherit = 'product.template'
custom_boolean_field = fields.Boolean(string='Custom Boolean Field')
Create a View:
- Next, you should define a view to display the custom field on the product page. Create an XML file in your custom module's views directory, for example, views/product_template_view.xml, and add the following code:
<?xml version="1.0"?>
<openerp>
<data>
<record id="view_product_template_
<field name="name">product.template.
<field name="model">product.template<
<field name="inherit_id" ref="product.product_template_
<field name="arch" type="xml">
<field name="list_price" position="after">
<field name="custom_boolean_field"/>
</field>
</field>
</record>
</data>
</openerp>
Update the Manifest File:
Update the __manifest__.py file in your custom module's directory to specify the module's dependencies and other information.
Hope it helps
If you use enterprise version , use Odoo Studio to create (or) change fields, forms.
You can learn about studio here.
link - https://www.cybrosys.com/blog/odoo-studio-an-overview
Thanks.
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng kýBài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
---|---|---|---|---|
|
2
thg 6 25
|
1536 | ||
|
0
thg 3 25
|
1382 | ||
|
0
thg 2 25
|
1080 | ||
|
3
thg 8 24
|
5766 | ||
|
1
thg 4 24
|
33 |