Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
1312 Vizualizări

I created a field in res.partner i want to get that value from POS onclicking the Validate Button, which i am able to access the new field i created in res.partner, How to do this?

so i am able to get that value using this.new_field

Imagine profil
Abandonează
Cel mai bun răspuns

Hi,

First, inherit the 'pos.session' model in your python file. Define a new function called '_loader_params_your_model' that returns a modified version of the result from the parent function (replace your model with name of the model you want). To do this, first, call the parent function using the 'super' function and store the result in a variable. Then, use the 'extend' method of the 'fields' list to add new fields to the list. Finally, return the modified dictionary. Your function should look like this

    def _loader_params_res_partner(self):
        """
        This function loads the parameters of res.partner in the session.
        ----------------------------------------
        @param self: object pointer
        @return result: params of res.partner model
        """
        result = super(PosSession, self)._loader_params_res_partner()
        result['search_params']['fields'].append('your_field_name')
        return result

Hope it Helps

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
1
feb. 25
2433
1
mar. 24
2488
2
iun. 24
3530
1
feb. 24
2099
1
feb. 24
2583