Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
3 Odpowiedzi
2451 Widoki

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 

Awatar
Odrzuć
Najlepsza odpowiedź

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.


Awatar
Odrzuć
Najlepsza odpowiedź

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 

Awatar
Odrzuć
Autor Najlepsza odpowiedź

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

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
0
lis 18
3002
9
cze 23
13238
2
sty 22
3945
2
gru 21
7988
0
cze 21
2020