This question has been flagged
3 Replies
1791 Views

Dear Sir,

I add some more information in products like Plot Size, Category & Nature. I also add this information in Quotation form. Now i want that when i select the product in the quotation form Then information related product like size category and nature in quotation auto drag. 

My costume field: Plot Size ---->   x_plot_s

                                Plot Nature ----> x_plot_na

                                Plot Category -----> x_plot_c


these field also same in products and quotation model field. Now please advise me what id do for dragging information in quotation form.

this image help to understand my point. https://ibb.co/ixnhvp

Thanks 

Avatar
Discard
Best Answer

Hi Umair Fayyaz, 

You can either follow Niyas Raphy. nor you can override a function.

    @api.multi
@api.onchange('product_id')
def product_id_change(self):

super this function and add your new fields.

domain = super(SaleOrderLine, self).product_id_change()

Thanks.


Avatar
Discard
Best Answer

Hi,

What you can do is that, either you can make the fields added in the quotation form, ie in the sale order line, as related fields or by using the onchange function of the product field you can write the values to the newly added field.


For example. By using related field,

x_plot_s = fields.Char(string="Plot", related='product_id.x_plot_s')


Similarly you can do the same for the rest of the two fields.


Thanks 

Avatar
Discard
Author Best Answer

Dear All, 

I did not successful to implement both method. Kindly tell me where to put these solutions. In View or in model or in During create field?

Thanks

Avatar
Discard