Hi, I'm not sure if what I'm doing is possible. I have extended the product type to include a relationship to optional prices, we're calling them BundlePriceOptions. The price options each have an fkey to product, so each product has a range of possible price options. I'm trying to alter the sale form so that on the sale order line, if one chooses a product, there is a pulldown with the list of possible price options, and that list should only contain options pertinent to the product currently selected. I thought I could do something like this:
<record id="view_order_form" model="ir.ui.view">
<field name="name">sale.order.form</field>
<field name="model">sale.order</field>
<field name="priority">1</field>
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="arch" type="xml">
<field name="user_id" position="after">
</field>
<tree string="Sales Order Lines" position="inside">
<field
name="bundle_price_option"
string="Pricing Options"
widget="selection"
domain="[ ('product_id', '=', product_id) ]"
on_change="price_option_change(bundle_price_option, context)"
/>
</tree>
</field>
</record>
But when I do this, I can't out what should go in the right hand side of the domain filter tuple. I'd like it to evaluate dynamically to the id of the currently selected product on the sale order line. It works if I put a static value in there (like an int of a product id), but whatever I put in there seems to give me a traceback of being undefined. If anyone can tell me what I should try or if I'm event approaching this correctly that would be great.
Thanks Iain