[IMP]
* add missing tools.translate * translate all missing raise * add encoding: utf-8 in missing file * add vim comment (when missing) at the end of file * convert tabs to spaces (PEP8 Compliant) * more pythonic when concatenate value bzr revid: christophe.chauvet@syleam.fr-20090306235010-kf09klskd2voo5cp
This commit is contained in:
parent
1a21d05294
commit
6d2fac36f6
|
@ -1496,7 +1496,7 @@ class account_model(osv.osv):
|
||||||
for model in self.browse(cr, uid, ids, context):
|
for model in self.browse(cr, uid, ids, context):
|
||||||
period_id = self.pool.get('account.period').find(cr,uid, context=context)
|
period_id = self.pool.get('account.period').find(cr,uid, context=context)
|
||||||
if not period_id:
|
if not period_id:
|
||||||
raise osv.except_osv('No period found !', 'Unable to find a valid period !')
|
raise osv.except_osv(_('No period found !'), _('Unable to find a valid period !'))
|
||||||
period_id = period_id[0]
|
period_id = period_id[0]
|
||||||
move_id = self.pool.get('account.move').create(cr, uid, {
|
move_id = self.pool.get('account.move').create(cr, uid, {
|
||||||
'ref': model.ref,
|
'ref': model.ref,
|
||||||
|
|
|
@ -77,3 +77,4 @@ class account_analytic_line(wizard.interface):
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
account_analytic_line('account.analytic.line')
|
account_analytic_line('account.analytic.line')
|
||||||
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -227,3 +227,4 @@ class account_balance(report_sxw.rml_parse):
|
||||||
return self.sum_debit
|
return self.sum_debit
|
||||||
|
|
||||||
report_sxw.report_sxw('report.account.account.balance', 'account.account', 'addons/account/report/account_balance.rml', parser=account_balance, header=False)
|
report_sxw.report_sxw('report.account.account.balance', 'account.account', 'addons/account/report/account_balance.rml', parser=account_balance, header=False)
|
||||||
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -38,3 +38,4 @@ class account_tax_code_report(rml_parse.rml_parse):
|
||||||
report_sxw.report_sxw('report.account.tax.code.entries', 'account.tax.code',
|
report_sxw.report_sxw('report.account.tax.code.entries', 'account.tax.code',
|
||||||
'addons/account/report/account_tax_code.rml', parser=account_tax_code_report, header=False)
|
'addons/account/report/account_tax_code.rml', parser=account_tax_code_report, header=False)
|
||||||
|
|
||||||
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -178,3 +178,4 @@ report_sxw.report_sxw('report.account.aged_trial_balance', 'res.partner',
|
||||||
'addons/account/report/aged_trial_balance.rml',parser=aged_trial_report,header=False)
|
'addons/account/report/aged_trial_balance.rml',parser=aged_trial_report,header=False)
|
||||||
|
|
||||||
|
|
||||||
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -427,3 +427,4 @@ class general_ledger(rml_parse.rml_parse):
|
||||||
|
|
||||||
|
|
||||||
report_sxw.report_sxw('report.account.general.ledger', 'account.account', 'addons/account/report/general_ledger.rml', parser=general_ledger, header=False)
|
report_sxw.report_sxw('report.account.general.ledger', 'account.account', 'addons/account/report/general_ledger.rml', parser=general_ledger, header=False)
|
||||||
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -406,3 +406,4 @@ class general_ledger_landscape(rml_parse.rml_parse):
|
||||||
return currency_total
|
return currency_total
|
||||||
|
|
||||||
report_sxw.report_sxw('report.account.general.ledger_landscape', 'account.account', 'addons/account/report/general_ledger_landscape.rml', parser=general_ledger_landscape, header=False)
|
report_sxw.report_sxw('report.account.general.ledger_landscape', 'account.account', 'addons/account/report/general_ledger_landscape.rml', parser=general_ledger_landscape, header=False)
|
||||||
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -35,3 +35,4 @@ report_sxw.report_sxw(
|
||||||
'addons/account/report/invoice.rml',
|
'addons/account/report/invoice.rml',
|
||||||
parser=account_invoice
|
parser=account_invoice
|
||||||
)
|
)
|
||||||
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -617,3 +617,4 @@ class partner_balance(report_sxw.rml_parse):
|
||||||
report_sxw.report_sxw('report.account.partner.balance', 'res.partner',
|
report_sxw.report_sxw('report.account.partner.balance', 'res.partner',
|
||||||
'account/report/partner_balance.rml',parser=partner_balance,
|
'account/report/partner_balance.rml',parser=partner_balance,
|
||||||
header=False)
|
header=False)
|
||||||
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -175,3 +175,4 @@ class rml_parse(report_sxw.rml_parse):
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -236,3 +236,4 @@ class tax_report(rml_parse.rml_parse):
|
||||||
report_sxw.report_sxw('report.account.vat.declaration', 'account.tax.code',
|
report_sxw.report_sxw('report.account.vat.declaration', 'account.tax.code',
|
||||||
'addons/account/report/tax_report.rml', parser=tax_report, header=False)
|
'addons/account/report/tax_report.rml', parser=tax_report, header=False)
|
||||||
|
|
||||||
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -447,3 +447,4 @@ report_sxw.report_sxw('report.account.third_party_ledger', 'res.partner',
|
||||||
'addons/account/report/third_party_ledger.rml',parser=third_party_ledger,
|
'addons/account/report/third_party_ledger.rml',parser=third_party_ledger,
|
||||||
header=False)
|
header=False)
|
||||||
|
|
||||||
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -49,3 +49,4 @@ class ir_sequence(osv.osv):
|
||||||
ir_sequence()
|
ir_sequence()
|
||||||
|
|
||||||
|
|
||||||
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
import wizard
|
import wizard
|
||||||
import pooler
|
import pooler
|
||||||
import time
|
import time
|
||||||
|
from tools.translate import _
|
||||||
|
|
||||||
period_form = '''<?xml version="1.0"?>
|
period_form = '''<?xml version="1.0"?>
|
||||||
<form string="Select period">
|
<form string="Select period">
|
||||||
|
@ -115,11 +116,11 @@ class wizard_report(wizard.interface):
|
||||||
res = cr.dictfetchall()
|
res = cr.dictfetchall()
|
||||||
if res:
|
if res:
|
||||||
if (data['form']['date_to'] > res[0]['date_stop'] or data['form']['date_to'] < res[0]['date_start']):
|
if (data['form']['date_to'] > res[0]['date_stop'] or data['form']['date_to'] < res[0]['date_start']):
|
||||||
raise wizard.except_wizard('UserError','Date to must be set between ' + res[0]['date_start'] + " and " + res[0]['date_stop'])
|
raise wizard.except_wizard(_('UserError'),_('Date to must be set between %s and %s') % (res[0]['date_start'], res[0]['date_stop']))
|
||||||
else:
|
else:
|
||||||
return 'report'
|
return 'report'
|
||||||
else:
|
else:
|
||||||
raise wizard.except_wizard('UserError','Date not in a defined fiscal year')
|
raise wizard.except_wizard(_('UserError'),_('Date not in a defined fiscal year'))
|
||||||
|
|
||||||
states = {
|
states = {
|
||||||
|
|
||||||
|
@ -141,3 +142,4 @@ class wizard_report(wizard.interface):
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
wizard_report('account.account.balance.report')
|
wizard_report('account.account.balance.report')
|
||||||
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -26,6 +26,7 @@ import datetime
|
||||||
import pooler
|
import pooler
|
||||||
|
|
||||||
from mx.DateTime import *
|
from mx.DateTime import *
|
||||||
|
from tools.translate import _
|
||||||
|
|
||||||
_aged_trial_form = """<?xml version="1.0"?>
|
_aged_trial_form = """<?xml version="1.0"?>
|
||||||
<form string="Aged Trial Balance">
|
<form string="Aged Trial Balance">
|
||||||
|
@ -63,7 +64,7 @@ def _calc_dates(self, cr, uid, data, context):
|
||||||
res = {}
|
res = {}
|
||||||
period_length = data['form']['period_length']
|
period_length = data['form']['period_length']
|
||||||
if period_length<=0:
|
if period_length<=0:
|
||||||
raise wizard.except_wizard('UserError', 'You must enter a period length that cannot be 0 or below !')
|
raise wizard.except_wizard(_('UserError'), _('You must enter a period length that cannot be 0 or below !'))
|
||||||
start = datetime.date.fromtimestamp(time.mktime(time.strptime(data['form']['date1'],"%Y-%m-%d")))
|
start = datetime.date.fromtimestamp(time.mktime(time.strptime(data['form']['date1'],"%Y-%m-%d")))
|
||||||
start = DateTime(int(start.year),int(start.month),int(start.day))
|
start = DateTime(int(start.year),int(start.month),int(start.day))
|
||||||
if data['form']['direction_selection'] == 'past':
|
if data['form']['direction_selection'] == 'past':
|
||||||
|
@ -110,3 +111,4 @@ class wizard_report(wizard.interface):
|
||||||
}
|
}
|
||||||
wizard_report('account.aged.trial.balance')
|
wizard_report('account.aged.trial.balance')
|
||||||
|
|
||||||
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -24,6 +24,7 @@ import wizard
|
||||||
import netsvc
|
import netsvc
|
||||||
import pooler
|
import pooler
|
||||||
import time
|
import time
|
||||||
|
from tools.translate import _
|
||||||
|
|
||||||
#TODO:
|
#TODO:
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,7 @@ import wizard
|
||||||
import pooler
|
import pooler
|
||||||
import locale
|
import locale
|
||||||
import time
|
import time
|
||||||
|
from tools.translate import _
|
||||||
|
|
||||||
account_form = '''<?xml version="1.0"?>
|
account_form = '''<?xml version="1.0"?>
|
||||||
<form string="Select Chart">
|
<form string="Select Chart">
|
||||||
|
@ -108,12 +109,12 @@ def _check_date(self, cr, uid, data, context):
|
||||||
res = cr.dictfetchall()
|
res = cr.dictfetchall()
|
||||||
if res:
|
if res:
|
||||||
if (data['form']['date_to'] > res[0]['date_stop'] or data['form']['date_to'] < res[0]['date_start']):
|
if (data['form']['date_to'] > res[0]['date_stop'] or data['form']['date_to'] < res[0]['date_start']):
|
||||||
raise wizard.except_wizard('UserError','Date to must be set between ' + res[0]['date_start'] + " and " + res[0]['date_stop'])
|
raise wizard.except_wizard(_('UserError'),_('Date to must be set between %s and %s') % (str(res[0]['date_start']), str(res[0]['date_stop'])))
|
||||||
else:
|
else:
|
||||||
return 'checkreport'
|
return 'checkreport'
|
||||||
|
|
||||||
else:
|
else:
|
||||||
raise wizard.except_wizard('UserError','Date not in a defined fiscal year')
|
raise wizard.except_wizard(_('UserError'),_('Date not in a defined fiscal year'))
|
||||||
|
|
||||||
def _check_state(self, cr, uid, data, context):
|
def _check_state(self, cr, uid, data, context):
|
||||||
|
|
||||||
|
@ -173,3 +174,4 @@ class wizard_report(wizard.interface):
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
wizard_report('account.general.ledger.report')
|
wizard_report('account.general.ledger.report')
|
||||||
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
import time
|
import time
|
||||||
import wizard
|
import wizard
|
||||||
import pooler
|
import pooler
|
||||||
|
from tools.translate import _
|
||||||
|
|
||||||
period_form = '''<?xml version="1.0"?>
|
period_form = '''<?xml version="1.0"?>
|
||||||
<form string="Select Date-Period">
|
<form string="Select Date-Period">
|
||||||
|
@ -106,12 +107,12 @@ class wizard_report(wizard.interface):
|
||||||
res = cr.dictfetchall()
|
res = cr.dictfetchall()
|
||||||
if res:
|
if res:
|
||||||
if (data['form']['date2'] > res[0]['date_stop'] or data['form']['date2'] < res[0]['date_start']):
|
if (data['form']['date2'] > res[0]['date_stop'] or data['form']['date2'] < res[0]['date_start']):
|
||||||
raise wizard.except_wizard('UserError','Date to must be set between ' + res[0]['date_start'] + " and " + res[0]['date_stop'])
|
raise wizard.except_wizard(_('UserError'),_('Date to must be set between %s and %s') % (str(res[0]['date_start']), str(res[0]['date_stop'])))
|
||||||
else:
|
else:
|
||||||
return 'report'
|
return 'report'
|
||||||
|
|
||||||
else:
|
else:
|
||||||
raise wizard.except_wizard('UserError','Date not in a defined fiscal year')
|
raise wizard.except_wizard(_('UserError'),_('Date not in a defined fiscal year'))
|
||||||
|
|
||||||
states = {
|
states = {
|
||||||
'init': {
|
'init': {
|
||||||
|
@ -125,3 +126,4 @@ class wizard_report(wizard.interface):
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
wizard_report('account.partner.balance.report')
|
wizard_report('account.partner.balance.report')
|
||||||
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -24,6 +24,7 @@ import pooler
|
||||||
import osv
|
import osv
|
||||||
import netsvc
|
import netsvc
|
||||||
import time
|
import time
|
||||||
|
from tools.translate import _
|
||||||
|
|
||||||
sur_form = '''<?xml version="1.0"?>
|
sur_form = '''<?xml version="1.0"?>
|
||||||
<form string="Credit Note">
|
<form string="Credit Note">
|
||||||
|
|
|
@ -38,7 +38,7 @@ def _change_inv_state(self, cr, uid, data, context):
|
||||||
pool_obj = pooler.get_pool(cr.dbname)
|
pool_obj = pooler.get_pool(cr.dbname)
|
||||||
data_inv = pool_obj.get('account.invoice').browse(cr, uid, data['ids'][0])
|
data_inv = pool_obj.get('account.invoice').browse(cr, uid, data['ids'][0])
|
||||||
if data_inv.reconciled:
|
if data_inv.reconciled:
|
||||||
raise wizard.except_wizard('Warning', 'Invoice is already reconciled')
|
raise wizard.except_wizard(_('Warning'), _('Invoice is already reconciled'))
|
||||||
wf_service = netsvc.LocalService("workflow")
|
wf_service = netsvc.LocalService("workflow")
|
||||||
res = wf_service.trg_validate(uid, 'account.invoice', data['ids'][0], 'open_test', cr)
|
res = wf_service.trg_validate(uid, 'account.invoice', data['ids'][0], 'open_test', cr)
|
||||||
return {}
|
return {}
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# -*- encoding: utf-8 -*-
|
||||||
##############################################################################
|
##############################################################################
|
||||||
#
|
#
|
||||||
# Copyright (c) 2008 Camptocamp SA All Rights Reserved. (JGG)
|
# Copyright (c) 2008 Camptocamp SA All Rights Reserved. (JGG)
|
||||||
|
@ -171,3 +172,4 @@ class PopulateStatementFromInv(wizard.interface):
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
PopulateStatementFromInv('populate_statement_from_inv')
|
PopulateStatementFromInv('populate_statement_from_inv')
|
||||||
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
import time
|
import time
|
||||||
import wizard
|
import wizard
|
||||||
import pooler
|
import pooler
|
||||||
|
from tools.translate import _
|
||||||
|
|
||||||
|
|
||||||
period_form = '''<?xml version="1.0"?>
|
period_form = '''<?xml version="1.0"?>
|
||||||
|
@ -112,12 +113,12 @@ class wizard_report(wizard.interface):
|
||||||
res = cr.dictfetchall()
|
res = cr.dictfetchall()
|
||||||
if res:
|
if res:
|
||||||
if (data['form']['date2'] > res[0]['date_stop'] or data['form']['date2'] < res[0]['date_start']):
|
if (data['form']['date2'] > res[0]['date_stop'] or data['form']['date2'] < res[0]['date_start']):
|
||||||
raise wizard.except_wizard('UserError','Date to must be set between ' + res[0]['date_start'] + " and " + res[0]['date_stop'])
|
raise wizard.except_wizard(_('UserError'),_('Date to must be set between %s and %s') % (str(res[0]['date_start']) , str(res[0]['date_stop'])))
|
||||||
else:
|
else:
|
||||||
return 'report'
|
return 'report'
|
||||||
|
|
||||||
else:
|
else:
|
||||||
raise wizard.except_wizard('UserError','Date not in a defined fiscal year')
|
raise wizard.except_wizard(_('UserError'),_('Date not in a defined fiscal year'))
|
||||||
|
|
||||||
|
|
||||||
def _check_state(self, cr, uid, data, context):
|
def _check_state(self, cr, uid, data, context):
|
||||||
|
@ -142,3 +143,4 @@ class wizard_report(wizard.interface):
|
||||||
wizard_report('account.third_party_ledger.report')
|
wizard_report('account.third_party_ledger.report')
|
||||||
|
|
||||||
|
|
||||||
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -23,6 +23,7 @@ import wizard
|
||||||
import time
|
import time
|
||||||
import datetime
|
import datetime
|
||||||
import pooler
|
import pooler
|
||||||
|
from tools.translate import _
|
||||||
|
|
||||||
model_form = """<?xml version="1.0"?>
|
model_form = """<?xml version="1.0"?>
|
||||||
<form string="Select Message">
|
<form string="Select Message">
|
||||||
|
@ -52,7 +53,7 @@ def _create_entries(self, cr, uid, data, context):
|
||||||
|
|
||||||
period_id = pool_obj.get('account.period').find(cr,uid, context=context)
|
period_id = pool_obj.get('account.period').find(cr,uid, context=context)
|
||||||
if not period_id:
|
if not period_id:
|
||||||
raise wizard.except_wizard('No period found !', 'Unable to find a valid period !')
|
raise wizard.except_wizard(_('No period found !'), _('Unable to find a valid period !'))
|
||||||
period_id = period_id[0]
|
period_id = period_id[0]
|
||||||
move_id = pool_obj.get('account.move').create(cr, uid, {
|
move_id = pool_obj.get('account.move').create(cr, uid, {
|
||||||
'ref': model.ref,
|
'ref': model.ref,
|
||||||
|
|
|
@ -88,3 +88,4 @@ class wizard_report(wizard.interface):
|
||||||
wizard_report('account.vat.declaration')
|
wizard_report('account.vat.declaration')
|
||||||
|
|
||||||
|
|
||||||
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -20,3 +20,4 @@
|
||||||
#
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
import account_analytic_default
|
import account_analytic_default
|
||||||
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -106,3 +106,4 @@ class account_invoice_line(osv.osv):
|
||||||
return res_prod
|
return res_prod
|
||||||
account_invoice_line()
|
account_invoice_line()
|
||||||
|
|
||||||
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -30,6 +30,7 @@ from osv import fields, osv,orm
|
||||||
import ir
|
import ir
|
||||||
|
|
||||||
import tools
|
import tools
|
||||||
|
from tools.translate import _
|
||||||
|
|
||||||
class one2many_mod2(fields.one2many):
|
class one2many_mod2(fields.one2many):
|
||||||
def get(self, cr, obj, ids, name, user=None, offset=0, context=None, values=None):
|
def get(self, cr, obj, ids, name, user=None, offset=0, context=None, values=None):
|
||||||
|
@ -176,7 +177,7 @@ class account_analytic_plan_instance(osv.osv):
|
||||||
|
|
||||||
pids = self.pool.get('account.analytic.plan.instance').search(cr, uid, [('name','=',vals['name']),('code','=',vals['code']),('plan_id','<>',False)])
|
pids = self.pool.get('account.analytic.plan.instance').search(cr, uid, [('name','=',vals['name']),('code','=',vals['code']),('plan_id','<>',False)])
|
||||||
if pids:
|
if pids:
|
||||||
raise osv.except_osv('Error', 'A model having this name and code already exists !')
|
raise osv.except_osv(_('Error'), _('A model having this name and code already exists !'))
|
||||||
|
|
||||||
res = self.pool.get('account.analytic.plan.line').search(cr,uid,[('plan_id','=',journal.plan_id.id)])
|
res = self.pool.get('account.analytic.plan.line').search(cr,uid,[('plan_id','=',journal.plan_id.id)])
|
||||||
for i in res:
|
for i in res:
|
||||||
|
@ -189,7 +190,7 @@ class account_analytic_plan_instance(osv.osv):
|
||||||
if self.pool.get('account.analytic.account').search(cr,uid,[('parent_id','child_of',[item.root_analytic_id.id]),('id','=',tempo[2]['analytic_account_id'])]):
|
if self.pool.get('account.analytic.account').search(cr,uid,[('parent_id','child_of',[item.root_analytic_id.id]),('id','=',tempo[2]['analytic_account_id'])]):
|
||||||
total_per_plan += tempo[2]['rate']
|
total_per_plan += tempo[2]['rate']
|
||||||
if total_per_plan < item.min_required or total_per_plan > item.max_required:
|
if total_per_plan < item.min_required or total_per_plan > item.max_required:
|
||||||
raise osv.except_osv("Value Error" ,"The Total Should be Between " + str(item.min_required) + " and " + str(item.max_required))
|
raise osv.except_osv(_('Value Error') ,_('The Total Should be Between %s and %s" % (str(item.min_required), str(item.max_required))))
|
||||||
|
|
||||||
return super(account_analytic_plan_instance, self).create(cr, uid, vals, context)
|
return super(account_analytic_plan_instance, self).create(cr, uid, vals, context)
|
||||||
|
|
||||||
|
@ -374,3 +375,4 @@ class analytic_default(osv.osv):
|
||||||
}
|
}
|
||||||
analytic_default()
|
analytic_default()
|
||||||
|
|
||||||
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -23,6 +23,7 @@ import wizard
|
||||||
import time
|
import time
|
||||||
import netsvc
|
import netsvc
|
||||||
import pooler
|
import pooler
|
||||||
|
from tools.translate import _
|
||||||
|
|
||||||
info = '''<?xml version="1.0"?>
|
info = '''<?xml version="1.0"?>
|
||||||
<form string="Distribution Model Saved">
|
<form string="Distribution Model Saved">
|
||||||
|
@ -35,10 +36,10 @@ def activate(self, cr, uid, data, context):
|
||||||
if data['id']:
|
if data['id']:
|
||||||
plan = plan_obj.browse(cr, uid, data['id'], context)
|
plan = plan_obj.browse(cr, uid, data['id'], context)
|
||||||
if (not plan.name) or (not plan.code):
|
if (not plan.name) or (not plan.code):
|
||||||
raise wizard.except_wizard('Error', 'Please put a name and a code before saving the model !')
|
raise wizard.except_wizard(_('Error'), _('Please put a name and a code before saving the model !'))
|
||||||
pids = pooler.get_pool(cr.dbname).get('account.analytic.plan').search(cr, uid, [], context=context)
|
pids = pooler.get_pool(cr.dbname).get('account.analytic.plan').search(cr, uid, [], context=context)
|
||||||
if (not pids):
|
if (not pids):
|
||||||
raise wizard.except_wizard('Error', 'No analytic plan defined !')
|
raise wizard.except_wizard(_('Error'), _('No analytic plan defined !'))
|
||||||
plan_obj.write(cr,uid,[data['id']],{'plan_id':pids[0]})
|
plan_obj.write(cr,uid,[data['id']],{'plan_id':pids[0]})
|
||||||
return 'info'
|
return 'info'
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -23,6 +23,7 @@ import wizard
|
||||||
import time
|
import time
|
||||||
import datetime
|
import datetime
|
||||||
import pooler
|
import pooler
|
||||||
|
from tools.translate import _
|
||||||
|
|
||||||
form = """<?xml version="1.0"?>
|
form = """<?xml version="1.0"?>
|
||||||
<form string="Select Information">
|
<form string="Select Information">
|
||||||
|
@ -59,7 +60,7 @@ class wizard_crossovered_analytic(wizard.interface):
|
||||||
break
|
break
|
||||||
|
|
||||||
if flag:
|
if flag:
|
||||||
raise wizard.except_wizard('User Error',"There are no Analytic lines related to Account '" + name +"'" )
|
raise wizard.except_wizard(_('User Error'),_('There are no Analytic lines related to Account %s' % name))
|
||||||
return {}
|
return {}
|
||||||
|
|
||||||
states = {
|
states = {
|
||||||
|
|
|
@ -25,6 +25,7 @@ import netsvc
|
||||||
from mx import DateTime
|
from mx import DateTime
|
||||||
import time
|
import time
|
||||||
import datetime
|
import datetime
|
||||||
|
from tools.translate import _
|
||||||
|
|
||||||
|
|
||||||
def strToDate(dt):
|
def strToDate(dt):
|
||||||
|
@ -161,7 +162,7 @@ class crossovered_budget_lines(osv.osv):
|
||||||
for line in self.browse(cr, uid, ids):
|
for line in self.browse(cr, uid, ids):
|
||||||
acc_ids = [x.id for x in line.general_budget_id.account_ids]
|
acc_ids = [x.id for x in line.general_budget_id.account_ids]
|
||||||
if not acc_ids:
|
if not acc_ids:
|
||||||
raise osv.except_osv('Error!',"The General Budget '" + str(line.general_budget_id.name) + "' has no Accounts!" )
|
raise osv.except_osv(_('Error!'),_("The General Budget '%s' has no Accounts!" % str(line.general_budget_id.name)))
|
||||||
date_to = line.date_to
|
date_to = line.date_to
|
||||||
date_from = line.date_from
|
date_from = line.date_from
|
||||||
if context.has_key('wizard_date_from'):
|
if context.has_key('wizard_date_from'):
|
||||||
|
|
|
@ -24,6 +24,7 @@ import time
|
||||||
import wizard
|
import wizard
|
||||||
import datetime
|
import datetime
|
||||||
import pooler
|
import pooler
|
||||||
|
from tools.translate import _
|
||||||
|
|
||||||
dates_form = '''<?xml version="1.0"?>
|
dates_form = '''<?xml version="1.0"?>
|
||||||
<form string="Select period">
|
<form string="Select period">
|
||||||
|
@ -41,7 +42,7 @@ class wizard_report(wizard.interface):
|
||||||
pool_obj = pooler.get_pool(cr.dbname)
|
pool_obj = pooler.get_pool(cr.dbname)
|
||||||
data_model = pool_obj.get(data['model']).browse(cr,uid,data['id'])
|
data_model = pool_obj.get(data['model']).browse(cr,uid,data['id'])
|
||||||
if not data_model.dotation_ids:
|
if not data_model.dotation_ids:
|
||||||
raise wizard.except_wizard('Insufficient Data!',"No Dotations or Master Budget Expenses Found on Budget '"+ data_model.name +"'!")
|
raise wizard.except_wizard(_('Insufficient Data!'),_('No Dotations or Master Budget Expenses Found on Budget %s!') % data_model.name)
|
||||||
return data['form']
|
return data['form']
|
||||||
|
|
||||||
states = {
|
states = {
|
||||||
|
|
|
@ -29,6 +29,7 @@ import ir
|
||||||
from mx import DateTime
|
from mx import DateTime
|
||||||
import pooler
|
import pooler
|
||||||
from tools import config
|
from tools import config
|
||||||
|
from tools.translate import _
|
||||||
|
|
||||||
class account_journal(osv.osv):
|
class account_journal(osv.osv):
|
||||||
_inherit='account.journal'
|
_inherit='account.journal'
|
||||||
|
@ -62,7 +63,7 @@ class account_move_line(osv.osv):
|
||||||
if not journal.allow_date:
|
if not journal.allow_date:
|
||||||
period=self.pool.get('account.period').browse(cr,uid,[period_id])[0]
|
period=self.pool.get('account.period').browse(cr,uid,[period_id])[0]
|
||||||
if not time.strptime(vals['date'],'%Y-%m-%d')>=time.strptime(period.date_start,'%Y-%m-%d') and time.strptime(vals['date'],'%Y-%m-%d')<=time.strptime(period.date_stop,'%Y-%m-%d'):
|
if not time.strptime(vals['date'],'%Y-%m-%d')>=time.strptime(period.date_start,'%Y-%m-%d') and time.strptime(vals['date'],'%Y-%m-%d')<=time.strptime(period.date_stop,'%Y-%m-%d'):
|
||||||
raise osv.except_osv('Error','The date of your account move is not in the defined period !')
|
raise osv.except_osv(_('Error'),_('The date of your account move is not in the defined period !'))
|
||||||
else:
|
else:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
from osv import fields, osv
|
from osv import fields, osv
|
||||||
|
from tools.translate import _
|
||||||
|
|
||||||
class account_move_line(osv.osv):
|
class account_move_line(osv.osv):
|
||||||
_inherit = "account.move.line"
|
_inherit = "account.move.line"
|
||||||
|
|
|
@ -21,3 +21,4 @@
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
import payment_order
|
import payment_order
|
||||||
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -31,4 +31,6 @@ class payment_order(report_sxw.rml_parse):
|
||||||
'time': time,
|
'time': time,
|
||||||
|
|
||||||
})
|
})
|
||||||
report_sxw.report_sxw('report.payment.order', 'payment.order', 'addons/account_payment/report/payment_order.rml', parser=payment_order,header=False)
|
report_sxw.report_sxw('report.payment.order', 'payment.order', 'addons/account_payment/report/payment_order.rml', parser=payment_order,header=False)
|
||||||
|
|
||||||
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -24,6 +24,7 @@ import netsvc
|
||||||
from osv import fields, osv
|
from osv import fields, osv
|
||||||
import pooler
|
import pooler
|
||||||
from tools.misc import currency
|
from tools.misc import currency
|
||||||
|
from tools.translate import _
|
||||||
|
|
||||||
import mx.DateTime
|
import mx.DateTime
|
||||||
from mx.DateTime import RelativeDateTime, now, DateTime, localtime
|
from mx.DateTime import RelativeDateTime, now, DateTime, localtime
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
|
|
||||||
import wizard
|
import wizard
|
||||||
import pooler
|
import pooler
|
||||||
|
from tools.translate import _
|
||||||
|
|
||||||
form = '''<?xml version="1.0"?>
|
form = '''<?xml version="1.0"?>
|
||||||
<form string="Print Indicators">
|
<form string="Print Indicators">
|
||||||
|
@ -55,7 +56,7 @@ def _load_base(self, cr, uid, data, context):
|
||||||
|
|
||||||
def _check_len(self, cr, uid, data, context):
|
def _check_len(self, cr, uid, data, context):
|
||||||
if len(data['form']['base_selection'][0][2])>8:
|
if len(data['form']['base_selection'][0][2])>8:
|
||||||
raise wizard.except_wizard('User Error!',"Please select maximum 8 records to fit the page-width.")
|
raise wizard.except_wizard(_('User Error!'),_("Please select maximum 8 records to fit the page-width."))
|
||||||
return data['form']
|
return data['form']
|
||||||
|
|
||||||
class wizard_print_indicators(wizard.interface):
|
class wizard_print_indicators(wizard.interface):
|
||||||
|
|
|
@ -23,3 +23,4 @@
|
||||||
import voucher
|
import voucher
|
||||||
import voucher_account
|
import voucher_account
|
||||||
import report
|
import report
|
||||||
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -20,4 +20,6 @@
|
||||||
#
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
import report_voucher
|
import report_voucher
|
||||||
import report_voucher_amount
|
import report_voucher_amount
|
||||||
|
|
||||||
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -64,4 +64,6 @@ report_sxw.report_sxw(
|
||||||
'account.voucher',
|
'account.voucher',
|
||||||
'addons/account_voucher/report/report_voucher.rml',
|
'addons/account_voucher/report/report_voucher.rml',
|
||||||
parser=report_voucher,header=False
|
parser=report_voucher,header=False
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -43,4 +43,6 @@ report_sxw.report_sxw(
|
||||||
'account.voucher',
|
'account.voucher',
|
||||||
'addons/account_voucher/report/report_voucher_amount.rml',
|
'addons/account_voucher/report/report_voucher_amount.rml',
|
||||||
parser=report_voucher_amount,header=False
|
parser=report_voucher_amount,header=False
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -28,6 +28,7 @@ import mx.DateTime
|
||||||
from mx.DateTime import RelativeDateTime
|
from mx.DateTime import RelativeDateTime
|
||||||
|
|
||||||
from tools import config
|
from tools import config
|
||||||
|
from tools.translate import _
|
||||||
|
|
||||||
type2journal = {
|
type2journal = {
|
||||||
'rec_voucher':'cash',
|
'rec_voucher':'cash',
|
||||||
|
@ -180,7 +181,7 @@ class account_voucher(osv.osv):
|
||||||
if t['state'] in ('draft', 'cancel'):
|
if t['state'] in ('draft', 'cancel'):
|
||||||
unlink_ids.append(t['id'])
|
unlink_ids.append(t['id'])
|
||||||
else:
|
else:
|
||||||
raise osv.except_osv('Invalid action !', 'Cannot delete invoice(s) which are already opened or paid !')
|
raise osv.except_osv(_('Invalid action !'), _('Cannot delete invoice(s) which are already opened or paid !'))
|
||||||
osv.osv.unlink(self, cr, uid, unlink_ids, context=context)
|
osv.osv.unlink(self, cr, uid, unlink_ids, context=context)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
@ -604,3 +605,4 @@ class VoucherLine(osv.osv):
|
||||||
}
|
}
|
||||||
VoucherLine()
|
VoucherLine()
|
||||||
|
|
||||||
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -144,3 +144,4 @@ class Account(osv.osv):
|
||||||
}
|
}
|
||||||
|
|
||||||
Account()
|
Account()
|
||||||
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -20,3 +20,4 @@
|
||||||
#
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
import open_voucher
|
import open_voucher
|
||||||
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
##############################################################################
|
##############################################################################
|
||||||
from osv import fields,osv
|
from osv import fields,osv
|
||||||
from osv import orm
|
from osv import orm
|
||||||
|
from tools.translate import _
|
||||||
|
|
||||||
class analytic_user_funct_grid(osv.osv):
|
class analytic_user_funct_grid(osv.osv):
|
||||||
|
|
||||||
|
@ -94,9 +95,9 @@ class hr_analytic_timesheet(osv.osv):
|
||||||
if not a:
|
if not a:
|
||||||
a = r.product_id.categ_id.property_account_expense_categ.id
|
a = r.product_id.categ_id.property_account_expense_categ.id
|
||||||
if not a:
|
if not a:
|
||||||
raise osv.except_osv('Error !',
|
raise osv.except_osv(_('Error !'),
|
||||||
'There is no expense account define ' \
|
_('There is no expense account define ' \
|
||||||
'for this product: "%s" (id:%d)' % \
|
'for this product: "%s" (id:%d)') % \
|
||||||
(r.product_id.name, r.product_id.id,))
|
(r.product_id.name, r.product_id.id,))
|
||||||
amount = unit_amount * self.pool.get('product.uom')._compute_price(cr, uid,
|
amount = unit_amount * self.pool.get('product.uom')._compute_price(cr, uid,
|
||||||
r.product_id.uom_id.id, r.product_id.standard_price, False)
|
r.product_id.uom_id.id, r.product_id.standard_price, False)
|
||||||
|
@ -127,9 +128,9 @@ class hr_analytic_timesheet(osv.osv):
|
||||||
if not a:
|
if not a:
|
||||||
a = r.product_id.categ_id.property_account_expense_categ.id
|
a = r.product_id.categ_id.property_account_expense_categ.id
|
||||||
if not a:
|
if not a:
|
||||||
raise osv.except_osv('Error !',
|
raise osv.except_osv(_('Error !'),
|
||||||
'There is no expense account define ' \
|
_('There is no expense account define ' \
|
||||||
'for this product: "%s" (id:%d)' % \
|
'for this product: "%s" (id:%d)') % \
|
||||||
(r.product_id.name, r.product_id.id,))
|
(r.product_id.name, r.product_id.id,))
|
||||||
amount = unit_amount * r.product_id.uom_id._compute_price(cr, uid,
|
amount = unit_amount * r.product_id.uom_id._compute_price(cr, uid,
|
||||||
r.product_id.uom_id.id, r.product_id.standard_price, False)
|
r.product_id.uom_id.id, r.product_id.standard_price, False)
|
||||||
|
|
|
@ -25,6 +25,7 @@ import netsvc
|
||||||
from osv import fields, osv, orm
|
from osv import fields, osv, orm
|
||||||
import ir
|
import ir
|
||||||
from mx import DateTime
|
from mx import DateTime
|
||||||
|
from tools.translate import _
|
||||||
|
|
||||||
#----------------------------------------------------------
|
#----------------------------------------------------------
|
||||||
# Auction Artists
|
# Auction Artists
|
||||||
|
@ -627,7 +628,7 @@ class auction_lots(osv.osv):
|
||||||
continue
|
continue
|
||||||
partner_r=self.pool.get('res.partner')
|
partner_r=self.pool.get('res.partner')
|
||||||
if not lot.ach_uid.id:
|
if not lot.ach_uid.id:
|
||||||
raise orm.except_orm('Missed buyer !', 'The object "%s" has no buyer assigned.' % (lot.name,))
|
raise orm.except_orm(_('Missed buyer !'), _('The object "%s" has no buyer assigned.') % (lot.name,))
|
||||||
else:
|
else:
|
||||||
partner_ref =lot.ach_uid.id
|
partner_ref =lot.ach_uid.id
|
||||||
lot_name = lot.obj_num
|
lot_name = lot.obj_num
|
||||||
|
@ -635,7 +636,7 @@ class auction_lots(osv.osv):
|
||||||
contact_addr_id = res['contact']
|
contact_addr_id = res['contact']
|
||||||
invoice_addr_id = res['invoice']
|
invoice_addr_id = res['invoice']
|
||||||
if not invoice_addr_id:
|
if not invoice_addr_id:
|
||||||
raise orm.except_orm('No Invoice Address', 'The Buyer "%s" has no Invoice Address.' % (contact_addr_id,))
|
raise orm.except_orm(_('No Invoice Address'), _('The Buyer "%s" has no Invoice Address.') % (contact_addr_id,))
|
||||||
inv = {
|
inv = {
|
||||||
'name': 'Auction proforma:' +lot.name,
|
'name': 'Auction proforma:' +lot.name,
|
||||||
'journal_id': lot.auction_id.journal_id.id,
|
'journal_id': lot.auction_id.journal_id.id,
|
||||||
|
@ -754,13 +755,13 @@ class auction_lots(osv.osv):
|
||||||
continue
|
continue
|
||||||
partner_r=self.pool.get('res.partner')
|
partner_r=self.pool.get('res.partner')
|
||||||
if not lot.ach_uid.id:
|
if not lot.ach_uid.id:
|
||||||
raise orm.except_orm('Missed buyer !', 'The object "%s" has no buyer assigned.' % (lot.name,))
|
raise orm.except_orm(_('Missed buyer !'), _('The object "%s" has no buyer assigned.') % (lot.name,))
|
||||||
if (lot.auction_id.id,lot.ach_uid.id) in invoices:
|
if (lot.auction_id.id,lot.ach_uid.id) in invoices:
|
||||||
inv_id = invoices[(lot.auction_id.id,lot.ach_uid.id)]
|
inv_id = invoices[(lot.auction_id.id,lot.ach_uid.id)]
|
||||||
else:
|
else:
|
||||||
add = partner_r.read(cr, uid, [lot.ach_uid.id], ['address'])[0]['address']
|
add = partner_r.read(cr, uid, [lot.ach_uid.id], ['address'])[0]['address']
|
||||||
if not len(add):
|
if not len(add):
|
||||||
raise orm.except_orm('Missed Address !', 'The Buyer has no Invoice Address.')
|
raise orm.except_orm(_('Missed Address !'), _('The Buyer has no Invoice Address.'))
|
||||||
price = lot.obj_price or 0.0
|
price = lot.obj_price or 0.0
|
||||||
lot_name =lot.obj_num
|
lot_name =lot.obj_num
|
||||||
inv={
|
inv={
|
||||||
|
|
|
@ -31,3 +31,4 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
__version__ = '0.9'
|
__version__ = '0.9'
|
||||||
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -319,3 +319,4 @@ class Code128(MultiWidthBarcode):
|
||||||
dval = dval + _patterns[c]
|
dval = dval + _patterns[c]
|
||||||
self.decomposed = dval
|
self.decomposed = dval
|
||||||
return self.decomposed
|
return self.decomposed
|
||||||
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -253,3 +253,4 @@ class Extended39(_Code39Base):
|
||||||
raise ValueError
|
raise ValueError
|
||||||
self.encoded = _encode39(self.encoded, self.checksum)
|
self.encoded = _encode39(self.encoded, self.checksum)
|
||||||
return self.encoded
|
return self.encoded
|
||||||
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -230,3 +230,4 @@ class Extended93(_Code93Base):
|
||||||
raise ValueError
|
raise ValueError
|
||||||
self.encoded = _encode93(self.encoded)
|
self.encoded = _encode93(self.encoded)
|
||||||
return self.encoded
|
return self.encoded
|
||||||
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -703,3 +703,4 @@ class Code11(Barcode):
|
||||||
dval = dval + self.patterns[c] + 'i'
|
dval = dval + self.patterns[c] + 'i'
|
||||||
self.decomposed = dval[:-1]
|
self.decomposed = dval[:-1]
|
||||||
return self.decomposed
|
return self.decomposed
|
||||||
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -79,3 +79,4 @@ _ozC_patterns = {
|
||||||
}
|
}
|
||||||
|
|
||||||
#http://www.auspost.com.au/futurepost/
|
#http://www.auspost.com.au/futurepost/
|
||||||
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -53,3 +53,4 @@ if __name__=='__main__':
|
||||||
run()
|
run()
|
||||||
|
|
||||||
|
|
||||||
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -229,3 +229,4 @@ class POSTNET(Barcode):
|
||||||
h = self.fbarheight
|
h = self.fbarheight
|
||||||
self.rect(left, 0.0, self.barwide, h)
|
self.rect(left, 0.0, self.barwide, h)
|
||||||
left = left + self.barwide + self.spacewide
|
left = left + self.barwide + self.spacewide
|
||||||
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -25,6 +25,7 @@ import pooler
|
||||||
import time
|
import time
|
||||||
from report import report_sxw
|
from report import report_sxw
|
||||||
from osv import osv
|
from osv import osv
|
||||||
|
from tools.translate import _
|
||||||
|
|
||||||
class buyer_list(report_sxw.rml_parse):
|
class buyer_list(report_sxw.rml_parse):
|
||||||
auc_lot_ids=[]
|
auc_lot_ids=[]
|
||||||
|
|
|
@ -30,6 +30,7 @@ import base64
|
||||||
import mimetypes
|
import mimetypes
|
||||||
import httplib
|
import httplib
|
||||||
import threading
|
import threading
|
||||||
|
from tools.translate import _
|
||||||
|
|
||||||
login_form = '''<?xml version="1.0"?>
|
login_form = '''<?xml version="1.0"?>
|
||||||
<form title="Login">
|
<form title="Login">
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
|
|
||||||
import wizard
|
import wizard
|
||||||
import netsvc
|
import netsvc
|
||||||
|
from tools.translate import _
|
||||||
|
|
||||||
login_form = '''<?xml version="1.0"?>
|
login_form = '''<?xml version="1.0"?>
|
||||||
<form title="Login">
|
<form title="Login">
|
||||||
|
|
|
@ -27,6 +27,7 @@ import netsvc
|
||||||
import pooler
|
import pooler
|
||||||
import string
|
import string
|
||||||
import time,copy
|
import time,copy
|
||||||
|
from tools.translate import _
|
||||||
|
|
||||||
class audittrail_rule(osv.osv):
|
class audittrail_rule(osv.osv):
|
||||||
_name = 'audittrail.rule'
|
_name = 'audittrail.rule'
|
||||||
|
@ -59,8 +60,8 @@ class audittrail_rule(osv.osv):
|
||||||
obj = self.pool.get(thisrule.object_id.model)
|
obj = self.pool.get(thisrule.object_id.model)
|
||||||
if not obj:
|
if not obj:
|
||||||
raise osv.except_osv(
|
raise osv.except_osv(
|
||||||
'WARNING:audittrail is not part of the pool',
|
_('WARNING:audittrail is not part of the pool'),
|
||||||
'Change audittrail depends -- Setting rule as DRAFT')
|
_('Change audittrail depends -- Setting rule as DRAFT'))
|
||||||
self.write(cr, uid, [thisrule.id], {"state": "draft"})
|
self.write(cr, uid, [thisrule.id], {"state": "draft"})
|
||||||
val={
|
val={
|
||||||
"name":'View Log',
|
"name":'View Log',
|
||||||
|
|
|
@ -26,6 +26,7 @@ import pooler
|
||||||
import tools
|
import tools
|
||||||
import os
|
import os
|
||||||
from xml.dom import minidom
|
from xml.dom import minidom
|
||||||
|
from tools.translate import _
|
||||||
|
|
||||||
info_start_form = '''<?xml version="1.0"?>
|
info_start_form = '''<?xml version="1.0"?>
|
||||||
<form string="Module Merging">
|
<form string="Module Merging">
|
||||||
|
|
|
@ -29,6 +29,7 @@ import base64
|
||||||
|
|
||||||
import module_zip
|
import module_zip
|
||||||
import tools
|
import tools
|
||||||
|
from tools.translate import _
|
||||||
|
|
||||||
intro_form = '''<?xml version="1.0"?>
|
intro_form = '''<?xml version="1.0"?>
|
||||||
<form string="Module publication">
|
<form string="Module publication">
|
||||||
|
|
|
@ -25,6 +25,7 @@ import pooler
|
||||||
import module_zip
|
import module_zip
|
||||||
from base_module_publish import post_multipart
|
from base_module_publish import post_multipart
|
||||||
from urllib import urlopen
|
from urllib import urlopen
|
||||||
|
from tools.translate import _
|
||||||
|
|
||||||
intro_form = '''<?xml version="1.0"?>
|
intro_form = '''<?xml version="1.0"?>
|
||||||
<form string="Module publication">
|
<form string="Module publication">
|
||||||
|
@ -102,7 +103,7 @@ def _upload(self, cr, uid, datas, context):
|
||||||
res['module_file'])
|
res['module_file'])
|
||||||
])
|
])
|
||||||
if result[0] == "1":
|
if result[0] == "1":
|
||||||
raise wizard.except_wizard('Error', 'Login failed!')
|
raise wizard.except_wizard(_('Error'), _('Login failed!'))
|
||||||
elif result[0] == "0":
|
elif result[0] == "0":
|
||||||
log[0].append(mod.name)
|
log[0].append(mod.name)
|
||||||
elif result[0] == "2":
|
elif result[0] == "2":
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
##############################################################################
|
##############################################################################
|
||||||
import pooler
|
import pooler
|
||||||
import addons
|
import addons
|
||||||
|
from tools.translate import _
|
||||||
|
|
||||||
def createzip(cr, uid, moduleid, context, b64enc=True, src=True):
|
def createzip(cr, uid, moduleid, context, b64enc=True, src=True):
|
||||||
pool = pooler.get_pool(cr.dbname)
|
pool = pooler.get_pool(cr.dbname)
|
||||||
|
|
|
@ -24,6 +24,7 @@ import string
|
||||||
import time
|
import time
|
||||||
import tools
|
import tools
|
||||||
from osv import fields,osv,orm
|
from osv import fields,osv,orm
|
||||||
|
from tools.translate import _
|
||||||
|
|
||||||
#class ir_model_fields(osv.osv):
|
#class ir_model_fields(osv.osv):
|
||||||
# _inherit = 'ir.model.fields'
|
# _inherit = 'ir.model.fields'
|
||||||
|
@ -216,7 +217,7 @@ class report_creator(osv.osv):
|
||||||
if reference_model_dict:
|
if reference_model_dict:
|
||||||
self.model_set_id = model_dict.get(reference_model_dict.keys()[reference_model_dict.values().index(min(reference_model_dict.values()))])
|
self.model_set_id = model_dict.get(reference_model_dict.keys()[reference_model_dict.values().index(min(reference_model_dict.values()))])
|
||||||
if model_list and not len(model_dict.keys()) == 1:
|
if model_list and not len(model_dict.keys()) == 1:
|
||||||
raise osv.except_osv("No Related Models!!",'These is/are model(s) (%s) in selection which is/are not related to any other model'%','.join(model_list) )
|
raise osv.except_osv(_('No Related Models!!'),_('These is/are model(s) (%s) in selection which is/are not related to any other model') % ','.join(model_list))
|
||||||
if filter_ids and where_list<>[]:
|
if filter_ids and where_list<>[]:
|
||||||
where_list.append('and')
|
where_list.append('and')
|
||||||
where_list.append(' ')
|
where_list.append(' ')
|
||||||
|
|
|
@ -27,6 +27,7 @@ import pooler
|
||||||
import urllib
|
import urllib
|
||||||
import base64
|
import base64
|
||||||
import tools
|
import tools
|
||||||
|
from tools.translate import _
|
||||||
|
|
||||||
intro_form = '''<?xml version="1.0"?>
|
intro_form = '''<?xml version="1.0"?>
|
||||||
<form string="Report designer">
|
<form string="Report designer">
|
||||||
|
|
|
@ -25,6 +25,7 @@ import time
|
||||||
import wizard
|
import wizard
|
||||||
import osv
|
import osv
|
||||||
import pooler
|
import pooler
|
||||||
|
from tools.translate import _
|
||||||
|
|
||||||
section_form = '''<?xml version="1.0"?>
|
section_form = '''<?xml version="1.0"?>
|
||||||
<form string="Create Menu For Dashboard">
|
<form string="Create Menu For Dashboard">
|
||||||
|
@ -42,7 +43,7 @@ def check_views(self, cr, uid, data, context):
|
||||||
pool = pooler.get_pool(cr.dbname)
|
pool = pooler.get_pool(cr.dbname)
|
||||||
board = pool.get('board.board').browse(cr, uid, data['id'])
|
board = pool.get('board.board').browse(cr, uid, data['id'])
|
||||||
if not board.line_ids:
|
if not board.line_ids:
|
||||||
raise wizard.except_wizard('User Error!',"Please Insert Dashboard View(s) !")
|
raise wizard.except_wizard(_('User Error!'),_('Please Insert Dashboard View(s) !'))
|
||||||
return data['form']
|
return data['form']
|
||||||
|
|
||||||
def board_menu_create(self, cr, uid, data, context):
|
def board_menu_create(self, cr, uid, data, context):
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
|
@ -20,3 +20,4 @@
|
||||||
#
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
|
@ -23,3 +23,4 @@ import crm_config
|
||||||
import report
|
import report
|
||||||
import wizard
|
import wizard
|
||||||
|
|
||||||
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -23,3 +23,4 @@
|
||||||
import meeting_planify
|
import meeting_planify
|
||||||
import wizard_partner_create
|
import wizard_partner_create
|
||||||
import wizard_opportunity_set
|
import wizard_opportunity_set
|
||||||
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -73,3 +73,4 @@ class make_meeting(wizard.interface):
|
||||||
|
|
||||||
make_meeting('crm.case.meeting')
|
make_meeting('crm.case.meeting')
|
||||||
|
|
||||||
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -26,6 +26,7 @@ import wizard
|
||||||
import netsvc
|
import netsvc
|
||||||
import ir
|
import ir
|
||||||
import pooler
|
import pooler
|
||||||
|
from tools.translate import _
|
||||||
|
|
||||||
case_form = """<?xml version="1.0"?>
|
case_form = """<?xml version="1.0"?>
|
||||||
<form string="Convert To Opportunity">
|
<form string="Convert To Opportunity">
|
||||||
|
@ -49,7 +50,7 @@ class make_opportunity(wizard.interface):
|
||||||
case_obj = pool.get('crm.case')
|
case_obj = pool.get('crm.case')
|
||||||
for case in case_obj.browse(cr, uid, data['ids']):
|
for case in case_obj.browse(cr, uid, data['ids']):
|
||||||
if not case.partner_id:
|
if not case.partner_id:
|
||||||
raise wizard.except_wizard("Warning !",
|
raise wizard.except_wizard(_('Warning !'),
|
||||||
_('You must assign a partner to this lead before converting to opportunity.\n' \
|
_('You must assign a partner to this lead before converting to opportunity.\n' \
|
||||||
'You can use the convert to partner button.'))
|
'You can use the convert to partner button.'))
|
||||||
return {'name': case.name, 'probability': case.probability or 20.0, 'planned_revenue':case.planned_revenue}
|
return {'name': case.name, 'probability': case.probability or 20.0, 'planned_revenue':case.planned_revenue}
|
||||||
|
@ -60,7 +61,7 @@ class make_opportunity(wizard.interface):
|
||||||
data_obj = pool.get('ir.model.data')
|
data_obj = pool.get('ir.model.data')
|
||||||
id = section_obj.search(cr, uid, [('code','=','oppor')], context=context)
|
id = section_obj.search(cr, uid, [('code','=','oppor')], context=context)
|
||||||
if not id:
|
if not id:
|
||||||
raise wizard.except_wizard(_("Error !"),
|
raise wizard.except_wizard(_('Error !'),
|
||||||
_('You did not installed the opportunities tracking when you configured the crm_configuration module.' \
|
_('You did not installed the opportunities tracking when you configured the crm_configuration module.' \
|
||||||
'\nI can not convert the lead to an opportunity, you must create a section with the code \'oppor\'.'
|
'\nI can not convert the lead to an opportunity, you must create a section with the code \'oppor\'.'
|
||||||
))
|
))
|
||||||
|
@ -106,3 +107,4 @@ class make_opportunity(wizard.interface):
|
||||||
|
|
||||||
make_opportunity('crm.case.opportunity_set')
|
make_opportunity('crm.case.opportunity_set')
|
||||||
|
|
||||||
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -26,6 +26,7 @@ import wizard
|
||||||
import netsvc
|
import netsvc
|
||||||
import ir
|
import ir
|
||||||
import pooler
|
import pooler
|
||||||
|
from tools.translate import _
|
||||||
|
|
||||||
case_form = """<?xml version="1.0"?>
|
case_form = """<?xml version="1.0"?>
|
||||||
<form string="Convert To Partner">
|
<form string="Convert To Partner">
|
||||||
|
@ -46,7 +47,7 @@ class make_partner(wizard.interface):
|
||||||
case_obj = pool.get('crm.case')
|
case_obj = pool.get('crm.case')
|
||||||
for case in case_obj.browse(cr, uid, data['ids']):
|
for case in case_obj.browse(cr, uid, data['ids']):
|
||||||
if case.partner_id:
|
if case.partner_id:
|
||||||
raise wizard.except_wizard("Warning !",
|
raise wizard.except_wizard(_('Warning !'),
|
||||||
_('A partner is already defined on this lead.'))
|
_('A partner is already defined on this lead.'))
|
||||||
return {}
|
return {}
|
||||||
|
|
||||||
|
@ -58,7 +59,7 @@ class make_partner(wizard.interface):
|
||||||
for case in case_obj.browse(cr, uid, data['ids']):
|
for case in case_obj.browse(cr, uid, data['ids']):
|
||||||
partner_id = partner_obj.search(cr, uid, [('name', '=', case.partner_name or case.name)])
|
partner_id = partner_obj.search(cr, uid, [('name', '=', case.partner_name or case.name)])
|
||||||
if partner_id:
|
if partner_id:
|
||||||
raise wizard.except_wizard("Warning !",_('A partner is already existing with the same name.'))
|
raise wizard.except_wizard(_('Warning !'),_('A partner is already existing with the same name.'))
|
||||||
else:
|
else:
|
||||||
partner_id = partner_obj.create(cr, uid, {
|
partner_id = partner_obj.create(cr, uid, {
|
||||||
'name': case.partner_name or case.name,
|
'name': case.partner_name or case.name,
|
||||||
|
|
|
@ -20,3 +20,4 @@
|
||||||
#
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
#import crm_vertical
|
#import crm_vertical
|
||||||
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -26,6 +26,7 @@ from osv import fields,osv,orm
|
||||||
import os
|
import os
|
||||||
import mx.DateTime
|
import mx.DateTime
|
||||||
import base64
|
import base64
|
||||||
|
from tools.translate import _
|
||||||
|
|
||||||
# here need to implement inheritance on osv_memory object. after that, it will work well.
|
# here need to implement inheritance on osv_memory object. after that, it will work well.
|
||||||
class crm_menu_config_wizard(osv.osv_memory):
|
class crm_menu_config_wizard(osv.osv_memory):
|
||||||
|
@ -40,7 +41,8 @@ class crm_menu_config_wizard(osv.osv_memory):
|
||||||
try:
|
try:
|
||||||
tools.convert_xml_import(cr, 'crm_configuration', tools.file_open(os.path.join('crm_vertical',file_name )), {}, 'init', *args)
|
tools.convert_xml_import(cr, 'crm_configuration', tools.file_open(os.path.join('crm_vertical',file_name )), {}, 'init', *args)
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
raise osv.except_osv('Error !', e)
|
raise osv.except_osv(_('Error !'), str(e))
|
||||||
return res
|
return res
|
||||||
|
|
||||||
crm_menu_config_wizard()
|
crm_menu_config_wizard()
|
||||||
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -38,6 +38,7 @@ import string
|
||||||
from psycopg2 import Binary
|
from psycopg2 import Binary
|
||||||
from tools import config
|
from tools import config
|
||||||
import tools
|
import tools
|
||||||
|
from tools.translate import _
|
||||||
|
|
||||||
def random_name():
|
def random_name():
|
||||||
random.seed()
|
random.seed()
|
||||||
|
@ -376,14 +377,14 @@ class document_directory(osv.osv):
|
||||||
return True
|
return True
|
||||||
def write(self, cr, uid, ids, vals, context=None):
|
def write(self, cr, uid, ids, vals, context=None):
|
||||||
if not self._check_duplication(cr,uid,vals,ids,op='write'):
|
if not self._check_duplication(cr,uid,vals,ids,op='write'):
|
||||||
raise osv.except_osv('ValidateError', _('Directory name must be unique!'))
|
raise osv.except_osv(_('ValidateError'), _('Directory name must be unique!'))
|
||||||
return super(document_directory,self).write(cr,uid,ids,vals,context=context)
|
return super(document_directory,self).write(cr,uid,ids,vals,context=context)
|
||||||
|
|
||||||
def create(self, cr, uid, vals, context=None):
|
def create(self, cr, uid, vals, context=None):
|
||||||
if not self._check_duplication(cr,uid,vals):
|
if not self._check_duplication(cr,uid,vals):
|
||||||
raise osv.except_osv('ValidateError', _('Directory name must be unique!'))
|
raise osv.except_osv(_('ValidateError'), _('Directory name must be unique!'))
|
||||||
if vals.get('name',False) and (vals.get('name').find('/')+1 or vals.get('name').find('@')+1 or vals.get('name').find('$')+1 or vals.get('name').find('#')+1) :
|
if vals.get('name',False) and (vals.get('name').find('/')+1 or vals.get('name').find('@')+1 or vals.get('name').find('$')+1 or vals.get('name').find('#')+1) :
|
||||||
raise osv.except_osv('ValidateError', _('Directory name contains special characters!'))
|
raise osv.except_osv(_('ValidateError'), _('Directory name contains special characters!'))
|
||||||
return super(document_directory,self).create(cr, uid, vals, context)
|
return super(document_directory,self).create(cr, uid, vals, context)
|
||||||
|
|
||||||
document_directory()
|
document_directory()
|
||||||
|
@ -516,7 +517,7 @@ class document_file(osv.osv):
|
||||||
try:
|
try:
|
||||||
os.makedirs(path)
|
os.makedirs(path)
|
||||||
except:
|
except:
|
||||||
raise except_orm('Permission Denied !', 'You do not permissions to write on the server side.')
|
raise except_orm(_('Permission Denied !'), _('You do not permissions to write on the server side.'))
|
||||||
|
|
||||||
flag = None
|
flag = None
|
||||||
# This can be improved
|
# This can be improved
|
||||||
|
@ -534,7 +535,7 @@ class document_file(osv.osv):
|
||||||
cr.execute('update ir_attachment set store_fname=%s,store_method=%s,file_size=%s where id=%s', (os.path.join(flag,filename),'fs',len(v),id))
|
cr.execute('update ir_attachment set store_fname=%s,store_method=%s,file_size=%s where id=%s', (os.path.join(flag,filename),'fs',len(v),id))
|
||||||
return True
|
return True
|
||||||
except Exception,e :
|
except Exception,e :
|
||||||
raise except_orm('Error!', str(e))
|
raise except_orm(_('Error!'), str(e))
|
||||||
|
|
||||||
_columns = {
|
_columns = {
|
||||||
'user_id': fields.many2one('res.users', 'Owner', select=1),
|
'user_id': fields.many2one('res.users', 'Owner', select=1),
|
||||||
|
@ -598,7 +599,7 @@ class document_file(osv.osv):
|
||||||
if not len(res):
|
if not len(res):
|
||||||
return False
|
return False
|
||||||
if not self._check_duplication(cr,uid,vals,ids,'write'):
|
if not self._check_duplication(cr,uid,vals,ids,'write'):
|
||||||
raise except_orm('ValidateError', 'File name must be unique!')
|
raise except_orm(_('ValidateError'), _('File name must be unique!'))
|
||||||
result = super(document_file,self).write(cr,uid,ids,vals,context=context)
|
result = super(document_file,self).write(cr,uid,ids,vals,context=context)
|
||||||
cr.commit()
|
cr.commit()
|
||||||
try:
|
try:
|
||||||
|
@ -651,7 +652,7 @@ class document_file(osv.osv):
|
||||||
datas=vals.get('datas',False)
|
datas=vals.get('datas',False)
|
||||||
vals['file_size']= len(datas)
|
vals['file_size']= len(datas)
|
||||||
if not self._check_duplication(cr,uid,vals):
|
if not self._check_duplication(cr,uid,vals):
|
||||||
raise except_orm('ValidateError', 'File name must be unique!')
|
raise except_orm(_('ValidateError'), _('File name must be unique!'))
|
||||||
result = super(document_file,self).create(cr, uid, vals, context)
|
result = super(document_file,self).create(cr, uid, vals, context)
|
||||||
cr.commit()
|
cr.commit()
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -21,3 +21,4 @@
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
import document
|
import document
|
||||||
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -25,6 +25,7 @@ import time
|
||||||
import netsvc
|
import netsvc
|
||||||
import pooler
|
import pooler
|
||||||
import tools
|
import tools
|
||||||
|
from tools.translate import _
|
||||||
|
|
||||||
class crm_case_log(osv.osv):
|
class crm_case_log(osv.osv):
|
||||||
_inherit = 'crm.case.log'
|
_inherit = 'crm.case.log'
|
||||||
|
|
|
@ -78,3 +78,4 @@ class confirm_registration(wizard.interface):
|
||||||
}
|
}
|
||||||
|
|
||||||
confirm_registration('event.confirm_registration')
|
confirm_registration('event.confirm_registration')
|
||||||
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -21,13 +21,14 @@
|
||||||
##############################################################################
|
##############################################################################
|
||||||
import wizard
|
import wizard
|
||||||
import pooler
|
import pooler
|
||||||
|
from tools.translate import _
|
||||||
|
|
||||||
def _event_tasks(self, cr, uid, data, context):
|
def _event_tasks(self, cr, uid, data, context):
|
||||||
event_id = data['id']
|
event_id = data['id']
|
||||||
cr.execute('SELECT project_id FROM event_event WHERE id = %s', (event_id, ))
|
cr.execute('SELECT project_id FROM event_event WHERE id = %s', (event_id, ))
|
||||||
res = cr.fetchone()
|
res = cr.fetchone()
|
||||||
if not res[0]:
|
if not res[0]:
|
||||||
raise wizard.except_wizard('Error !', 'No project defined for this event.\nYou can create one with the retro-planning button !')
|
raise wizard.except_wizard(_('Error !'), _('No project defined for this event.\nYou can create one with the retro-planning button !'))
|
||||||
value = {
|
value = {
|
||||||
'domain': [('project_id', '=', res[0])],
|
'domain': [('project_id', '=', res[0])],
|
||||||
'name': 'Tasks',
|
'name': 'Tasks',
|
||||||
|
|
|
@ -171,3 +171,4 @@ class hr_timesheet(osv.osv):
|
||||||
hr_timesheet()
|
hr_timesheet()
|
||||||
|
|
||||||
|
|
||||||
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -34,7 +34,7 @@ import pooler
|
||||||
import netsvc
|
import netsvc
|
||||||
import datetime
|
import datetime
|
||||||
from osv import fields, osv
|
from osv import fields, osv
|
||||||
|
from tools.translate import _
|
||||||
|
|
||||||
def _employee_get(obj,cr,uid,context={}):
|
def _employee_get(obj,cr,uid,context={}):
|
||||||
ids = obj.pool.get('hr.employee').search(cr, uid, [('user_id','=', uid)])
|
ids = obj.pool.get('hr.employee').search(cr, uid, [('user_id','=', uid)])
|
||||||
|
@ -206,7 +206,7 @@ class hr_holidays(osv.osv):
|
||||||
leaves_rest=obj_holidays_per_user.max_leaves - obj_holidays_per_user.leaves_taken
|
leaves_rest=obj_holidays_per_user.max_leaves - obj_holidays_per_user.leaves_taken
|
||||||
if not obj_holidays_per_user.holiday_status.limit:
|
if not obj_holidays_per_user.holiday_status.limit:
|
||||||
if leaves_rest < leave_asked:
|
if leaves_rest < leave_asked:
|
||||||
raise osv.except_osv('Attention!','You Cannot Validate leaves while available leaves are less than asked leaves.')
|
raise osv.except_osv(_('Attention!'),_('You Cannot Validate leaves while available leaves are less than asked leaves.'))
|
||||||
self.pool.get('hr.holidays.per.user').write(cr,uid,obj_holidays_per_user.id,{'leaves_taken':obj_holidays_per_user.leaves_taken + leave_asked})
|
self.pool.get('hr.holidays.per.user').write(cr,uid,obj_holidays_per_user.id,{'leaves_taken':obj_holidays_per_user.leaves_taken + leave_asked})
|
||||||
if record.holiday_status.section_id:
|
if record.holiday_status.section_id:
|
||||||
vals={}
|
vals={}
|
||||||
|
|
|
@ -24,7 +24,7 @@ import time
|
||||||
from osv import fields
|
from osv import fields
|
||||||
from osv import osv
|
from osv import osv
|
||||||
from osv.orm import except_orm
|
from osv.orm import except_orm
|
||||||
|
from tools.translate import _
|
||||||
|
|
||||||
class hr_employee(osv.osv):
|
class hr_employee(osv.osv):
|
||||||
_name = "hr.employee"
|
_name = "hr.employee"
|
||||||
|
@ -124,7 +124,7 @@ class hr_analytic_timesheet(osv.osv):
|
||||||
raise except_orm(_('ValidateError'),
|
raise except_orm(_('ValidateError'),
|
||||||
_('No analytic account defined on the project.\nPlease set one or we can not automatically fill the timesheet.'))
|
_('No analytic account defined on the project.\nPlease set one or we can not automatically fill the timesheet.'))
|
||||||
else:
|
else:
|
||||||
raise
|
raise except_orm(_('UnknownError'), str(e))
|
||||||
|
|
||||||
def on_change_user_id(self, cr, uid, ids, user_id):
|
def on_change_user_id(self, cr, uid, ids, user_id):
|
||||||
if not user_id:
|
if not user_id:
|
||||||
|
|
|
@ -20,4 +20,6 @@
|
||||||
#
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
import account_vat_declaration
|
import account_vat_declaration
|
||||||
import partner_vat_listing
|
import partner_vat_listing
|
||||||
|
|
||||||
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -127,3 +127,4 @@ class wizard_vat_declaration(wizard.interface):
|
||||||
}
|
}
|
||||||
|
|
||||||
wizard_vat_declaration('wizard.account.xml.vat.declaration')
|
wizard_vat_declaration('wizard.account.xml.vat.declaration')
|
||||||
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -24,6 +24,7 @@ import time
|
||||||
import datetime
|
import datetime
|
||||||
import pooler
|
import pooler
|
||||||
import base64
|
import base64
|
||||||
|
from tools.translate import _
|
||||||
|
|
||||||
form = """<?xml version="1.0"?>
|
form = """<?xml version="1.0"?>
|
||||||
<form string="Select Fiscal Year">
|
<form string="Select Fiscal Year">
|
||||||
|
@ -67,7 +68,7 @@ class wizard_vat(wizard.interface):
|
||||||
obj_cmpny = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, uid).company_id
|
obj_cmpny = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, uid).company_id
|
||||||
company_vat = obj_cmpny.partner_id.vat
|
company_vat = obj_cmpny.partner_id.vat
|
||||||
if not company_vat:
|
if not company_vat:
|
||||||
raise wizard.except_wizard('Data Insufficient','No VAT Number Associated with Main Company!')
|
raise wizard.except_wizard(_('Data Insufficient'),_('No VAT Number Associated with Main Company!'))
|
||||||
|
|
||||||
cref = company_vat + seq_controlref
|
cref = company_vat + seq_controlref
|
||||||
dnum = cref + seq_declarantnum
|
dnum = cref + seq_declarantnum
|
||||||
|
@ -75,7 +76,7 @@ class wizard_vat(wizard.interface):
|
||||||
p_id_list=pooler.get_pool(cr.dbname).get('res.partner').search(cr,uid,[('vat_subjected','!=',False)])
|
p_id_list=pooler.get_pool(cr.dbname).get('res.partner').search(cr,uid,[('vat_subjected','!=',False)])
|
||||||
|
|
||||||
if not p_id_list:
|
if not p_id_list:
|
||||||
raise wizard.except_wizard('Data Insufficient!','No partner has a VAT Number asociated with him.')
|
raise wizard.except_wizard(_('Data Insufficient!'),_('No partner has a VAT Number asociated with him.'))
|
||||||
obj_year=pooler.get_pool(cr.dbname).get('account.fiscalyear').browse(cr,uid,data['form']['fyear'])
|
obj_year=pooler.get_pool(cr.dbname).get('account.fiscalyear').browse(cr,uid,data['form']['fyear'])
|
||||||
period_ids = pooler.get_pool(cr.dbname).get('account.period').search(cr, uid, [('fiscalyear_id', '=', data['form']['fyear'])])
|
period_ids = pooler.get_pool(cr.dbname).get('account.period').search(cr, uid, [('fiscalyear_id', '=', data['form']['fyear'])])
|
||||||
period = "("+','.join(map(lambda x: str(x), period_ids)) +")"
|
period = "("+','.join(map(lambda x: str(x), period_ids)) +")"
|
||||||
|
@ -193,3 +194,4 @@ class wizard_vat(wizard.interface):
|
||||||
}
|
}
|
||||||
|
|
||||||
wizard_vat('list.vat.detail')
|
wizard_vat('list.vat.detail')
|
||||||
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -41,3 +41,4 @@ import payment
|
||||||
import report
|
import report
|
||||||
import bank
|
import bank
|
||||||
import account_move_line
|
import account_move_line
|
||||||
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -107,3 +107,4 @@ TODO :
|
||||||
"active": False,
|
"active": False,
|
||||||
"installable": True,
|
"installable": True,
|
||||||
}
|
}
|
||||||
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -68,3 +68,4 @@ class AccountMoveLine(osv.osv):
|
||||||
return line2bank
|
return line2bank
|
||||||
|
|
||||||
AccountMoveLine()
|
AccountMoveLine()
|
||||||
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -43,3 +43,4 @@ class Bank(osv.osv):
|
||||||
}
|
}
|
||||||
|
|
||||||
Bank()
|
Bank()
|
||||||
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -47,3 +47,4 @@ class res_company(osv.osv):
|
||||||
}
|
}
|
||||||
res_company()
|
res_company()
|
||||||
|
|
||||||
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -93,3 +93,4 @@ class account_dta_line(osv.osv):
|
||||||
account_dta_line()
|
account_dta_line()
|
||||||
|
|
||||||
|
|
||||||
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -207,4 +207,6 @@ class account_tax_code(osv.osv):
|
||||||
### The case code of the taxt code
|
### The case code of the taxt code
|
||||||
'code': fields.char('Case Code', size=512),
|
'code': fields.char('Case Code', size=512),
|
||||||
}
|
}
|
||||||
account_tax_code()
|
account_tax_code()
|
||||||
|
|
||||||
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -96,3 +96,4 @@ class res_partner_bank(osv.osv):
|
||||||
|
|
||||||
|
|
||||||
res_partner_bank()
|
res_partner_bank()
|
||||||
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -41,3 +41,4 @@ class payment_order(osv.osv):
|
||||||
return 'l10n_ch','wizard_account_dta_create'
|
return 'l10n_ch','wizard_account_dta_create'
|
||||||
return super(payment_order,self).get_wizard(mode)
|
return super(payment_order,self).get_wizard(mode)
|
||||||
payment_order()
|
payment_order()
|
||||||
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -31,3 +31,4 @@
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
import bvr
|
import bvr
|
||||||
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -100,3 +100,4 @@ report_sxw.report_sxw(
|
||||||
parser=account_invoice_bvr,
|
parser=account_invoice_bvr,
|
||||||
header=False)
|
header=False)
|
||||||
|
|
||||||
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -339,3 +339,4 @@ if __name__ == "__main__":
|
||||||
result = style.applyStylesheet(doc, None)
|
result = style.applyStylesheet(doc, None)
|
||||||
xml = style.saveResultToString(result)
|
xml = style.saveResultToString(result)
|
||||||
print xml
|
print xml
|
||||||
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -34,3 +34,4 @@ import dta_wizard
|
||||||
import wizard_bvr
|
import wizard_bvr
|
||||||
import bvr_import
|
import bvr_import
|
||||||
import journal_config
|
import journal_config
|
||||||
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -35,6 +35,8 @@ import base64
|
||||||
import time
|
import time
|
||||||
from tools import mod10r
|
from tools import mod10r
|
||||||
import re
|
import re
|
||||||
|
from tools.translate import _
|
||||||
|
|
||||||
ASK_FORM = """<?xml version="1.0"?>
|
ASK_FORM = """<?xml version="1.0"?>
|
||||||
<form string="BVR Import">
|
<form string="BVR Import">
|
||||||
<field name="file"/>
|
<field name="file"/>
|
||||||
|
@ -103,12 +105,12 @@ def _import(obj, cursor, user, data, context):
|
||||||
|
|
||||||
if line[0:3] in ('999', '995'):
|
if line[0:3] in ('999', '995'):
|
||||||
if find_total:
|
if find_total:
|
||||||
raise wizard.except_wizard('Error',
|
raise wizard.except_wizard(_('Error'),
|
||||||
'Too much total record found!')
|
_('Too much total record found!'))
|
||||||
find_total = True
|
find_total = True
|
||||||
if lines:
|
if lines:
|
||||||
raise wizard.except_wizard('Error',
|
raise wizard.except_wizard(_('Error'),
|
||||||
'Record found after total record!')
|
_('Record found after total record!'))
|
||||||
amount = float(line[39:49]) + (float(line[49:51]) / 100)
|
amount = float(line[39:49]) + (float(line[49:51]) / 100)
|
||||||
cost = float(line[69:76]) + (float(line[76:78]) / 100)
|
cost = float(line[69:76]) + (float(line[76:78]) / 100)
|
||||||
if line[2] == '5':
|
if line[2] == '5':
|
||||||
|
@ -117,11 +119,11 @@ def _import(obj, cursor, user, data, context):
|
||||||
|
|
||||||
if round(amount - total_amount, 2) >= 0.01 \
|
if round(amount - total_amount, 2) >= 0.01 \
|
||||||
or round(cost - total_cost, 2) >= 0.01:
|
or round(cost - total_cost, 2) >= 0.01:
|
||||||
raise wizard.except_wizard('Error',
|
raise wizard.except_wizard(_('Error'),
|
||||||
'Total record different from the computed!')
|
_('Total record different from the computed!'))
|
||||||
if int(line[51:63]) != len(records):
|
if int(line[51:63]) != len(records):
|
||||||
raise wizard.except_wizard('Error',
|
raise wizard.except_wizard(_('Error'),
|
||||||
'Number record different from the computed!')
|
_('Number record different from the computed!'))
|
||||||
else:
|
else:
|
||||||
record = {
|
record = {
|
||||||
'reference': line[12:39],
|
'reference': line[12:39],
|
||||||
|
@ -132,8 +134,8 @@ def _import(obj, cursor, user, data, context):
|
||||||
}
|
}
|
||||||
|
|
||||||
if record['reference'] != mod10r(record['reference'][:-1]):
|
if record['reference'] != mod10r(record['reference'][:-1]):
|
||||||
raise wizard.except_wizard('Error',
|
raise wizard.except_wizard(_('Error'),
|
||||||
'Recursive mod10 is invalid for reference: %s' % \
|
_('Recursive mod10 is invalid for reference: %s') % \
|
||||||
record['reference'])
|
record['reference'])
|
||||||
|
|
||||||
if line[2] == '5':
|
if line[2] == '5':
|
||||||
|
@ -202,8 +204,8 @@ def _import(obj, cursor, user, data, context):
|
||||||
else:
|
else:
|
||||||
account_id = account_payable
|
account_id = account_payable
|
||||||
if not account_id :
|
if not account_id :
|
||||||
raise wizard.except_wizard('Error',
|
raise wizard.except_wizard(_('Error'),
|
||||||
'The properties account payable account receivable')
|
_('The properties account payable account receivable'))
|
||||||
values['account_id'] = account_id
|
values['account_id'] = account_id
|
||||||
values['partner_id'] = partner_id
|
values['partner_id'] = partner_id
|
||||||
|
|
||||||
|
@ -248,3 +250,4 @@ class BVRImport(wizard.interface):
|
||||||
}
|
}
|
||||||
|
|
||||||
BVRImport('l10n_ch.bvr_import')
|
BVRImport('l10n_ch.bvr_import')
|
||||||
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue