[REF]
bzr revid: mra@mra-laptop-20100618072359-a860w5bc6y9i56wi
This commit is contained in:
parent
1be397c0ea
commit
d73e5f7757
|
@ -33,5 +33,4 @@ import product
|
||||||
import sequence
|
import sequence
|
||||||
import company
|
import company
|
||||||
|
|
||||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -18,19 +18,16 @@
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
import time
|
import time
|
||||||
import netsvc
|
|
||||||
|
|
||||||
from osv import fields, osv
|
|
||||||
import decimal_precision as dp
|
|
||||||
|
|
||||||
from tools.misc import currency
|
|
||||||
from tools.translate import _
|
|
||||||
import pooler
|
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from dateutil.relativedelta import relativedelta
|
from dateutil.relativedelta import relativedelta
|
||||||
|
|
||||||
|
import netsvc
|
||||||
|
import pooler
|
||||||
|
from osv import fields, osv
|
||||||
|
import decimal_precision as dp
|
||||||
|
from tools.misc import currency
|
||||||
|
from tools.translate import _
|
||||||
from tools import config
|
from tools import config
|
||||||
|
|
||||||
class account_payment_term(osv.osv):
|
class account_payment_term(osv.osv):
|
||||||
|
|
|
@ -18,13 +18,12 @@
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
import time
|
import time
|
||||||
|
from datetime import datetime
|
||||||
|
|
||||||
import netsvc
|
import netsvc
|
||||||
from osv import fields, osv
|
from osv import fields, osv
|
||||||
from tools.translate import _
|
from tools.translate import _
|
||||||
|
|
||||||
from datetime import datetime
|
|
||||||
import decimal_precision as dp
|
import decimal_precision as dp
|
||||||
import tools
|
import tools
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
##############################################################################
|
##############################################################################
|
||||||
#
|
#
|
||||||
# OpenERP, Open Source Management Solution
|
# OpenERP, Open Source Management Solution
|
||||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||||
#
|
#
|
||||||
|
@ -15,7 +15,7 @@
|
||||||
# GNU Affero General Public License for more details.
|
# GNU Affero General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Affero General Public License
|
# 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/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
|
@ -33,3 +33,5 @@ out after this mail was sent, please consider the present one as \
|
||||||
void. Do not hesitate to contact our accounting department'
|
void. Do not hesitate to contact our accounting department'
|
||||||
}
|
}
|
||||||
res_company()
|
res_company()
|
||||||
|
|
||||||
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -21,12 +21,13 @@
|
||||||
import time
|
import time
|
||||||
import datetime
|
import datetime
|
||||||
from dateutil.relativedelta import relativedelta
|
from dateutil.relativedelta import relativedelta
|
||||||
from tools.translate import _
|
from os.path import join as opj
|
||||||
from operator import itemgetter
|
from operator import itemgetter
|
||||||
|
|
||||||
|
from tools.translate import _
|
||||||
from osv import fields, osv
|
from osv import fields, osv
|
||||||
import netsvc
|
import netsvc
|
||||||
import tools
|
import tools
|
||||||
from os.path import join as opj
|
|
||||||
|
|
||||||
class account_installer(osv.osv_memory):
|
class account_installer(osv.osv_memory):
|
||||||
_name = 'account.installer'
|
_name = 'account.installer'
|
||||||
|
|
|
@ -772,11 +772,18 @@ class account_invoice(osv.osv):
|
||||||
|
|
||||||
# one move line per tax line
|
# one move line per tax line
|
||||||
iml += ait_obj.move_line_get(cr, uid, inv.id)
|
iml += ait_obj.move_line_get(cr, uid, inv.id)
|
||||||
|
|
||||||
|
entry_type=''
|
||||||
if inv.type in ('in_invoice', 'in_refund'):
|
if inv.type in ('in_invoice', 'in_refund'):
|
||||||
ref = inv.reference
|
ref = inv.reference
|
||||||
|
entry_type = 'journal_pur_voucher'
|
||||||
|
if inv.type in ('in_refund'):
|
||||||
|
entry_type = 'cont_voucher'
|
||||||
else:
|
else:
|
||||||
ref = self._convert_ref(cr, uid, inv.number)
|
ref = self._convert_ref(cr, uid, inv.number)
|
||||||
|
entry_type = 'journal_sale_vou'
|
||||||
|
if inv.type in ('out_refund'):
|
||||||
|
entry_type = 'cont_voucher'
|
||||||
|
|
||||||
diff_currency_p = inv.currency_id.id <> company_currency
|
diff_currency_p = inv.currency_id.id <> company_currency
|
||||||
# create one move line for the total and possibly adjust the other lines amount
|
# create one move line for the total and possibly adjust the other lines amount
|
||||||
|
@ -847,7 +854,7 @@ class account_invoice(osv.osv):
|
||||||
|
|
||||||
line = self.finalize_invoice_move_lines(cr, uid, inv, line)
|
line = self.finalize_invoice_move_lines(cr, uid, inv, line)
|
||||||
|
|
||||||
move = {'ref': inv.number, 'line_id': line, 'journal_id': journal_id, 'date': date}
|
move = {'ref': inv.number, 'line_id': line, 'journal_id': journal_id, 'date': date, 'type': entry_type}
|
||||||
period_id=inv.period_id and inv.period_id.id or False
|
period_id=inv.period_id and inv.period_id.id or False
|
||||||
if not period_id:
|
if not period_id:
|
||||||
period_ids= self.pool.get('account.period').search(cr,uid,[('date_start','<=',inv.date_invoice or time.strftime('%Y-%m-%d')),('date_stop','>=',inv.date_invoice or time.strftime('%Y-%m-%d'))])
|
period_ids= self.pool.get('account.period').search(cr,uid,[('date_start','<=',inv.date_invoice or time.strftime('%Y-%m-%d')),('date_stop','>=',inv.date_invoice or time.strftime('%Y-%m-%d'))])
|
||||||
|
@ -1070,10 +1077,18 @@ class account_invoice(osv.osv):
|
||||||
else:
|
else:
|
||||||
amount_currency = False
|
amount_currency = False
|
||||||
currency_id = False
|
currency_id = False
|
||||||
|
entry_type=''
|
||||||
if invoice.type in ('in_invoice', 'in_refund'):
|
if invoice.type in ('in_invoice', 'in_refund'):
|
||||||
ref = invoice.reference
|
ref = invoice.reference
|
||||||
|
entry_type = 'journal_pur_voucher'
|
||||||
|
if invoice.type in ('in_refund'):
|
||||||
|
entry_type = 'cont_voucher'
|
||||||
else:
|
else:
|
||||||
ref = self._convert_ref(cr, uid, invoice.number)
|
ref = self._convert_ref(cr, uid, invoice.number)
|
||||||
|
entry_type = 'journal_sale_vou'
|
||||||
|
if invoice.type in ('out_refund'):
|
||||||
|
entry_type = 'cont_voucher'
|
||||||
|
|
||||||
# Pay attention to the sign for both debit/credit AND amount_currency
|
# Pay attention to the sign for both debit/credit AND amount_currency
|
||||||
l1 = {
|
l1 = {
|
||||||
'debit': direction * pay_amount>0 and direction * pay_amount,
|
'debit': direction * pay_amount>0 and direction * pay_amount,
|
||||||
|
@ -1104,7 +1119,7 @@ class account_invoice(osv.osv):
|
||||||
l2['name'] = name
|
l2['name'] = name
|
||||||
|
|
||||||
lines = [(0, 0, l1), (0, 0, l2)]
|
lines = [(0, 0, l1), (0, 0, l2)]
|
||||||
move = {'ref': ref, 'line_id': lines, 'journal_id': pay_journal_id, 'period_id': period_id, 'date': date}
|
move = {'ref': ref, 'line_id': lines, 'journal_id': pay_journal_id, 'period_id': period_id, 'date': date, 'type': entry_type}
|
||||||
move_id = self.pool.get('account.move').create(cr, uid, move, context=context)
|
move_id = self.pool.get('account.move').create(cr, uid, move, context=context)
|
||||||
|
|
||||||
line_ids = []
|
line_ids = []
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
##############################################################################
|
##############################################################################
|
||||||
#
|
#
|
||||||
# OpenERP, Open Source Management Solution
|
# OpenERP, Open Source Management Solution
|
||||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||||
#
|
#
|
||||||
|
@ -15,11 +15,12 @@
|
||||||
# GNU Affero General Public License for more details.
|
# GNU Affero General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Affero General Public License
|
# 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/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
import time
|
import time
|
||||||
|
|
||||||
import netsvc
|
import netsvc
|
||||||
from osv import fields, osv
|
from osv import fields, osv
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
##############################################################################
|
##############################################################################
|
||||||
#
|
#
|
||||||
# OpenERP, Open Source Management Solution
|
# OpenERP, Open Source Management Solution
|
||||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||||
#
|
#
|
||||||
|
@ -15,11 +15,10 @@
|
||||||
# GNU Affero General Public License for more details.
|
# GNU Affero General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Affero General Public License
|
# 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/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
|
|
||||||
from osv import fields,osv
|
from osv import fields,osv
|
||||||
|
|
||||||
class ir_sequence_fiscalyear(osv.osv):
|
class ir_sequence_fiscalyear(osv.osv):
|
||||||
|
|
Loading…
Reference in New Issue