Exemplo n.º 1
0
 def button_validate(self):
     self.amount_in_word = amount_to_text(self.amount,
                                          lang='fr',
                                          currency='Dinars')
     self.state = 'valid'
     self.action_move_line_create()
     return True
Exemplo n.º 2
0
 def button_reset_taxes(self):
     account_invoice_tax = self.env['account.invoice.tax']
     ctx = dict(self._context)
     for invoice in self:
         self._cr.execute("DELETE FROM account_invoice_tax WHERE invoice_id=%s AND manual is False", (invoice.id,))
         self.invalidate_cache()
         partner = invoice.partner_id
         invoice.amount_in_word = amount_to_text(invoice.amount_total, lang='fr', currency='Dinars')
         if partner.lang:
             ctx['lang'] = partner.lang
         for taxe in account_invoice_tax.compute(invoice.with_context(ctx)).values():
             account_invoice_tax.create(taxe)
     # dummy write on self to trigger recomputations
     return self.with_context(ctx).write({'invoice_line': []})
Exemplo n.º 3
0
 def button_validate(self):
     if len(self.treasury_ids) == 0:
         raise osv.except_osv(_("Error!"), _("no treasury line !"))
     treasury_obj = self.env["account.treasury"]
     for treasury in self.treasury_ids:
         if treasury.state not in ("draft", "valid"):
             raise osv.except_osv(
                 _("Error!"),
                 _("Document number %s for %s is not draft or validate !")
                 % (treasury.name, treasury.partner_id.name),
             )
         treasury.state = "clearing"
         treasury.bank_target = self.bank_target.id
     self.amount_in_word = amount_to_text(self.amount, lang="fr", currency="Dinars")
     self.state = "valid"
     self.action_move_line_create()
     return True
Exemplo n.º 4
0
 def button_validate(self):
     if len(self.treasury_ids) == 0:
         raise osv.except_osv(_('Error!'), _('no treasury line !'))
     treasury_obj = self.env['account.treasury']
     for treasury in self.treasury_ids:
         if treasury.state not in ('draft', 'valid'):
             raise osv.except_osv(
                 _('Error!'),
                 _('Document number %s for %s is not draft or validate !') %
                 (treasury.name, treasury.partner_id.name))
         treasury.state = 'clearing'
         treasury.bank_target = self.bank_target.id
     self.amount_in_word = amount_to_text(self.amount,
                                          lang='fr',
                                          currency='Dinars')
     self.state = 'valid'
     self.action_move_line_create()
     return True
Exemplo n.º 5
0
 def button_validate(self):
     self.amount_in_word = amount_to_text(self.amount, lang="fr", currency="Dinars")
     self.state = "valid"
     self.action_move_line_create()
     return True