1
# -*- encoding: utf-8 -*-
2
###############################################################################
4
# magentoerpconnect_magento_invoice for OpenERP
5
# Copyright (C) 2012-TODAY Akretion <http://www.akretion.com>. All Rights Reserved
6
# @author Sébastien BEAU <sebastien.beau@akretion.com>
7
# This program is free software: you can redistribute it and/or modify
8
# it under the terms of the GNU Affero General Public License as
9
# published by the Free Software Foundation, either version 3 of the
10
# License, or (at your option) any later version.
12
# This program is distributed in the hope that it will be useful,
13
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
# GNU Affero General Public License for more details.
17
# You should have received a copy of the GNU Affero General Public License
18
# along with this program. If not, see <http://www.gnu.org/licenses/>.
20
###############################################################################
23
from openerp.osv.orm import Model
25
class account_invoice(Model):
26
_inherit = "account.invoice"
28
def action_move_create(self, cr, uid, ids, context=None):
30
context = {'lang': 'en_US'}
31
for invoice in self.browse(cr, uid, ids, context=context):
32
ext_invoice_id = self._export_one_invoice(cr, uid, invoice, context=context)
33
invoice.write({'internal_number': ext_invoice_id}, context=context)
34
return super(account_invoice, self).action_move_create(cr, uid, ids, context=context)