Skip to content
Snippets Groups Projects
Commit e5f6b810 authored by Anh Thao Pham (pta)'s avatar Anh Thao Pham (pta)
Browse files

[FIX] pos_sale: fix incorrect crm team in invoice

- Install Sales and Point of Sale
- Go to Point of Sale > Dashboard
- Configure your POS via Settings:
  * Select a Sales Team (e.g. Point of Sales)
  * Activate "Invoicing" option
- Start a New Session
- Select a product and proceed to payment
- Activate Invoice and select a Customer
- Make the payment
- Quit the Session to go back to Dashboard of Point of Sale
- Open "Sales Orders" of you POS
- Open the created Order with Invoiced status
- Click on Invoice smart button
The Sales Team associated to the invoice is the default one and not the one configured for the POS.

opw-2278586

closes odoo/odoo#53284

Signed-off-by: default avatarNicolas Martinelli (nim) <nim@odoo.com>
parent 04751ffa
No related branches found
No related tags found
No related merge requests found
......@@ -14,3 +14,10 @@ class PosOrder(models.Model):
for order in self:
date_order = order.date_order or fields.Datetime.now()
order.currency_rate = self.env['res.currency']._get_conversion_rate(order.company_id.currency_id, order.pricelist_id.currency_id, order.company_id, date_order)
def _prepare_invoice(self):
invoice_values = super(PosOrder, self)._prepare_invoice()
if self.session_id.config_id.crm_team_id:
invoice_values['team_id'] = self.session_id.config_id.crm_team_id.id
return invoice_values
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment