Skip to content

Commit

Permalink
Merge pull request ecosoft-odoo#11 from ecosoft-odoo/Support_3141
Browse files Browse the repository at this point in the history
Support#3141 Disable Invoice Merge feature on Customer Invoices
  • Loading branch information
kittiu committed Sep 3, 2015
2 parents 6ba9815 + 9eb1484 commit af60ab2
Show file tree
Hide file tree
Showing 4 changed files with 116 additions and 0 deletions.
20 changes: 20 additions & 0 deletions ext_account_invoice_merge/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# -*- encoding: utf-8 -*-
#################################################################################
# Autor: Mikel Martin ([email protected])
# Copyright (C) 2012 ZhenIT Software (<http://ZhenIT.com>). All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#################################################################################
import wizard

34 changes: 34 additions & 0 deletions ext_account_invoice_merge/__openerp__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

{
'name': 'Invoice Merge Extension',
'version': '1.0',
'category': 'Accounting Modules',
'description': """
Disable Invoice Merge feature on customer invoices
""",
'author': 'Ecosoft',
'depends': ['account_invoice_merge'],
'website' : 'http://www.ecosoft.co.th',
'installable': True,
'active': False,
}
19 changes: 19 additions & 0 deletions ext_account_invoice_merge/wizard/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# -*- encoding: utf-8 -*-
#################################################################################
# Autor: Mikel Martin ([email protected])
# Copyright (C) 2012 ZhenIT Software (<http://ZhenIT.com>). All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#################################################################################
import invoice_merge
43 changes: 43 additions & 0 deletions ext_account_invoice_merge/wizard/invoice_merge.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# -*- coding: utf-8 -*-

##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################


from openerp.osv import fields, osv
from openerp.tools.translate import _

class invoice_merge(osv.osv_memory):

_inherit = 'invoice.merge'

def merge_invoices(self, cr, uid, ids, context):

data = self.browse(cr, uid, ids, context=context)[0]
for invoice in data.invoices:
if invoice.type in ('out_invoice', 'out_refund'):
raise osv.except_osv(_('Error!'), _('You cannot merge the customer invoices.'))

res = super(invoice_merge, self).merge_invoices(cr, uid, ids, context)
return res

invoice_merge()

# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

0 comments on commit af60ab2

Please sign in to comment.