Skip to content

Commit

Permalink
[FIX]sale_order_type_ux: warehouse compute error
Browse files Browse the repository at this point in the history
closes #693

Signed-off-by: matiasperalta1 <mnp@adhoc.com.ar>
  • Loading branch information
JrAdhoc committed Aug 14, 2023
1 parent 2e6199a commit 0ac4172
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions sale_order_type_ux/models/sale_order.py
Expand Up @@ -54,3 +54,10 @@ def _prepare_invoice(self):
res['fiscal_position_id'] = self.env['account.fiscal.position'].with_company(
company.id)._get_fiscal_position(self.partner_invoice_id).id
return res

@api.depends('user_id', 'company_id')
def _compute_warehouse_id(self):
if self.type_id.warehouse_id:
self.warehouse_id = self.type_id.warehouse_id
else:
return super()._compute_warehouse_id()

0 comments on commit 0ac4172

Please sign in to comment.