Skip to content

Commit

Permalink
[FIX] l10n_ar_sale_order_type: Fix para que se setee correctamente la…
Browse files Browse the repository at this point in the history
… secuencia de la orden de venta

Ticket: 78413
  • Loading branch information
mem-adhoc committed Aug 6, 2024
1 parent e3eb428 commit 13148f5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 2 additions & 4 deletions l10n_ar_sale/models/sale_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,10 @@ 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'):
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['name'] = sale_checkbook.sequence_id._next() or _('New')
return super(SaleOrder, self).create(vals)

def _compute_tax_totals(self):
Expand Down
3 changes: 2 additions & 1 deletion l10n_ar_sale_order_type/models/sale_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ def write(self, vals):
record.state in {"draft", "sent"}
and record.type_id.sequence_id != sale_checkbook.sequence_id
):
number_next = sale_checkbook.sequence_id.number_next_actual
new_vals = vals.copy()
new_vals["name"] = sale_checkbook.sequence_id._next() or _('New')
new_vals["name"] = sale_checkbook.sequence_id.get_next_char(number_next)
super(SaleOrder, record).write(new_vals)
else:
super(SaleOrder, record).write(vals)
Expand Down

0 comments on commit 13148f5

Please sign in to comment.