Skip to content

Commit

Permalink
[FIX] l10n_ar_sale_order: Fix para que se setee correctamente la secu…
Browse files Browse the repository at this point in the history
…encia de la orden de venta
  • Loading branch information
mem-adhoc committed Aug 7, 2024
1 parent e8e2fdb commit b4e80e9
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions l10n_ar_sale/models/sale_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,19 @@ def _get_sale_checkbook(self):
def create(self, vals):
for val in vals:
if self.env.user.has_group('l10n_ar_sale.use_sale_checkbook') and \
val.get('name', _('New')) == _('New') and \
val.get('sale_checkbook_id'):
sale_checkbook = self.env['sale.checkbook'].browse(
val.get('sale_checkbook_id'))
val['name'] = sale_checkbook.sequence_id and\
sale_checkbook.sequence_id._next() or _('New')
val.get('sale_checkbook_id'):
sale_checkbook = self.env['sale.checkbook'].browse(val.get('sale_checkbook_id'))
number_next = sale_checkbook.sequence_id.number_next_actual
val['name'] = sale_checkbook.sequence_id.get_next_char(number_next) or _('New')
return super(SaleOrder, self).create(vals)

def action_confirm(self):
#Consumimos un numero de la secuencia solamente cuando confirmamos la orden de venta
if self.sale_checkbook_id:
self.name = self.sale_checkbook_id.sequence_id._next()

return super().action_confirm()

def _compute_tax_totals(self):
""" Mandamos en contexto el invoice_date para calculo de impuesto con partner aliquot
ver módulo l10n_ar_account_withholding. """
Expand Down

0 comments on commit b4e80e9

Please sign in to comment.