[[ repeatIn(objects,'o') ]]
[[ setLang(o.lang) ]]
@@ -177,16 +177,16 @@
[[ line['ref'] ]]
|
- [[ line['date_maturity'] ]]
+ [[ line['date_maturity'] and formatLang(line['date_maturity'],date=True) or '' ]]
|
- [[ formatLang(line['debit']) and formatLang(line['debit'] * (line['account_id']['type'] == 'payable' and -1 or 1)) ]]
+ [[ (line['account_id']['type'] == 'receivable' and formatLang(line['debit']) or 0) or (line['account_id']['type'] == 'payable' and formatLang(line['credit'] * -1) or ' ') ]]
|
- [[ formatLang(line['credit']) and formatLang(line['credit'] * (line['account_id']['type'] == 'payable' and -1 or 1)) ]]
+ [[ (line['account_id']['type'] == 'receivable' and formatLang(line['credit']) or 0) or (line['account_id']['type'] == 'payable' and formatLang(line['debit'] * -1) or 0) ]]
|
- [[ formatLang((line['date_maturity'] < time.strftime('%Y-%m-%d')) and ((line['debit'] - line['credit']) * (line['account_id']['type'] == 'payable' and -1 or 1))) ]]
+ [[ formatLang((line['date_maturity'] < time.strftime('%Y-%m-%d'))) and (line['debit'] - line['credit']) ]]
|
[[ line['blocked'] and 'X' or '' ]]
@@ -205,13 +205,13 @@
Sub-Total :
|
- [[ formatLang((reduce(lambda x, y: x + (y['debit'] * (y['account_id']['type'] == 'payable' and -1 or 1)), getLines(o), 0))) ]]
+ [[ formatLang((reduce(lambda x, y: x + ((y['account_id']['type'] == 'receivable' and y['debit'] or 0) or (y['account_id']['type'] == 'payable' and y['credit'] * -1 or 0)), getLines(o), 0))) ]]
|
- [[ formatLang((reduce(lambda x ,y: x + (y['credit'] * (y['account_id']['type'] == 'payable' and -1 or 1)), getLines(o), 0))) ]]
+ [[ formatLang((reduce(lambda x, y: x + ((y['account_id']['type'] == 'receivable' and y['credit'] or 0) or (y['account_id']['type'] == 'payable' and y['debit'] * -1 or 0)), getLines(o), 0))) ]]
|
- [[ formatLang((reduce(lambda x, y: x + ((y['debit'] - y['credit']) * (y['account_id']['type'] == 'payable' and -1 or 1)), filter(lambda x: x['date_maturity'] < time.strftime('%Y-%m-%d'), getLines(o)), 0))) ]]
+ [[ formatLang((reduce(lambda x, y: x + (y['debit'] - y['credit']), filter(lambda x: x['date_maturity'] < time.strftime('%Y-%m-%d'), getLines(o)), 0))) ]]
|
@@ -229,7 +229,7 @@
Balance :
|
- [[ formatLang((reduce(lambda x, y: x +((y['debit'] - y['credit']) * (y['account_id']['type'] == 'payable' and -1 or 1)), getLines(o), 0))) ]]
+ [[ formatLang((reduce(lambda x, y: x +(y['debit'] - y['credit']), getLines(o), 0))) ]]
|
@@ -248,9 +248,9 @@
|
- Total amount due: [[ formatLang((reduce(lambda x, y: x + ((y['debit'] - y['credit']) * (y['account_id']['type'] == 'payable' and -1 or 1)), getLines(o), 0))) ]] [[ company.currency_id.name ]].
+ Total amount due: [[ formatLang((reduce(lambda x, y: x + (y['debit'] - y['credit']), getLines(o), 0))) ]] [[ company.currency_id.name ]].
-
+
\ No newline at end of file
diff --git a/addons/account/security/ir.model.access.csv b/addons/account/security/ir.model.access.csv
index e1aa3b6510a..7458594d240 100644
--- a/addons/account/security/ir.model.access.csv
+++ b/addons/account/security/ir.model.access.csv
@@ -15,8 +15,8 @@
"access_account_move","account.move","model_account_move","account.group_account_user",1,1,1,1
"access_account_move_line","account.move.line","model_account_move_line","account.group_account_user",1,1,1,1
"access_account_move_reconcile","account.move.reconcile","model_account_move_reconcile","account.group_account_user",1,1,1,1
-"access_account_tax_code","account.tax.code","model_account_tax_code",,1,0,0,0
-"access_account_tax","account.tax","model_account_tax",,1,0,0,0
+"access_account_tax_code","account.tax.code","model_account_tax_code","account.group_account_invoice",1,0,0,0
+"access_account_tax","account.tax","model_account_tax","account.group_account_invoice",1,0,0,0
"access_account_model","account.model","model_account_model","account.group_account_user",1,1,1,1
"access_account_model_line","account.model.line","model_account_model_line","account.group_account_user",1,1,1,1
"access_account_subscription","account.subscription","model_account_subscription","account.group_account_user",1,1,1,1
@@ -93,3 +93,13 @@
"access_report_account_type_sales","report.account_type.sales","model_report_account_type_sales","account.group_account_manager",1,0,0,0
"access_report_account_sales","report.account.sales","model_report_account_sales","account.group_account_manager",1,0,0,0
"access_account_invoice_report","account.invoice.report","model_account_invoice_report","account.group_account_manager",1,0,0,0
+"access_project_account_analytic_line","project.account.analytic.line","model_project_account_analytic_line","account.group_account_manager",1,1,1,1
+"access_account_move_line_reconcile_select","account.move.line.reconcile.select","model_account_move_line_reconcile_select","account.group_account_manager",1,1,1,1
+"access_account_move_line_unreconcile_select","account.move.line.unreconcile.select","model_account_move_line_unreconcile_select","account.group_account_manager",1,1,1,1
+"access_account_invoice_refund","account.invoice.refund","model_account_invoice_refund","account.group_account_manager",1,1,1,1
+"access_account_move_journal","account.move.journal","model_account_move_journal","account.group_account_manager",1,1,1,1
+"access_account_move_bank_reconcile","account.move.bank.reconcile","model_account_move_bank_reconcile","account.group_account_manager",1,1,1,1
+"access_account_subscription_generate","account.subscription.generate","model_account_subscription_generate","account.group_account_manager",1,1,1,1
+"access_account_period_close","account.period.close","model_account_period_close","account.group_account_manager",1,1,1,1
+"access_account_fiscalyear_close_state","account.fiscalyear.close.state","model_account_fiscalyear_close_state","account.group_account_manager",1,1,1,1
+"access_account_chart","account.chart","model_account_chart","account.group_account_manager",1,1,1,1
diff --git a/addons/account/sequence.py b/addons/account/sequence.py
index d48f23eb1cf..e23ec1e3def 100644
--- a/addons/account/sequence.py
+++ b/addons/account/sequence.py
@@ -42,7 +42,7 @@ class ir_sequence(osv.osv):
_columns = {
'fiscal_ids' : fields.one2many('account.sequence.fiscalyear', 'sequence_main_id', 'Sequences')
}
- def get_id(self, cr, uid, sequence_id, test='id', context={}):
+ def get_id(self, cr, uid, sequence_id, test='id', context={}):
cr.execute('select id from ir_sequence where '+test+'=%s and active=%s', (sequence_id, True,))
res = cr.dictfetchone()
if res:
diff --git a/addons/account/wizard/account_change_currency.py b/addons/account/wizard/account_change_currency.py
index 1e23b793d27..eee754435cd 100644
--- a/addons/account/wizard/account_change_currency.py
+++ b/addons/account/wizard/account_change_currency.py
@@ -42,6 +42,7 @@ class account_change_currency(osv.osv_memory):
obj_inv = self.pool.get('account.invoice')
obj_inv_line = self.pool.get('account.invoice.line')
obj_currency = self.pool.get('res.currency')
+ invoice_ids = []
if context is None:
context = {}
data = self.read(cr, uid, ids)[0]
@@ -66,7 +67,8 @@ class account_change_currency(osv.osv_memory):
new_price = (line.price_unit / old_rate ) * rate
obj_inv_line.write(cr, uid, [line.id], {'price_unit' : new_price})
- obj_inv.write(cr, uid, [invoice.id], {'currency_id' : new_currency})
+ invoice_ids.append(invoice.id)
+ obj_inv.write(cr, uid, invoice_ids, {'currency_id' : new_currency}, context=context)
return {}
account_change_currency()
diff --git a/addons/account/wizard/account_invoice_refund.py b/addons/account/wizard/account_invoice_refund.py
index f7e9d79b27a..506155e1ff1 100644
--- a/addons/account/wizard/account_invoice_refund.py
+++ b/addons/account/wizard/account_invoice_refund.py
@@ -21,6 +21,7 @@
from osv import fields, osv
from tools.translate import _
import netsvc
+import time
class account_invoice_refund(osv.osv_memory):
@@ -29,10 +30,14 @@ class account_invoice_refund(osv.osv_memory):
_name = "account.invoice.refund"
_description = "Invoice Refund"
_columns = {
- 'date': fields.date('Operation date', required=False),
+ 'date': fields.date('Operation date', required=False, help='This date will be used as the invoice date for Refund Invoice and Period will be chosen accordingly!'),
'period': fields.many2one('account.period', 'Force period', required=False),
'description': fields.char('Description', size=150, required=True),
- }
+ }
+
+ _defaults = {
+ 'date': time.strftime('%Y-%m-%d'),
+ }
def compute_refund(self, cr, uid, ids, mode, context=None):
"""
@@ -167,7 +172,7 @@ class account_invoice_refund(osv.osv_memory):
xml_id = 'action_invoice_tree1'
elif inv.type == 'in_invoice':
xml_id = 'action_invoice_tree2'
- elif type == 'out_refund':
+ elif inv.type == 'out_refund':
xml_id = 'action_invoice_tree3'
else:
xml_id = 'action_invoice_tree4'
diff --git a/addons/account/wizard/account_reconcile.py b/addons/account/wizard/account_reconcile.py
index 1f745419c5a..be0ebc40677 100644
--- a/addons/account/wizard/account_reconcile.py
+++ b/addons/account/wizard/account_reconcile.py
@@ -19,7 +19,6 @@
#
##############################################################################
import time
-import datetime
from osv import fields, osv
from tools.translate import _
diff --git a/addons/account/wizard/account_unreconcile.py b/addons/account/wizard/account_unreconcile.py
index d50994a6f28..c1de3294c79 100644
--- a/addons/account/wizard/account_unreconcile.py
+++ b/addons/account/wizard/account_unreconcile.py
@@ -29,11 +29,17 @@ class account_unreconcile(osv.osv_memory):
obj_move_reconcile = self.pool.get('account.move.reconcile')
if context is None:
context = {}
- recs = obj_move_line.read(cr, uid, context['active_ids'], ['reconcile_id',])
- recs = filter(lambda x: x['reconcile_id'], recs)
- rec_ids = [rec['reconcile_id'][0] for rec in recs]
- if len(rec_ids):
- obj_move_reconcile.unlink(cr, uid, rec_ids)
+ recs = pool.get('account.move.line').read(cr, uid, data['ids'], ['reconcile_id','reconcile_partial_id'])
+ unlink_ids = []
+ full_recs = filter(lambda x: x['reconcile_id'], recs)
+ rec_ids = [rec['reconcile_id'][0] for rec in full_recs]
+ part_recs = filter(lambda x: x['reconcile_partial_id'], recs)
+ part_rec_ids = [rec['reconcile_partial_id'][0] for rec in part_recs]
+ unlink_ids += rec_ids
+ unlink_ids += part_rec_ids
+
+ if len(unlink_ids):
+ pooler.get_pool(cr.dbname).get('account.move.reconcile').unlink(cr, uid, unlink_ids)
return {}
account_unreconcile()
@@ -44,10 +50,11 @@ class account_unreconcile_reconcile(osv.osv_memory):
def trans_unrec_reconcile(self, cr, uid, ids, context=None):
obj_move_reconcile = self.pool.get('account.move.reconcile')
+ rec_ids = context['active_ids']
if context is None:
context = {}
if len(rec_ids):
- obj_move_reconcile.unlink(cr, uid, context['active_ids'])
+ obj_move_reconcile.unlink(cr, uid, rec_ids)
return {}
account_unreconcile_reconcile()
diff --git a/addons/account_analytic_analysis/account_analytic_analysis.py b/addons/account_analytic_analysis/account_analytic_analysis.py
index 7e4807a3f81..742ef74cc84 100644
--- a/addons/account_analytic_analysis/account_analytic_analysis.py
+++ b/addons/account_analytic_analysis/account_analytic_analysis.py
@@ -393,7 +393,7 @@ account_analytic_account()
class account_analytic_account_summary_user(osv.osv):
_name = "account_analytic_analysis.summary.user"
- _description = "Hours summary by user"
+ _description = "Hours Summary by User"
_order='user'
_auto = False
_rec_name = 'user'
diff --git a/addons/account_analytic_default/account_analytic_default.py b/addons/account_analytic_default/account_analytic_default.py
index ab81e7d88fc..84fd933d9a9 100644
--- a/addons/account_analytic_default/account_analytic_default.py
+++ b/addons/account_analytic_default/account_analytic_default.py
@@ -25,7 +25,7 @@ import time
class account_analytic_default(osv.osv):
_name = 'account.analytic.default'
- _description = 'Analytic Distributions'
+ _description = 'Analytic Distribution'
_rec_name = 'analytic_id'
_order = 'sequence'
_columns = {
@@ -69,7 +69,7 @@ account_analytic_default()
class account_invoice_line(osv.osv):
_inherit = 'account.invoice.line'
- _description = 'account invoice line'
+ _description = 'Invoice Line'
def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition=False, price_unit=False, address_invoice_id=False, currency_id=False, context={}):
res_prod = super(account_invoice_line,self).product_id_change(cr, uid, ids, product, uom, qty, name, type, partner_id, fposition, price_unit, address_invoice_id, currency_id=currency_id, context=context)
@@ -103,6 +103,8 @@ class sale_order_line(osv.osv):
# Method overridden to set the analytic account by default on criterion match
def invoice_line_create(self, cr, uid, ids, context={}):
create_ids = super(sale_order_line,self).invoice_line_create(cr, uid, ids, context)
+ if not ids:
+ return create_ids
sale_line_obj = self.browse(cr, uid, ids[0], context)
pool_inv_line = self.pool.get('account.invoice.line')
diff --git a/addons/account_analytic_plans/account_analytic_plans.py b/addons/account_analytic_plans/account_analytic_plans.py
index 57acdb6dee5..db441d0931f 100644
--- a/addons/account_analytic_plans/account_analytic_plans.py
+++ b/addons/account_analytic_plans/account_analytic_plans.py
@@ -54,7 +54,7 @@ class one2many_mod2(fields.one2many):
class account_analytic_plan(osv.osv):
_name = "account.analytic.plan"
- _description = "Analytic Plans"
+ _description = "Analytic Plan"
_columns = {
'name': fields.char('Analytic Plan', size=64, required=True, select=True,),
'plan_ids': fields.one2many('account.analytic.plan.line','plan_id','Analytic Plans'),
@@ -63,7 +63,7 @@ account_analytic_plan()
class account_analytic_plan_line(osv.osv):
_name = "account.analytic.plan.line"
- _description = "Analytic Plan Lines"
+ _description = "Analytic Plan Line"
_columns = {
'plan_id':fields.many2one('account.analytic.plan','Analytic Plan'),
'name': fields.char('Plan Name', size=64, required=True, select=True),
@@ -297,14 +297,15 @@ class account_move_line(osv.osv):
def create_analytic_lines(self, cr, uid, ids, context={}):
super(account_move_line, self).create_analytic_lines(cr, uid, ids, context)
+ analytic_line_obj = self.pool.get('account.analytic.line')
for line in self.browse(cr, uid, ids, context):
if line.analytics_id:
if not line.journal_id.analytic_journal_id:
raise osv.except_osv(_('No Analytic Journal !'),_("You have to define an analytic journal on the '%s' journal!") % (line.journal_id.name,))
- toremove = self.pool.get('account.analytic.line').search(cr, uid, [('move_id','=',line.id)], context=context)
+ toremove = analytic_line_obj.search(cr, uid, [('move_id','=',line.id)], context=context)
if toremove:
- line.unlink(cr, uid, toremove, context=context)
+ analytic_line_obj.unlink(cr, uid, toremove, context=context)
for line2 in line.analytics_id.account_ids:
val = (line.credit or 0.0) - (line.debit or 0.0)
amt=val * (line2.rate/100)
@@ -321,7 +322,7 @@ class account_move_line(osv.osv):
'journal_id': line.journal_id.analytic_journal_id.id,
'ref': line.ref,
}
- ali_id=self.pool.get('account.analytic.line').create(cr,uid,al_vals)
+ ali_id=analytic_line_obj.create(cr, uid, al_vals, context=context)
return True
account_move_line()
diff --git a/addons/account_anglo_saxon/purchase.py b/addons/account_anglo_saxon/purchase.py
index 98694a3d5dd..ac2dffbfd22 100644
--- a/addons/account_anglo_saxon/purchase.py
+++ b/addons/account_anglo_saxon/purchase.py
@@ -24,7 +24,7 @@ from osv import fields, osv
class purchase_order(osv.osv):
_name = "purchase.order"
_inherit = "purchase.order"
- _description = "Purchase order"
+ _description = "Purchase Order"
def inv_line_create(self, cr, uid, a, ol):
line = super(purchase_order, self).inv_line_create(cr, uid, a, ol)
@@ -37,5 +37,4 @@ class purchase_order(osv.osv):
a = self.pool.get('account.fiscal.position').map_account(cr, uid, fpos, oa)
line[2].update({'account_id': a})
return line
-purchase_order()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
+purchase_order()
diff --git a/addons/account_balance/i18n/hr.po b/addons/account_balance/i18n/hr.po
index 4f9c5532dc2..fe61b709961 100644
--- a/addons/account_balance/i18n/hr.po
+++ b/addons/account_balance/i18n/hr.po
@@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 5.0.0_rc3\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2009-09-08 15:29+0000\n"
-"Last-Translator: Ivica Perić