Ahmed Haroon
Ahmed Haroon

Reputation: 133

For back-end creating & calling custom popup form/window through button/link

All customization needs to made from Odoo front-end (Settings -> Technical).

I have created a custom model and in Order Lines in Quotation want to create a button or link with every line item to call or open the form as popup. Can someone please guide how to? From sale.order.lines it should pass id to x_sale_order_lines_params view and if data exists then show otherwise user will enter or update data.

Relationship made through x_sale_order_lines_params_ids in sale.order.line

field name = x_sale_order_lines_params_ids,

field type = one2many,

related model = x_sale.order.line.params,

relation field = x_sale_order_line_id

my custom Model = x_sale.order.lines.params

field name = x_sale_order_line_id,

field type = many2one,

related model = sale.order.line,

on delete: cascade

my custom view:

view name: sale.order.lines.param.view.form view type: Form model: x_sale.order.lines.params view inheritance mode: Base view

<form string="Technical Data">
  <tree string="Technical Data" editable="bottom">
    <field name="x_sale_order_line_id" invisible="1"/>
    <field name="x_param_name"/>
    <field name="x_param_value"/>
    <field name="x_param_uom"/>
  </tree>
  <footer>
    <field name="id" invisible="1"/>
    <button string="Discard" class="btn-secondary" special="cancel" data-hotkey="z"/>
  </footer>
</form>

Both are new for me, a button/link within Order Lines area (on every Line/Item) and creating and calling a popup window/form for data entry.

Please help or a link to guide.

Upvotes: 0

Views: 114

Answers (1)

Ahmed Haroon
Ahmed Haroon

Reputation: 133

this is not possible due to each Order Line has not yet value in its id column when it will open this Form, so, the relationship is not possible.

if any other idea like each Order Line can have it as Child? or anything else?

regards

Upvotes: 0

Related Questions