Since the company is not stored anymore on the user and is in the environement, some parts of the code that was based on the current user company cannot work anymore. We've adapted the code to take the company from the relevent documents to avoid having inconsistencies through the different documents generated in the point of sale. TASK-ID: 1997613 closes odoo/odoo#33556 Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>