跳至内容
菜单
此问题已终结
3 回复
2439 查看

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 

形象
丢弃
最佳答案

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.


形象
丢弃
最佳答案

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 

形象
丢弃
编写者 最佳答案

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

形象
丢弃
相关帖文 回复 查看 活动
0
11月 18
2973
9
6月 23
13218
2
1月 22
3936
2
12月 21
7984
0
6月 21
2005