[IMP] Set the new voucher as inactive.
bzr revid: vta@openerp.com-20121107081827-ncls1h2c5pbjvis3
This commit is contained in:
@@ -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',
|
||||
|
||||
@@ -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}]);
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user