I would like to automatically fill the “Sales Partner” and “Sales Person” fields for the Invoice when using POS based on a configuration.
I’m thinking about this solution:
Adding the custom fields “Sales Partner” and “Sales Person” to the POS Profile, being those “Links” to their respective Document Types. This way seems to nicely cover my use case.
When the user is placing a sale on the POS, the “Sale Invoice” form could take those POS Profile fields and fetch them to update its own “Sales Partner” and “Sales Person” fields.
The first part was not a problem. However, for the second part, as I understand it, there is no relation between the “Sales Invoice” document and the POS Profile. So I guess that’s why I can’t just invoke something like: posprofile.sales_partner inside the “Sales Invoice”.
So in short, I’m not sure how to get the current POS Profile for the current user and I appreciate any of your help on this.