跳至內容
選單
此問題已被標幟

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'])
頭像
捨棄
作者 最佳答案

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

頭像
捨棄

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

最佳答案

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
頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
0
12月 21
2502
2
12月 19
25215
0
7月 20
4437
2
1月 24
5440
0
6月 23
2037