1234567891011121314151617181920212223242526272829 |
- from openerp import api, models
- from num2words import num2words
- class report_reciboflashnet(models.AbstractModel):
- _name = 'report.recibo_flashnet.recibo_flashnet'
- @api.multi
- def render_html(self, data=None):
- report_obj = self.env['report']
- report = report_obj._get_report_from_name('recibo_flashnet.recibo_flashnet')
- docargs = {
- 'doc_ids': self._ids,
- 'doc_model': report.model,
- 'docs': self.env[report.model].browse(self._ids),
- 'convertir':self.convertir,
- 'calcular_precio':self.calcular_precio,
- }
- return report_obj.render('recibo_flashnet.recibo_flashnet', docargs)
- def convertir(self,nro,moneda):
- letra = num2words(nro,lang="es")
- letra = letra.capitalize()
- if not moneda:
- moneda=''
- letra = letra +' '+moneda
- return letra
- def calcular_precio(self,precio):
- return (precio*1.1)
|