12345678910111213141516171819202122232425262728293031323334 |
- # -*- coding: utf-8 -*-
- from openerp import models, fields, tools, api
- import openerp.addons.decimal_precision as dp
- from openerp.osv import osv
- from openerp.tools.translate import _
- class cash_box_transfer(models.Model):
- _name = "cash.box.transfer"
- name = fields.Char('name', required=True)
- amount = fields.Float('Amount', digits_compute=dp.get_precision('Account'), required=True)
- ref = fields.Char('Ref')
- date = fields.Date()
- message_deleted = fields.Text('Message Deleted')
- active = fields.Boolean('Active', default=True)
- ##### statement line
- input_line = fields.Many2one('account.bank.statement.line', 'Bank statement line Input')
- output_line = fields.Many2one('account.bank.statement.line', 'Bank statement line Output')
- ##### statement
- input_statement = fields.Many2one('account.bank.statement', 'Bank statement input')
- output_statement = fields.Many2one('account.bank.statement', 'Bank statement Output')
- class account_bank_statement_line_deleted(models.Model):
- _inherit = 'account.bank.statement.line'
- is_deleted = fields.Boolean('is deleted', default=False)
- @api.multi
- def unlink(self):
- if (self.is_deleted):
- raise osv.except_osv(('Atencion!'), ('No puedes eliminar el ítem de la caja.'))
- return super(account_bank_statement_line_deleted, self).unlink()
-
|