1
# -*- coding: utf-8 -*-
2
##############################################################################
4
# OpenERP, Open Source Management Solution
5
# Original Module by SIESA (<http://www.siesacr.com>)
6
# Refactored by CLEARCORP S.A. (<http://clearcorp.co.cr>)
8
# This program is free software: you can redistribute it and/or modify
9
# it under the terms of the GNU Affero General Public License as
10
# published by the Free Software Foundation, either version 3 of the
11
# license, or (at your option) any later version.
13
# This program is distributed in the hope that it will be useful,
14
# but WITHOUT ANY WARRANTY; without even the implied warranty of
15
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
# GNU Affero General Public License for more details.
18
# You should have received a copy of the GNU Affero General Public License
19
# along with this program. If not, see <http://www.gnu.org/licenses/>.
20
##############################################################################
22
from openerp.osv import osv
24
class SaleAdvancePayment(osv.TransientModel):
26
_inherit = 'sale.advance.payment.inv'
28
def _create_invoices(self, cr, uid, inv_values, sale_id, context=None):
29
inv_id = super(SaleAdvancePayment, self)._create_invoices(cr, uid, inv_values, sale_id, context=context)
30
order_obj = self.pool.get('sale.order')
31
order = order_obj.browse(cr, uid, sale_id, context=context)
32
if order.pricelist_id:
33
inv_obj = self.pool.get('account.invoice')
34
inv_obj.write(cr, uid, inv_id, {'pricelist_id': order.pricelist_id.id}, context=context)
b'\\ No newline at end of file'