Skip to content

Commit

Permalink
[ADD] l10n_ar_sale_order_type: Se traslada funcionalidad
Browse files Browse the repository at this point in the history
Task: 72835
  • Loading branch information
mem-adhoc committed May 23, 2024
1 parent 1d03ae1 commit 6865227
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions l10n_ar_sale_order_type/models/sale_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,3 @@ def set_sale_checkbook(self):
else:
return super(SaleOrder, self).set_sale_checkbook()

def write(self, vals):
"""A sale checkbook could have a different order sequence, so we could
need to change it accordingly"""
if self.env.user.has_group('l10n_ar_sale.use_sale_checkbook') and vals.get('sale_checkbook_id'):
sale_checkbook = self.env['sale.checkbook'].browse(vals['sale_checkbook_id'])
if sale_checkbook.sequence_id:
for record in self:
if record.sale_checkbook_id != sale_checkbook and (
record.state in {"draft", "sent"}
and record.type_id.sequence_id != sale_checkbook.sequence_id
):
new_vals = vals.copy()
new_vals["name"] = sale_checkbook.sequence_id._next() or _('New')
super(SaleOrder, record).write(new_vals)
else:
super(SaleOrder, record).write(vals)
return True
return super().write(vals)

0 comments on commit 6865227

Please sign in to comment.