Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
3 Risposte
2463 Visualizzazioni

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
Abbandona
Risposta migliore

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
Abbandona
Risposta migliore

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
Abbandona
Autore Risposta migliore

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
Abbandona
Post correlati Risposte Visualizzazioni Attività
0
nov 18
3041
9
giu 23
13298
2
gen 22
3974
2
dic 21
8028
0
giu 21
2046