[IMP] Set the new voucher as inactive.

bzr revid: vta@openerp.com-20121107081827-ncls1h2c5pbjvis3
This commit is contained in:
vta vta@openerp.com
2012-11-07 09:18:27 +01:00
parent 01d33d5d06
commit bee0f20b66
3 changed files with 16 additions and 1 deletions
+3
View File
@@ -60,6 +60,9 @@ This module manages:
'security/account_voucher_security.xml',
'account_voucher_data.xml',
],
'js': [
'static/src/js/account_voucher.js',
],
'test' : [
'test/account_voucher.yml',
'test/sales_receipt.yml',
+1 -1
View File
@@ -329,7 +329,7 @@ class account_voucher(osv.osv):
'is_multi_currency': fields.boolean('Multi Currency Voucher', help='Fields with internal purpose only that depicts if the voucher is a multi currency one or not'),
}
_defaults = {
'active': lambda *a: False,
'active': lambda *a: True,
'period_id': _get_period,
'partner_id': _get_partner,
'journal_id':_get_journal,
@@ -0,0 +1,12 @@
openerp.account_voucher = function(instance) {
instance.web.form.Many2OneButton = instance.web.form.Many2OneButton.extend({
on_click: function() {
this._super.apply(this, arguments);
this.popup.on('create_completed write_completed', self, function(r) {
var voucher = new instance.web.Model('account.voucher');
voucher.call('write', [[r], {'active':false}]);
});
},
});
}