Skip to Content
Menu
This question has been flagged

in Sale Order, there Order Lines, I already create custom attribute and value to related into partner_id. When I add for Product and Product Variant, I see it can "Edit Configuration" and popup the wizard "Configure your product". I don't know if this wizard has model/form/tree? Since I already search it. And this is only what I found, sale_product_configurator modul:

odoo>    
record id="sale_order_view_form" model="ir.ui.view">
field name="name">sale.order.form.inherit.sale.product.configurator
field name="model">sale.orderfield name="inherit_id" ref="sale.view_order_form"/>
field name="arch" type="xml">
​xpath expr="//tree/field[@name='product_template_id']" position="attributes">           
​attribute name="column_invisible">0/xpath>
​xpath expr="//tree/field[@name='product_template_id']" position="after">
​field name="product_template_attribute_value_ids" column_invisible="1" />
​field name="product_custom_attribute_value_ids" column_invisible="1" >
​tree>
​field name="custom_product_template_attribute_value_id" />
​field name="custom_value" />
​/tree>
​/field>
​field name="product_no_variant_attribute_value_ids" column_invisible="1" />             
​field name="is_configurable_product" column_invisible="1" />
​/xpath>
​xpath expr="//tree/field[@name='product_id']" position="attributes">
​attribute name="optional">hideattribute name="string">Product Variant
​/xpath>
/field>
/record>
/odoo>

and for the model:

class SaleOrderLine(models.Model):
_inherit = 'sale.order.line'
is_configurable_product = fields.Boolean(
​string="Is the product configurable?",
​related='product_template_id.has_configurable_attributes',
​depends=['product_id'])
product_template_attribute_value_ids = fields.Many2many(
​related='product_id.product_template_attribute_value_ids',
​depends=['product_id'])
Avatar
Discard
Author Best Answer

attribue/value di configuration ini bisa di xpath ga ya? jadi mau tak domain biar value yang muncul di configuration ini cuma value nya punya di customer ini, yang bukan customer ini ga muncul

Avatar
Discard

di odoo itu untuk inheritance, ini bisa di 3 tipe file

1. python => pakek property _inherit
2. xml => pakek xmlpath
3. js => pakek utlity patch

kalo dikasusmu berarti itu butuh inherit di level js nya yak.
- untuk contoh nya bisa search `patch(SaleOrderLineProductField.prototype`
- kalo dokumentasi penggunaan, bisa check ini: https://www.odoo.com/documentation/17.0/developer/reference/frontend/javascript_reference.html?msockid=03280b935a4962062d241fdd5b1f63ce

Best Answer

You are from indonesia right, so i will reply you with bahasa indo

Itu popup nya custom, pakek custom widget yang bisa dipasangkan di field. Jadi ga ada model sendiri dan memang ga pakek model.

kalo mau check kodingannya, bisa dengan cara:

  1. cari file: sale_product_field.js
  2. cari nama widgetnya: sol_product_many2one
Avatar
Discard
Related Posts Replies Views Activity
0
Dec 21
2427
2
Dec 19
25156
0
Jul 20
4353
2
Jan 24
5358
0
Jun 23
1968