Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
3 Odpovědi
2452 Zobrazení

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
Zrušit
Nejlepší odpověď

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
Zrušit
Nejlepší odpověď

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
Zrušit
Autor Nejlepší odpověď

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
0
lis 18
3006
9
čvn 23
13241
2
led 22
3945
2
pro 21
7989
0
čvn 21
2023