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

I'm adding a new one2many field to notebook page sale_order called "On Site" that referencing old order of the same customer. I've got the sale_order_line and already compute the total qty. 

The problem is when the data is new, I can click the sale_order_line of old order inside page "On Site" then pop up of sale_order_line appear then I can edit the sale_order_line of old order inside page "On Site". 

This should not be possible because the data is compute. The product qty, price, etc is already computed and cannot be changed by user because this data is based on previous order of the same customer.

If the data is saved, the pop up field properly readonly


currently the on_site_ids is compute using @api.depends. I want the compute execute after the record is saved. Not before. So even the one2many data is appear, the popup field already readonly. How can I achieve this?

Awatar
Odrzuć
Najlepsza odpowiedź

Hi,

You can hide that "On site" page at the time of the record creation. You can use the below attrs for the "On site" field. Put this attrs on the "On site" page.

attrs= "{'invisible': [('id', '=', False)]}"

So the "On Site" page will visible when the record save.

Please vote up if its help you.


Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
4
gru 23
17574
1
wrz 16
7324
3
kwi 15
4750
2
kwi 15
4140
0
mar 15
3587