diff --git a/addons/account/__terp__.py b/addons/account/__terp__.py
index c7f1dc9e149..921dc8c8cb9 100644
--- a/addons/account/__terp__.py
+++ b/addons/account/__terp__.py
@@ -23,7 +23,7 @@
{
"name" : "Accounting and Financial Management",
"version" : "1.1",
- "depends" : ["product", "base", "process"],
+ "depends" : ["product", "analytic", "process"],
"author" : "Tiny",
"description": """Financial and accounting module that covers:
General accounting
diff --git a/addons/account/account.py b/addons/account/account.py
index 29ea824f171..ed460c041c7 100644
--- a/addons/account/account.py
+++ b/addons/account/account.py
@@ -1748,15 +1748,6 @@ class account_config_wizard(osv.osv_memory):
_name = 'account.config.wizard'
_inherit = 'res.config'
- def _get_charts(self, cr, uid, context):
- module_obj=self.pool.get('ir.module.module')
- ids=module_obj.search(cr, uid, [('category_id', '=', 'Account Charts'),
- ('state', '<>', 'installed')])
- res=[(m.id, m.shortdesc) for m in module_obj.browse(cr, uid, ids)]
- res.append((-1, 'None'))
- res.sort(key=lambda x: x[1])
- return res
-
_columns = {
'name':fields.char(
'Name', required=True, size=64,
@@ -1768,7 +1759,6 @@ class account_config_wizard(osv.osv_memory):
'date2': fields.date('End Date', required=True),
'period':fields.selection([('month','Month'), ('3months','3 Months')],
'Periods', required=True),
- 'charts' : fields.selection(_get_charts, 'Charts of Account',required=True)
}
_defaults = {
'code': lambda *a: time.strftime('%Y'),
@@ -1777,14 +1767,6 @@ class account_config_wizard(osv.osv_memory):
'date2': lambda *a: time.strftime('%Y-12-31'),
'period':lambda *a:'month',
}
- def install_account_chart(self, cr, uid, ids, context=None):
- for res in self.read(cr,uid,ids):
- chart_id = res['charts']
- if chart_id > 0:
- mod_obj = self.pool.get('ir.module.module')
- mod_obj.button_install(cr, uid, [chart_id], context=context)
- cr.commit()
- db, pool = pooler.restart_pool(cr.dbname, update_module=True)
def execute(self, cr, uid, ids, context=None):
for res in self.read(cr,uid,ids):
@@ -1804,7 +1786,6 @@ class account_config_wizard(osv.osv_memory):
res_obj.create_period(cr,uid,[new_id])
elif res['period']=='3months':
res_obj.create_period3(cr,uid,[new_id])
- self.install_account_chart(cr,uid,ids)
account_config_wizard()
diff --git a/addons/account/account_installer.xml b/addons/account/account_installer.xml
index 4a1a1274e9f..4c9742fd127 100644
--- a/addons/account/account_installer.xml
+++ b/addons/account/account_installer.xml
@@ -4,43 +4,31 @@
account.installer.view
account.installer
form
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Install Modules
+
+ Configure Your Accounting System
+
+
+ You can enhance OpenERP's basic accounting support with a few additional OpenERP applications
+
+
+
+
+
+
+
+
+
+
@@ -57,7 +45,7 @@
- 1
+ 3
diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml
index a76a7c015a6..9985e134fb0 100644
--- a/addons/account/account_invoice_view.xml
+++ b/addons/account/account_invoice_view.xml
@@ -355,8 +355,8 @@
-
- Panding Invoice
+
+ Pending Invoice
account.invoice
form
tree,form,calendar,graph
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index 709009f8481..4ab7e6329a9 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -1451,9 +1451,9 @@
-
+
@@ -1461,8 +1461,6 @@
-
-
@@ -1734,16 +1732,14 @@
-
+
-
+
diff --git a/addons/account/company.py b/addons/account/company.py
index e3a1979daf2..2301cc16d9a 100644
--- a/addons/account/company.py
+++ b/addons/account/company.py
@@ -33,52 +33,3 @@ out after this mail was sent, please consider the present one as \
void. Do not hesitate to contact our accounting department'
}
res_company()
-
-class company_setup(osv.osv_memory):
- """
- Insert Information for a company.
- Wizard asks for:
- * A Company with its partner
- * Insert a suitable message for Overdue Payment Report.
- """
- _name='wizard.company.setup'
- _inherit = 'res.config'
-
- _columns = {
- 'company_id':fields.many2one('res.company','Company',required=True),
- 'overdue_msg': fields.text('Overdue Payment Message'),
- }
- def get_message(self,cr,uid,context={}):
- company =self.pool.get('res.users').browse(cr,uid,[uid],context)[0].company_id
- msg = company.overdue_msg
- phone = company.partner_id.address and (company.partner_id.address[0].phone and ' at ' + str(company.partner_id.address[0].phone) + '.' or '.') or '.'
- msg += str(phone)
- return msg
-
- _defaults = {
- 'company_id': lambda self, cr, uid, c: self.pool.get('res.users').browse(cr,uid,[uid],c)[0].company_id.id,
- 'overdue_msg': get_message,
- }
-
- def onchange_company_id(self, cr, uid, ids, company, context=None):
- if not company:
- return {}
- comp_obj = self.pool.get('res.company').browse(cr,uid,company)
- partner_address = comp_obj.partner_id.address
- if partner_address and partner_address[0].phone:
- msg_tail = ' at %s.'%(partner_address[0].phone)
- else:
- msg_tail = '.'
-
- return {'value': {'overdue_msg': comp_obj.overdue_msg + msg_tail } }
-
- def execute(self, cr, uid, ids, context=None):
- content_wiz = self.pool.get('wizard.company.setup')\
- .read(cr,uid,ids,['company_id','overdue_msg'])
- if content_wiz:
- wiz_data = content_wiz[0]
- self.pool.get('res.company').write(
- cr, uid,
- [wiz_data['company_id']],
- {'overdue_msg':wiz_data['overdue_msg']})
-company_setup()
diff --git a/addons/account/company_view.xml b/addons/account/company_view.xml
index 31f8e03a6b3..7892fceee91 100644
--- a/addons/account/company_view.xml
+++ b/addons/account/company_view.xml
@@ -15,45 +15,5 @@
-
-
-
-
- wizard.company.setup.form
- wizard.company.setup
- form
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Overdue Payment Report Message
- ir.actions.act_window
- wizard.company.setup
-
- form
- form
- new
-
-
-
-
-
-
-
diff --git a/addons/account/i18n/ru.po b/addons/account/i18n/ru.po
index 020c123a932..2a98f3b7c9a 100644
--- a/addons/account/i18n/ru.po
+++ b/addons/account/i18n/ru.po
@@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 5.0.0\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2010-01-15 22:28+0000\n"
-"Last-Translator: Alex Mr.Brightside Demurine \n"
+"PO-Revision-Date: 2010-02-06 19:29+0000\n"
+"Last-Translator: Santjaga \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-01-16 04:35+0000\n"
+"X-Launchpad-Export-Date: 2010-02-07 04:37+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account
@@ -97,7 +97,7 @@ msgstr "Несогласованные проводки"
#: field:account.tax,base_code_id:0
#: field:account.tax.template,base_code_id:0
msgid "Base Code"
-msgstr ""
+msgstr "Базовый Код"
#. module: account
#: view:account.account:0
@@ -157,7 +157,7 @@ msgstr "Проводки"
#. module: account
#: selection:account.move.line,centralisation:0
msgid "Debit Centralisation"
-msgstr ""
+msgstr "Централизация Дебета"
#. module: account
#: model:ir.actions.wizard,name:account.wizard_invoice_state_confirm
@@ -343,7 +343,7 @@ msgstr "Номер счета"
#. module: account
#: rml:account.analytic.account.analytic.check:0
msgid "Delta Debit"
-msgstr ""
+msgstr "Дебетовое сальдо"
#. module: account
#: rml:account.invoice:0
@@ -369,7 +369,7 @@ msgstr "Счет аналитического учета"
#: field:account.tax,child_depend:0
#: field:account.tax.template,child_depend:0
msgid "Tax on Children"
-msgstr ""
+msgstr "Налог на детей"
#. module: account
#: rml:account.central.journal:0
diff --git a/addons/account/installer.py b/addons/account/installer.py
index 2e7ebb5ed44..35a09406891 100644
--- a/addons/account/installer.py
+++ b/addons/account/installer.py
@@ -18,21 +18,61 @@
# along with this program. If not, see .
#
##############################################################################
+from operator import itemgetter
+
from osv import fields, osv
+import netsvc
class account_installer(osv.osv_memory):
_name = 'account.installer'
_inherit = 'res.config.installer'
+ def _get_charts(self, cr, uid, context=None):
+ modules = self.pool.get('ir.module.module')
+ ids = modules.search(cr, uid, [('category_id','=','Account Charts')])
+ return list(
+ sorted(((m.name, m.shortdesc)
+ for m in modules.browse(cr, uid, ids)),
+ key=itemgetter(1)))
+
_columns = {
# Accounting
- 'account_analytic_default':fields.boolean('Analytic Accounting'),
- 'account_analytic_plans':fields.boolean('Multiple Analytic Plans'),
- 'account_payment':fields.boolean('Suppliers Payment Management'),
- 'account_followup':fields.boolean('Followups Management'),
- 'account_asset':fields.boolean('Assets Management')
+ 'charts':fields.selection(_get_charts, 'Chart of Accounts',
+ required=True,
+ help="Installs localized accounting charts to match as closely as "
+ "possible the accounting needs of your company based on your "
+ "country."),
+ 'account_analytic_default':fields.boolean('Analytic Accounting',
+ help="Automatically selects analytic accounts based on various "
+ "criteria."),
+ 'account_analytic_plans':fields.boolean('Multiple Analytic Plans',
+ help="Allows invoice lines to impact multiple analytic accounts "
+ "simultaneously."),
+ 'account_payment':fields.boolean('Suppliers Payment Management',
+ help="Streamlines invoice payment and creates hooks to plug "
+ "automated payment systems in."),
+ 'account_followup':fields.boolean('Followups Management',
+ help="Helps you generate reminder letters for unpaid invoices, "
+ "including multiple levels of reminding and customized "
+ "per-partner policies."),
+ 'account_asset':fields.boolean('Assets Management',
+ help="Enables asset management in the accounting application, "
+ "including asset categories and usage periods.")
}
_defaults = {
'account_analytic_default':True,
}
+
+ def modules_to_install(self, cr, uid, ids, context=None):
+ modules = super(account_installer, self).modules_to_install(
+ cr, uid, ids, context=context)
+
+ chart = self.read(cr, uid, ids, ['charts'],
+ context=context)[0]['charts']
+ self.logger.notifyChannel(
+ 'installer', netsvc.LOG_DEBUG,
+ 'Installing chart of accounts %s'%chart)
+ return modules | set([chart])
+
+
account_installer()
diff --git a/addons/account/process/customer_invoice_process.xml b/addons/account/process/customer_invoice_process.xml
index 117b7723c68..b9710276509 100755
--- a/addons/account/process/customer_invoice_process.xml
+++ b/addons/account/process/customer_invoice_process.xml
@@ -18,7 +18,7 @@
-
+
diff --git a/addons/account/process/supplier_invoice_process.xml b/addons/account/process/supplier_invoice_process.xml
index 80d57de1f41..26e1e9862e7 100755
--- a/addons/account/process/supplier_invoice_process.xml
+++ b/addons/account/process/supplier_invoice_process.xml
@@ -18,7 +18,7 @@
-
+
diff --git a/addons/account/project/project.py b/addons/account/project/project.py
index a381f587f8a..7ad98b04b32 100644
--- a/addons/account/project/project.py
+++ b/addons/account/project/project.py
@@ -29,239 +29,6 @@ from osv import osv
# Object definition
#
-class account_analytic_account(osv.osv):
- _name = 'account.analytic.account'
- _description = 'Analytic Accounts'
-
- def _credit_calc(self, cr, uid, ids, name, arg, context={}):
-
- where_date = ''
- if context.get('from_date',False):
- where_date += " AND l.date >= '" + context['from_date'] + "'"
- if context.get('to_date',False):
- where_date += " AND l.date <= '" + context['to_date'] + "'"
-
- cr.execute("SELECT a.id, COALESCE(SUM(l.amount),0) FROM account_analytic_account a LEFT JOIN account_analytic_line l ON (a.id=l.account_id "+where_date+") WHERE l.amount<0 and a.id =ANY(%s) GROUP BY a.id",(ids,))
- r = dict(cr.fetchall())
- for i in ids:
- r.setdefault(i,0.0)
- return r
-
- def _debit_calc(self, cr, uid, ids, name, arg, context={}):
-
- where_date = ''
- if context.get('from_date',False):
- where_date += " AND l.date >= '" + context['from_date'] + "'"
- if context.get('to_date',False):
- where_date += " AND l.date <= '" + context['to_date'] + "'"
-
- cr.execute("SELECT a.id, COALESCE(SUM(l.amount),0) FROM account_analytic_account a LEFT JOIN account_analytic_line l ON (a.id=l.account_id "+where_date+") WHERE l.amount>0 and a.id =ANY(%s) GROUP BY a.id" ,(ids,))
- r= dict(cr.fetchall())
- for i in ids:
- r.setdefault(i,0.0)
- return r
-
- def _balance_calc(self, cr, uid, ids, name, arg, context={}):
- res = {}
- ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)])
- for i in ids:
- res.setdefault(i,0.0)
- if not ids2:
- return res
-
- where_date = ''
- if context.get('from_date',False):
- where_date += " AND l.date >= '" + context['from_date'] + "'"
- if context.get('to_date',False):
- where_date += " AND l.date <= '" + context['to_date'] + "'"
-
- cr.execute("SELECT a.id, COALESCE(SUM(l.amount),0) FROM account_analytic_account a LEFT JOIN account_analytic_line l ON (a.id=l.account_id "+where_date+") WHERE a.id =ANY(%s) GROUP BY a.id",(ids2,))
-
- for account_id, sum in cr.fetchall():
- res[account_id] = sum
-
- cr.execute("SELECT a.id, r.currency_id FROM account_analytic_account a INNER JOIN res_company r ON (a.company_id = r.id) where a.id =ANY(%s)",(ids2,))
-
- currency= dict(cr.fetchall())
-
- res_currency= self.pool.get('res.currency')
- for id in ids:
- if id not in ids2:
- continue
- for child in self.search(cr, uid, [('parent_id', 'child_of', [id])]):
- if child <> id:
- res.setdefault(id, 0.0)
- if currency[child]<>currency[id]:
- res[id] += res_currency.compute(cr, uid, currency[child], currency[id], res.get(child, 0.0), context=context)
- else:
- res[id] += res.get(child, 0.0)
-
- cur_obj = res_currency.browse(cr,uid,currency.values(),context)
- cur_obj = dict([(o.id, o) for o in cur_obj])
- for id in ids:
- if id in ids2:
- res[id] = res_currency.round(cr,uid,cur_obj[currency[id]],res.get(id,0.0))
-
- return dict([(i, res[i]) for i in ids ])
-
- def _quantity_calc(self, cr, uid, ids, name, arg, context={}):
- #XXX must convert into one uom
- res = {}
- ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)])
- acc_set = ",".join(map(str, ids2))
-
- for i in ids:
- res.setdefault(i,0.0)
-
- if not acc_set:
- return res
-
- where_date = ''
- if context.get('from_date',False):
- where_date += " AND l.date >= '" + context['from_date'] + "'"
- if context.get('to_date',False):
- where_date += " AND l.date <= '" + context['to_date'] + "'"
-
- cr.execute('SELECT a.id, COALESCE(SUM(l.unit_amount), 0) \
- FROM account_analytic_account a \
- LEFT JOIN account_analytic_line l ON (a.id = l.account_id ' + where_date + ') \
- WHERE a.id =ANY(%s) GROUP BY a.id',(ids2,))
-
- for account_id, sum in cr.fetchall():
- res[account_id] = sum
-
- for id in ids:
- if id not in ids2:
- continue
- for child in self.search(cr, uid, [('parent_id', 'child_of', [id])]):
- if child <> id:
- res.setdefault(id, 0.0)
- res[id] += res.get(child, 0.0)
- return dict([(i, res[i]) for i in ids])
-
- def name_get(self, cr, uid, ids, context={}):
- if not len(ids):
- return []
- reads = self.read(cr, uid, ids, ['name','parent_id'], context)
- res = []
- for record in reads:
- name = record['name']
- if record['parent_id']:
- name = record['parent_id'][1]+' / '+name
- res.append((record['id'], name))
- return res
-
- def _complete_name_calc(self, cr, uid, ids, prop, unknow_none, unknow_dict):
- res = self.name_get(cr, uid, ids)
- return dict(res)
-
- def _get_company_currency(self, cr, uid, ids, field_name, arg, context={}):
- result = {}
- for rec in self.browse(cr, uid, ids, context):
- result[rec.id] = (rec.company_id.currency_id.id,rec.company_id.currency_id.code) or False
- return result
-
- _columns = {
- 'name' : fields.char('Account Name', size=128, required=True),
- 'complete_name': fields.function(_complete_name_calc, method=True, type='char', string='Full Account Name'),
- 'code' : fields.char('Account Code', size=24),
-# 'active' : fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the analytic account without removing it."),
- 'type': fields.selection([('view','View'), ('normal','Normal')], 'Account Type'),
- 'description' : fields.text('Description'),
- 'parent_id': fields.many2one('account.analytic.account', 'Parent Analytic Account', select=2),
- 'child_ids': fields.one2many('account.analytic.account', 'parent_id', 'Child Accounts'),
- 'line_ids': fields.one2many('account.analytic.line', 'account_id', 'Analytic Entries'),
- 'balance' : fields.function(_balance_calc, method=True, type='float', string='Balance'),
- 'debit' : fields.function(_debit_calc, method=True, type='float', string='Debit'),
- 'credit' : fields.function(_credit_calc, method=True, type='float', string='Credit'),
- 'quantity': fields.function(_quantity_calc, method=True, type='float', string='Quantity'),
- 'quantity_max': fields.float('Maximum Quantity', help='Sets the higher limit of quantity of hours.'),
- 'partner_id' : fields.many2one('res.partner', 'Associated Partner'),
- 'contact_id' : fields.many2one('res.partner.address', 'Contact'),
- 'user_id' : fields.many2one('res.users', 'Account Manager'),
- 'date_start': fields.date('Date Start'),
- 'date': fields.date('Date End'),
- 'company_id': fields.many2one('res.company', 'Company', required=True),
- 'company_currency_id': fields.function(_get_company_currency, method=True, type='many2one', relation='res.currency', string='Currency'),
- 'state': fields.selection([('draft','Draft'),('open','Open'), ('pending','Pending'),('cancelled', 'Cancelled'),('close','Close'),('template', 'Template')], 'State', required=True,readonly=True,
- help='* When an account is created its in \'Draft\' state.\
- \n* If any associated partner is there, it can be in \'Open\' state.\
- \n* If any pending balance is there it can be in \'Pending\'. \
- \n* And finally when all the transactions are over, it can be in \'Close\' state. \
- \n* The project can be in either if the states \'Template\' and \'Running\'.\n If it is template then we can make projects based on the template projects. If its in \'Running\' state it is a normal project.\
- \n If it is to be reviewed then the state is \'Pending\'.\n When the project is completed the state is set to \'Done\'.'),
- }
-
- def _default_company(self, cr, uid, context={}):
- user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
- if user.company_id:
- return user.company_id.id
- return self.pool.get('res.company').search(cr, uid, [('parent_id', '=', False)])[0]
- _defaults = {
-# 'active' : lambda *a : True,
- 'type' : lambda *a : 'normal',
- 'company_id': _default_company,
- 'state' : lambda *a : 'open',
- 'user_id' : lambda self,cr,uid,ctx : uid,
- 'partner_id': lambda self,cr, uid, ctx: ctx.get('partner_id', False),
- 'contact_id': lambda self,cr, uid, ctx: ctx.get('contact_id', False),
- 'date_start': lambda *a: time.strftime('%Y-%m-%d')
- }
-
- def check_recursion(self, cr, uid, ids, parent=None):
- return super(account_analytic_account, self).check_recursion(cr, uid, ids, parent=parent)
-
- _order = 'parent_id desc,code'
- _constraints = [
- (check_recursion, 'Error! You can not create recursive analytic accounts.', ['parent_id'])
- ]
-
- def create(self, cr, uid, vals, context=None):
- parent_id = vals.get('parent_id', 0)
- if ('code' not in vals or not vals['code']) and not parent_id:
- vals['code'] = self.pool.get('ir.sequence').get(cr, uid, 'account.analytic.account')
- return super(account_analytic_account, self).create(cr, uid, vals, context=context)
-
- def copy(self, cr, uid, id, default=None, context={}):
- if not default:
- default = {}
- default['code'] = False
- default['line_ids'] = []
- return super(account_analytic_account, self).copy(cr, uid, id, default, context=context)
-
-
- def on_change_parent(self, cr, uid, id, parent_id):
- if not parent_id:
- return {}
- parent = self.read(cr, uid, [parent_id], ['partner_id','code'])[0]
- childs = self.search(cr, uid, [('parent_id', '=', parent_id), ('active', 'in', [True, False])])
- numchild = len(childs)
- if parent['partner_id']:
- partner = parent['partner_id'][0]
- else:
- partner = False
- res = {'value' : {'code' : '%s - %03d' % (parent['code'] or '', numchild + 1),}}
- if partner:
- res['value']['partner_id'] = partner
- return res
-
- def name_search(self, cr, uid, name, args=None, operator='ilike', context=None, limit=100):
- if not args:
- args=[]
- if not context:
- context={}
- account = self.search(cr, uid, [('code', '=', name)]+args, limit=limit, context=context)
- if not account:
- account = self.search(cr, uid, [('name', 'ilike', '%%%s%%' % name)]+args, limit=limit, context=context)
- newacc = account
- while newacc:
- newacc = self.search(cr, uid, [('parent_id', 'in', newacc)]+args, limit=limit, context=context)
- account+=newacc
- return self.name_get(cr, uid, account, context=context)
-
-account_analytic_account()
-
-
class account_analytic_journal(osv.osv):
_name = 'account.analytic.journal'
_columns = {
diff --git a/addons/account/security/ir.model.access.csv b/addons/account/security/ir.model.access.csv
index bb7ffbae946..4cf67851760 100644
--- a/addons/account/security/ir.model.access.csv
+++ b/addons/account/security/ir.model.access.csv
@@ -34,7 +34,7 @@
"access_account_bank_statement_line","account.bank.statement.line","model_account_bank_statement_line","account.group_account_user",1,1,1,1
"access_account_analytic_line","account.analytic.line","model_account_analytic_line","account.group_account_user",1,1,1,1
"access_report_hr_timesheet_invoice_journal","report.hr.timesheet.invoice.journal","model_report_hr_timesheet_invoice_journal","account.group_account_manager",1,0,0,0
-"access_account_analytic_account","account.analytic.account","model_account_analytic_account","base.group_user",1,0,0,0
+"access_account_analytic_account","account.analytic.account","analytic.model_account_analytic_account","base.group_user",1,0,0,0
"access_account_analytic_journal","account.analytic.journal","model_account_analytic_journal","account.group_account_user",1,0,0,0
"access_account_invoice_uinvoice","account.invoice","model_account_invoice","account.group_account_invoice",1,1,1,1
"access_account_invoice_line_uinvoice","account.invoice.line","model_account_invoice_line","account.group_account_invoice",1,1,1,1
@@ -58,7 +58,7 @@
"access_account_tax_code_manager","account.tax.code","model_account_tax_code","account.group_account_manager",1,1,1,1
"access_account_tax_manager","account.tax","model_account_tax","account.group_account_manager",1,1,1,1
"access_account_invoice_group_invoice","account.invoice group invoice","model_account_invoice","account.group_account_invoice",1,1,1,1
-"access_account_analytic_account_manager","account.analytic.account","model_account_analytic_account","account.group_account_manager",1,1,1,1
+"access_account_analytic_account_manager","account.analytic.account","analytic.model_account_analytic_account","account.group_account_manager",1,1,1,1
"access_account_analytic_journal_manager","account.analytic.journal","model_account_analytic_journal","account.group_account_manager",1,1,1,1
"access_account_fiscalyear","account.fiscalyear","model_account_fiscalyear","account.group_account_manager",1,1,1,1
"access_account_fiscalyear_user","account.fiscalyear.user","model_account_fiscalyear","account.group_account_user",1,0,0,0
@@ -87,6 +87,3 @@
"access_account_fiscal_position_account_template","account.fiscal.position.account.template","model_account_fiscal_position_account_template","account.group_account_manager",1,1,1,1
"access_account_sequence_fiscal_year","account.sequence.fiscalyear","model_account_sequence_fiscalyear","account.group_account_user",1,1,1,1
"access_account_sequence_fiscal_year_user","account.sequence.fiscalyear user","model_account_sequence_fiscalyear","base.group_user",1,0,0,0
-"access_wizard_company_setup_manager","wizard.company.setup manager","model_wizard_company_setup","account.group_account_manager",1,1,1,1
-"access_wizard_company_setup","wizard.company.setup","model_wizard_company_setup","account.group_account_user",1,0,0,0
-"access_wizard_company_setup_user","wizard.company.setup user","model_wizard_company_setup","base.group_user",1,0,0,0
diff --git a/addons/account_analytic_default/i18n/ar.po b/addons/account_analytic_default/i18n/ar.po
index c27e4e2f3bb..943a3f94d31 100644
--- a/addons/account_analytic_default/i18n/ar.po
+++ b/addons/account_analytic_default/i18n/ar.po
@@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 5.0.4\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2009-02-03 06:23+0000\n"
-"Last-Translator: <>\n"
+"PO-Revision-Date: 2010-02-06 17:39+0000\n"
+"Last-Translator: omar \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2009-12-16 05:18+0000\n"
+"X-Launchpad-Export-Date: 2010-02-07 04:38+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_analytic_default
@@ -77,7 +77,7 @@ msgstr ""
#. module: account_analytic_default
#: field:account.analytic.default,user_id:0
msgid "User"
-msgstr ""
+msgstr "المستخدم"
#. module: account_analytic_default
#: constraint:ir.actions.act_window:0
diff --git a/addons/account_anglo_saxon/__terp__.py b/addons/account_anglo_saxon/__terp__.py
index 31818e213ef..a601d56b1d1 100644
--- a/addons/account_anglo_saxon/__terp__.py
+++ b/addons/account_anglo_saxon/__terp__.py
@@ -18,17 +18,18 @@
#
##############################################################################
{
- "name" : "Stock Account",
- "version" : "1.1",
- "author" : "Tiny",
- "website" : "http://tinyerp.com",
+ "name" : "Stock Accounting for Anglo Saxon countries",
+ "version" : "1.2",
+ "author" : "Tiny, Veritos",
+ "website" : "http://tinyerp.com - http://veritos.nl",
"description" : """This module will support the Anglo-Saxons accounting methodology by
changing the accounting logic with stock transactions. The difference between the Anglo-Saxon accounting countries
and the Rhine or also called Continental accounting countries is the moment of taking the Cost of Goods Sold versus Cost of Sales.
Anglo-Saxons accounting does take the cost when sales invoice is created, Continental accounting will take the cost at he moment the goods are shipped.
This module will add this functionality by using a interim account, to store the value of shipped goods and will contra book this interim account
- when the invoice is created to transfer this amount to the debtor or creditor account.""",
- "depends" : ["product", "account", "sale", "purchase"],
+ when the invoice is created to transfer this amount to the debtor or creditor account.
+ Secondly, price differences between actual purchase price and fixed product standard price are booked on a seperate account""",
+ "depends" : ["product", "account", "sale", "purchase", "stock"],
"category" : "Generic Modules/Inventory Control",
"init_xml" : [],
"demo_xml" : [],
diff --git a/addons/account_anglo_saxon/invoice.py b/addons/account_anglo_saxon/invoice.py
index 3904cd6b01e..7c1ecbab758 100644
--- a/addons/account_anglo_saxon/invoice.py
+++ b/addons/account_anglo_saxon/invoice.py
@@ -1,7 +1,10 @@
##############################################################################
#
# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2009 Tiny SPRL ().
+# Copyright (C)
+# 2004-2010 Tiny SPRL ().
+# 2009-2010 Veritos (http://veritos.nl).
+# All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
@@ -30,14 +33,20 @@ class account_invoice_line(osv.osv):
for i_line in inv.invoice_line:
if i_line.product_id:
if inv.type == 'out_invoice':
+ # debit account dacc will be the output account
+ # first check the product, if empty check the category
dacc = i_line.product_id.product_tmpl_id.property_stock_account_output and i_line.product_id.product_tmpl_id.property_stock_account_output.id
if not dacc:
dacc = i_line.product_id.categ_id.property_stock_account_output_categ and i_line.product_id.categ_id.property_stock_account_output_categ.id
else:
+ # = out_refund
+ # debit account dacc will be the input account
+ # first check the product, if empty check the category
dacc = i_line.product_id.product_tmpl_id.property_stock_account_input and i_line.product_id.product_tmpl_id.property_stock_account_input.id
if not dacc:
dacc = i_line.product_id.categ_id.property_stock_account_input_categ and i_line.product_id.categ_id.property_stock_account_input_categ.id
-
+ # in both cases the credit account cacc will be the expense account
+ # first check the product, if empty check the category
cacc = i_line.product_id.product_tmpl_id.property_account_expense and i_line.product_id.product_tmpl_id.property_account_expense.id
if not cacc:
cacc = i_line.product_id.categ_id.property_account_expense_categ and i_line.product_id.categ_id.property_account_expense_categ.id
@@ -71,27 +80,36 @@ class account_invoice_line(osv.osv):
for i_line in inv.invoice_line:
if i_line.product_id:
if i_line.product_id.product_tmpl_id.type != 'service':
+ # get the price difference account at the product
acc = i_line.product_id.product_tmpl_id.property_account_creditor_price_difference and i_line.product_id.product_tmpl_id.property_account_creditor_price_difference.id
if not acc:
+ # if not found on the product get the price difference account at the category
acc = i_line.product_id.categ_id.property_account_creditor_price_difference_categ and i_line.product_id.categ_id.property_account_creditor_price_difference_categ.id
a = None
if inv.type == 'in_invoice':
+ # oa will be the stock input account
+ # first check the product, if empty check the category
oa = i_line.product_id.product_tmpl_id.property_stock_account_input and i_line.product_id.product_tmpl_id.property_stock_account_input.id
if not oa:
oa = i_line.product_id.categ_id.property_stock_account_input_categ and i_line.product_id.categ_id.property_stock_account_input_categ.id
else:
+ # = in_refund
+ # oa will be the stock output account
+ # first check the product, if empty check the category
oa = i_line.product_id.product_tmpl_id.property_stock_account_output and i_line.product_id.product_tmpl_id.property_stock_account_output.id
if not oa:
oa = i_line.product_id.categ_id.property_stock_account_output_categ and i_line.product_id.categ_id.property_stock_account_output_categ.id
if oa:
+ # get the fiscal position
fpos = i_line.invoice_id.fiscal_position or False
a = self.pool.get('account.fiscal.position').map_account(cr, uid, fpos, oa)
diff_res = []
+ # calculate and write down the possible price difference between invoice price and product price
for line in res:
if a == line['account_id'] and i_line.product_id.id == line['product_id']:
uom = i_line.product_id.uos_id or i_line.product_id.uom_id
standard_price = self.pool.get('product.uom')._compute_price(cr, uid, uom.id, i_line.product_id.product_tmpl_id.standard_price, i_line.uos_id.id)
- if standard_price != i_line.price_unit and line['price'] == i_line.price_unit and acc:
+ if standard_price != i_line.price_unit and line['price_unit'] == i_line.price_unit and acc:
price_diff = i_line.price_unit - standard_price
line.update({'price':standard_price * line['quantity']})
diff_res.append({
diff --git a/addons/account_anglo_saxon/stock.py b/addons/account_anglo_saxon/stock.py
index ad091364fd8..ac0dbeadcec 100644
--- a/addons/account_anglo_saxon/stock.py
+++ b/addons/account_anglo_saxon/stock.py
@@ -43,6 +43,18 @@ class stock_picking(osv.osv):
fpos = ol.invoice_id.fiscal_position or False
a = self.pool.get('account.fiscal.position').map_account(cr, uid, fpos, oa)
self.pool.get('account.invoice.line').write(cr, uid, [ol.id], {'account_id': a})
+
+ elif type == 'in_invoice':
+ for inv in self.pool.get('account.invoice').browse(cr, uid, res.values(), context=context):
+ for ol in inv.invoice_line:
+ if ol.product_id:
+ oa = ol.product_id.product_tmpl_id.property_stock_account_input and ol.product_id.product_tmpl_id.property_stock_account_input.id
+ if not oa:
+ oa = ol.product_id.categ_id.property_stock_account_input_categ and ol.product_id.categ_id.property_stock_account_input_categ.id
+ if oa:
+ fpos = ol.invoice_id.fiscal_position or False
+ a = self.pool.get('account.fiscal.position').map_account(cr, uid, fpos, oa)
+ self.pool.get('account.invoice.line').write(cr, uid, [ol.id], {'account_id': a})
return res
stock_picking()
diff --git a/addons/base_setup/wizard/__init__.py b/addons/analytic/__init__.py
similarity index 97%
rename from addons/base_setup/wizard/__init__.py
rename to addons/analytic/__init__.py
index a322ae346b3..dc48b6f4001 100644
--- a/addons/base_setup/wizard/__init__.py
+++ b/addons/analytic/__init__.py
@@ -19,8 +19,7 @@
#
##############################################################################
-import wizard_base_setup
-
+import project
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/analytic/__terp__.py b/addons/analytic/__terp__.py
new file mode 100644
index 00000000000..6ccdf3564d8
--- /dev/null
+++ b/addons/analytic/__terp__.py
@@ -0,0 +1,41 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL ().
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+
+
+{
+ "name" : "Analytic Account",
+ "version": "1.1",
+ "author" : "Tiny",
+ "website" : "http://www.openerp.com",
+ "category" : "Generic Modules/Projects & Services",
+ "depends" : ["base"],
+ "description": """Module for defining analytic accounting object.
+ """,
+ "init_xml" : [],
+ "update_xml": ["security/ir.model.access.csv",
+ ],
+ 'demo_xml': [
+ ],
+ 'installable': True,
+ 'active': False,
+ 'certificate': '',
+}
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/analytic/project.py b/addons/analytic/project.py
new file mode 100644
index 00000000000..7e0ab40c63a
--- /dev/null
+++ b/addons/analytic/project.py
@@ -0,0 +1,262 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL ().
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+
+import time
+import operator
+
+from osv import fields
+from osv import osv
+
+#
+# Object definition
+#
+
+class account_analytic_account(osv.osv):
+ _name = 'account.analytic.account'
+ _description = 'Analytic Accounts'
+
+ def _credit_calc(self, cr, uid, ids, name, arg, context={}):
+
+ where_date = ''
+ if context.get('from_date',False):
+ where_date += " AND l.date >= '" + context['from_date'] + "'"
+ if context.get('to_date',False):
+ where_date += " AND l.date <= '" + context['to_date'] + "'"
+
+ cr.execute("SELECT a.id, COALESCE(SUM(l.amount),0) FROM account_analytic_account a LEFT JOIN account_analytic_line l ON (a.id=l.account_id "+where_date+") WHERE l.amount<0 and a.id =ANY(%s) GROUP BY a.id",(ids,))
+ r = dict(cr.fetchall())
+ for i in ids:
+ r.setdefault(i,0.0)
+ return r
+
+ def _debit_calc(self, cr, uid, ids, name, arg, context={}):
+
+ where_date = ''
+ if context.get('from_date',False):
+ where_date += " AND l.date >= '" + context['from_date'] + "'"
+ if context.get('to_date',False):
+ where_date += " AND l.date <= '" + context['to_date'] + "'"
+
+ cr.execute("SELECT a.id, COALESCE(SUM(l.amount),0) FROM account_analytic_account a LEFT JOIN account_analytic_line l ON (a.id=l.account_id "+where_date+") WHERE l.amount>0 and a.id =ANY(%s) GROUP BY a.id" ,(ids,))
+ r= dict(cr.fetchall())
+ for i in ids:
+ r.setdefault(i,0.0)
+ return r
+
+ def _balance_calc(self, cr, uid, ids, name, arg, context={}):
+ res = {}
+ ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)])
+ for i in ids:
+ res.setdefault(i,0.0)
+ if not ids2:
+ return res
+
+ where_date = ''
+ if context.get('from_date',False):
+ where_date += " AND l.date >= '" + context['from_date'] + "'"
+ if context.get('to_date',False):
+ where_date += " AND l.date <= '" + context['to_date'] + "'"
+
+ cr.execute("SELECT a.id, COALESCE(SUM(l.amount),0) FROM account_analytic_account a LEFT JOIN account_analytic_line l ON (a.id=l.account_id "+where_date+") WHERE a.id =ANY(%s) GROUP BY a.id",(ids2,))
+
+ for account_id, sum in cr.fetchall():
+ res[account_id] = sum
+
+ cr.execute("SELECT a.id, r.currency_id FROM account_analytic_account a INNER JOIN res_company r ON (a.company_id = r.id) where a.id =ANY(%s)",(ids2,))
+
+ currency= dict(cr.fetchall())
+
+ res_currency= self.pool.get('res.currency')
+ for id in ids:
+ if id not in ids2:
+ continue
+ for child in self.search(cr, uid, [('parent_id', 'child_of', [id])]):
+ if child <> id:
+ res.setdefault(id, 0.0)
+ if currency[child]<>currency[id]:
+ res[id] += res_currency.compute(cr, uid, currency[child], currency[id], res.get(child, 0.0), context=context)
+ else:
+ res[id] += res.get(child, 0.0)
+
+ cur_obj = res_currency.browse(cr,uid,currency.values(),context)
+ cur_obj = dict([(o.id, o) for o in cur_obj])
+ for id in ids:
+ if id in ids2:
+ res[id] = res_currency.round(cr,uid,cur_obj[currency[id]],res.get(id,0.0))
+
+ return dict([(i, res[i]) for i in ids ])
+
+ def _quantity_calc(self, cr, uid, ids, name, arg, context={}):
+ #XXX must convert into one uom
+ res = {}
+ ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)])
+ acc_set = ",".join(map(str, ids2))
+
+ for i in ids:
+ res.setdefault(i,0.0)
+
+ if not acc_set:
+ return res
+
+ where_date = ''
+ if context.get('from_date',False):
+ where_date += " AND l.date >= '" + context['from_date'] + "'"
+ if context.get('to_date',False):
+ where_date += " AND l.date <= '" + context['to_date'] + "'"
+
+ cr.execute('SELECT a.id, COALESCE(SUM(l.unit_amount), 0) \
+ FROM account_analytic_account a \
+ LEFT JOIN account_analytic_line l ON (a.id = l.account_id ' + where_date + ') \
+ WHERE a.id =ANY(%s) GROUP BY a.id',(ids2,))
+
+ for account_id, sum in cr.fetchall():
+ res[account_id] = sum
+
+ for id in ids:
+ if id not in ids2:
+ continue
+ for child in self.search(cr, uid, [('parent_id', 'child_of', [id])]):
+ if child <> id:
+ res.setdefault(id, 0.0)
+ res[id] += res.get(child, 0.0)
+ return dict([(i, res[i]) for i in ids])
+
+ def name_get(self, cr, uid, ids, context={}):
+ if not len(ids):
+ return []
+ reads = self.read(cr, uid, ids, ['name','parent_id'], context)
+ res = []
+ for record in reads:
+ name = record['name']
+ if record['parent_id']:
+ name = record['parent_id'][1]+' / '+name
+ res.append((record['id'], name))
+ return res
+
+ def _complete_name_calc(self, cr, uid, ids, prop, unknow_none, unknow_dict):
+ res = self.name_get(cr, uid, ids)
+ return dict(res)
+
+ def _get_company_currency(self, cr, uid, ids, field_name, arg, context={}):
+ result = {}
+ for rec in self.browse(cr, uid, ids, context):
+ result[rec.id] = (rec.company_id.currency_id.id,rec.company_id.currency_id.code) or False
+ return result
+
+ _columns = {
+ 'name' : fields.char('Account Name', size=128, required=True),
+ 'complete_name': fields.function(_complete_name_calc, method=True, type='char', string='Full Account Name'),
+ 'code' : fields.char('Account Code', size=24),
+# 'active' : fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the analytic account without removing it."),
+ 'type': fields.selection([('view','View'), ('normal','Normal')], 'Account Type'),
+ 'description' : fields.text('Description'),
+ 'parent_id': fields.many2one('account.analytic.account', 'Parent Analytic Account', select=2),
+ 'child_ids': fields.one2many('account.analytic.account', 'parent_id', 'Child Accounts'),
+ 'line_ids': fields.one2many('account.analytic.line', 'account_id', 'Analytic Entries'),
+ 'balance' : fields.function(_balance_calc, method=True, type='float', string='Balance'),
+ 'debit' : fields.function(_debit_calc, method=True, type='float', string='Debit'),
+ 'credit' : fields.function(_credit_calc, method=True, type='float', string='Credit'),
+ 'quantity': fields.function(_quantity_calc, method=True, type='float', string='Quantity'),
+ 'quantity_max': fields.float('Maximum Quantity', help='Sets the higher limit of quantity of hours.'),
+ 'partner_id' : fields.many2one('res.partner', 'Associated Partner'),
+ 'contact_id' : fields.many2one('res.partner.address', 'Contact'),
+ 'user_id' : fields.many2one('res.users', 'Account Manager'),
+ 'date_start': fields.date('Date Start'),
+ 'date': fields.date('Date End'),
+ 'company_id': fields.many2one('res.company', 'Company', required=True),
+ 'company_currency_id': fields.function(_get_company_currency, method=True, type='many2one', relation='res.currency', string='Currency'),
+ 'state': fields.selection([('draft','Draft'),('open','Open'), ('pending','Pending'),('cancelled', 'Cancelled'),('close','Close'),('template', 'Template')], 'State', required=True,readonly=True,
+ help='* When an account is created its in \'Draft\' state.\
+ \n* If any associated partner is there, it can be in \'Open\' state.\
+ \n* If any pending balance is there it can be in \'Pending\'. \
+ \n* And finally when all the transactions are over, it can be in \'Close\' state. \
+ \n* The project can be in either if the states \'Template\' and \'Running\'.\n If it is template then we can make projects based on the template projects. If its in \'Running\' state it is a normal project.\
+ \n If it is to be reviewed then the state is \'Pending\'.\n When the project is completed the state is set to \'Done\'.'),
+ }
+
+ def _default_company(self, cr, uid, context={}):
+ user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
+ if user.company_id:
+ return user.company_id.id
+ return self.pool.get('res.company').search(cr, uid, [('parent_id', '=', False)])[0]
+ _defaults = {
+# 'active' : lambda *a : True,
+ 'type' : lambda *a : 'normal',
+ 'company_id': _default_company,
+ 'state' : lambda *a : 'open',
+ 'user_id' : lambda self,cr,uid,ctx : uid,
+ 'partner_id': lambda self,cr, uid, ctx: ctx.get('partner_id', False),
+ 'contact_id': lambda self,cr, uid, ctx: ctx.get('contact_id', False),
+ 'date_start': lambda *a: time.strftime('%Y-%m-%d')
+ }
+
+ def check_recursion(self, cr, uid, ids, parent=None):
+ return super(account_analytic_account, self).check_recursion(cr, uid, ids, parent=parent)
+
+ _order = 'parent_id desc,code'
+ _constraints = [
+ (check_recursion, 'Error! You can not create recursive analytic accounts.', ['parent_id'])
+ ]
+
+ def create(self, cr, uid, vals, context=None):
+ parent_id = vals.get('parent_id', 0)
+ if ('code' not in vals or not vals['code']) and not parent_id:
+ vals['code'] = self.pool.get('ir.sequence').get(cr, uid, 'account.analytic.account')
+ return super(account_analytic_account, self).create(cr, uid, vals, context=context)
+
+ def copy(self, cr, uid, id, default=None, context={}):
+ if not default:
+ default = {}
+ default['code'] = False
+ default['line_ids'] = []
+ return super(account_analytic_account, self).copy(cr, uid, id, default, context=context)
+
+
+ def on_change_parent(self, cr, uid, id, parent_id):
+ if not parent_id:
+ return {}
+ parent = self.read(cr, uid, [parent_id], ['partner_id','code'])[0]
+ childs = self.search(cr, uid, [('parent_id', '=', parent_id), ('active', 'in', [True, False])])
+ numchild = len(childs)
+ if parent['partner_id']:
+ partner = parent['partner_id'][0]
+ else:
+ partner = False
+ res = {'value' : {'code' : '%s - %03d' % (parent['code'] or '', numchild + 1),}}
+ if partner:
+ res['value']['partner_id'] = partner
+ return res
+
+ def name_search(self, cr, uid, name, args=None, operator='ilike', context=None, limit=100):
+ if not args:
+ args=[]
+ if not context:
+ context={}
+ account = self.search(cr, uid, [('code', '=', name)]+args, limit=limit, context=context)
+ if not account:
+ account = self.search(cr, uid, [('name', 'ilike', '%%%s%%' % name)]+args, limit=limit, context=context)
+ newacc = account
+ while newacc:
+ newacc = self.search(cr, uid, [('parent_id', 'in', newacc)]+args, limit=limit, context=context)
+ account+=newacc
+ return self.name_get(cr, uid, account, context=context)
+
+account_analytic_account()
diff --git a/addons/analytic/security/ir.model.access.csv b/addons/analytic/security/ir.model.access.csv
new file mode 100644
index 00000000000..0343f29f43a
--- /dev/null
+++ b/addons/analytic/security/ir.model.access.csv
@@ -0,0 +1 @@
+"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
diff --git a/addons/base_calendar/base_calendar.py b/addons/base_calendar/base_calendar.py
index 9849a5b012d..689d2d08459 100644
--- a/addons/base_calendar/base_calendar.py
+++ b/addons/base_calendar/base_calendar.py
@@ -421,6 +421,16 @@ class basic_calendar_line(osv.osv):
'domain': lambda *a: '[]',
}
+ def create(self, cr, uid, vals, context={}):
+ cr.execute("Select count(id) from basic_calendar_lines \
+ where name='%s' and calendar_id=%s" % (vals.get('name'), vals.get('calendar_id')))
+ res = cr.fetchone()
+ if res:
+ if res[0] > 0:
+ raise osv.except_osv(_('Warning !'), _('Can not create \
+line "%s" more than once' % (vals.get('name'))))
+ return super(basic_calendar_line, self).create(cr, uid, vals, context=context)
+
basic_calendar_line()
class basic_calendar_attribute(osv.osv):
@@ -482,7 +492,7 @@ class basic_calendar_fields(osv.osv):
res = cr.fetchone()
if res:
if res[0] > 0:
- raise osv.except_osv(_('Warning !'), _('Can not map same field more than once'))
+ raise osv.except_osv(_('Warning !'), _('Can not map the field more than once'))
return super(basic_calendar_fields, self).create(cr, uid, vals, context=context)
def write(self, cr, uid, ids, vals, context=None):
diff --git a/addons/base_setup/__init__.py b/addons/base_setup/__init__.py
index 2e2da2196e5..22e81a488b0 100644
--- a/addons/base_setup/__init__.py
+++ b/addons/base_setup/__init__.py
@@ -20,7 +20,62 @@
##############################################################################
import installer
+import todo
import wizard
+from osv import osv
+import netsvc
+
+class base_setup_config_choice(osv.osv_memory):
+ """
+ """
+ _name = 'base.setup.config'
+ logger = netsvc.Logger()
+
+ def set_default_menu(self, cr, uid, menu, context=None):
+ user = self.pool.get('res.users')\
+ .browse(cr, uid, uid, context=context)
+
+ user.write({'action_id': menu.id,
+ 'menu_id': menu.id})
+
+ def get_default_menu(self, cr, uid, context=None):
+ actions = self.pool.get('ir.actions.act_window')
+
+ current_menu_id = actions.search(cr, uid, [('name','=','Menu')],
+ context=context)
+ assert len(current_menu_id) == 1,\
+ 'A given user should only have one menu item'
+ return actions.browse(cr, uid, current_menu_id[0], context=context)
+
+ def menu(self, cr, uid, ids, context=None):
+ menu = self.get_default_menu(cr, uid, context=context)
+ self.set_default_menu(cr, uid, menu, context=context)
+
+ if menu.view_id.id:
+ view_id = (menu.view_id.id, menu.view_id.name)
+ else:
+ view_id = False
+
+ return {
+ 'name': menu.name,
+ 'type': menu.type,
+ 'view_id': view_id,
+ 'domain': menu.domain,
+ 'res_users': menu.res_model,
+ 'src_model': menu.src_model,
+ 'view_type': menu.view_type,
+ 'view_mode': menu.view_mode,
+ 'views': menu.views,
+ }
+ def config(self, cr, uid, ids, context=None):
+ menu = self.get_default_menu(cr, uid, context=context)
+ self.set_default_menu(cr, uid, menu, context=context)
+
+ return self.pool.get('res.config').next(cr, uid, [], context=context)
+
+base_setup_config_choice()
+
+
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/base_setup/__terp__.py b/addons/base_setup/__terp__.py
index 6f7f4337740..c6dd64d7bcc 100644
--- a/addons/base_setup/__terp__.py
+++ b/addons/base_setup/__terp__.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL ().
#
@@ -15,7 +15,7 @@
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
+# along with this program. If not, see .
#
##############################################################################
@@ -42,8 +42,8 @@
'depends': ['base'],
'init_xml': ['base_setup_data.xml'],
'update_xml': ['security/ir.model.access.csv',
- 'base_setup_wizard.xml',
- 'base_setup_installer.xml'],
+ 'base_setup_installer.xml',
+ 'base_setup_todo.xml',],
'demo_xml': ['base_setup_demo.xml'],
'installable': True,
'active': True,
diff --git a/addons/base_setup/base_setup_data.xml b/addons/base_setup/base_setup_data.xml
index c715dbb6992..a28c7744158 100644
--- a/addons/base_setup/base_setup_data.xml
+++ b/addons/base_setup/base_setup_data.xml
@@ -1,17 +1,41 @@
-
-
-
- Setup
- ir.actions.wizard
- base_setup.base_setup
-
-
-
-
-
-
-
-
+
+
+ Setup
+ base.setup.config
+ form
+
+
+
+
+
+
+ Setup
+ base.setup.config
+ ir.actions.act_window
+
+ new
+
+
+
+
+
+
+
diff --git a/addons/base_setup/base_setup_demo.xml b/addons/base_setup/base_setup_demo.xml
index 4255606e3f1..364a0773a4c 100644
--- a/addons/base_setup/base_setup_demo.xml
+++ b/addons/base_setup/base_setup_demo.xml
@@ -3,7 +3,7 @@
-
+
diff --git a/addons/base_setup/base_setup_installer.xml b/addons/base_setup/base_setup_installer.xml
index b01e19a4a84..df2c5908de9 100644
--- a/addons/base_setup/base_setup_installer.xml
+++ b/addons/base_setup/base_setup_installer.xml
@@ -4,51 +4,37 @@
base.setup.installer.view
base.setup.installer
form
-
+
-
+
+
+ Install Modules
+
+
+ Now that OpenERP is installed, we have selected applications commonly useful to users which you can install directly, as well as sets of applications for more specific types or groups of businesses (the vertical modules).
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Install Modules
+If you don't think you need any of these right now, you can easily install them later on.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -65,7 +51,7 @@
- 1
+ 2
diff --git a/addons/base_setup/base_setup_todo.xml b/addons/base_setup/base_setup_todo.xml
new file mode 100644
index 00000000000..c6baf194c6e
--- /dev/null
+++ b/addons/base_setup/base_setup_todo.xml
@@ -0,0 +1,61 @@
+
+
+
+ Setup company information
+ base.setup.company
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Setup company information
+ ir.actions.act_window
+ base.setup.company
+
+ form
+ form
+ new
+
+
+
+
+ 1
+
+
+
diff --git a/addons/base_setup/base_setup_wizard.xml b/addons/base_setup/base_setup_wizard.xml
deleted file mode 100644
index 9a48bf41f6c..00000000000
--- a/addons/base_setup/base_setup_wizard.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
diff --git a/addons/base_setup/installer.py b/addons/base_setup/installer.py
index cb3dbdfdb9e..2c1ba113e47 100644
--- a/addons/base_setup/installer.py
+++ b/addons/base_setup/installer.py
@@ -19,57 +19,77 @@
#
##############################################################################
from osv import fields, osv
-from itertools import chain
-from operator import itemgetter
import netsvc
class base_setup_installer(osv.osv_memory):
_name = 'base.setup.installer'
_inherit = 'res.config.installer'
- def _get_charts(self, cr, uid, context=None):
- modules = self.pool.get('ir.module.module')
- ids = modules.search(cr, uid, [('category_id','=','Account Charts'),
- ('state','!=','installed')])
- return list(
- sorted(((m.name, m.shortdesc)
- for m in modules.browse(cr, uid, ids)),
- key=itemgetter(1)))
-
- def _if_account(self, cr, uid, ids, context=None):
- chart = self.read(cr, uid, ids, ['charts'],
- context=context)[0]['charts']
- self.logger.notifyChannel(
- 'installer', netsvc.LOG_DEBUG,
- 'Addon "account" selected, installing chart of accounts %s'%chart)
- return [chart]
-
_install_if = {
('sale','crm'): ['sale_crm'],
('sale','project'): ['project_mrp'],
}
_columns = {
# Generic modules
- 'crm':fields.boolean('Customer Relationship Management'),
- 'sale':fields.boolean('Sales Management'),
- 'project':fields.boolean('Project Management'),
- 'knowledge':fields.boolean('Knowledge Management'),
- 'stock':fields.boolean('Warehouse Management'),
- 'mrp':fields.boolean('Manufacturing'),
- 'account':fields.boolean('Financial & Accounting'),
- 'charts':fields.selection(_get_charts, 'Chart of Accounts',
- readonly=True),
- 'purchase':fields.boolean('Purchase Management'),
- 'hr':fields.boolean('Human Resources'),
- 'point_of_sale':fields.boolean('Point of Sales'),
- 'marketing':fields.boolean('Marketing'),
- 'misc_tools':fields.boolean('Miscellaneous Tools'),
- 'report_designer':fields.boolean('Advanced Reporting'),
+ 'crm':fields.boolean('Customer Relationship Management',
+ help="Helps you track and manage relations with customers such as"
+ " leads, requests or issues. Can automatically send "
+ "reminders, escalate requests or trigger business-specific "
+ "actions based on standard events."),
+ 'sale':fields.boolean('Sales Management',
+ help="Helps you handle your quotations, sale orders and invoicing"
+ "."),
+ 'project':fields.boolean('Project Management',
+ help="Helps you manage your projects and tasks by tracking them, "
+ "generating plannings, etc..."),
+ 'knowledge':fields.boolean('Knowledge Management',
+ help="Lets you install addons geared towards sharing knowledge "
+ "with and between your employees."),
+ 'stock':fields.boolean('Warehouse Management',
+ help="Helps you manage your stocks and stocks locations, as well "
+ "as the flow of stock between warehouses."),
+ 'mrp':fields.boolean('Manufacturing',
+ help="Helps you manage your manufacturing processes and generate "
+ "reports on those processes."),
+ 'account':fields.boolean('Financial & Accounting',
+ help="Helps you handle your accounting needs, as well as create "
+ "and track your budgets."),
+ 'purchase':fields.boolean('Purchase Management',
+ help="Helps you manage your purchase-related processes such as "
+ "requests for quotations, supplier invoices, etc..."),
+ 'hr':fields.boolean('Human Resources',
+ help="Helps you manage your human resources by encoding your "
+ "employee structure, generating work sheets, tracking "
+ "attendance and more."),
+ 'point_of_sale':fields.boolean('Point of Sales',
+ help="Helps you get the most out of your points of sales with "
+ "fast sale encoding, simplified payment mode encoding, "
+ "automatic picking lists generation and more."),
+ 'marketing':fields.boolean('Marketing',
+ help="Helps you manage your marketing campaigns step by step."),
+ 'misc_tools':fields.boolean('Miscellaneous Tools',
+ help="Lets you install various interesting but non-essential "
+ "tools."),
+ 'report_designer':fields.boolean('Advanced Reporting',
+ help="Lets you install various tools to simplify and enhance "
+ "OpenERP's report creation."),
# Vertical modules
- 'profile_association':fields.boolean('Associations'),
- 'profile_training':fields.boolean('Training Centers'),
- 'profile_auction':fields.boolean('Auction Houses'),
- 'profile_bookstore':fields.boolean('Book Stores'),
+ 'profile_association':fields.boolean('Associations',
+ help="Installs a preselected set of OpenERP "
+ "applications which will help you manage your association "
+ "more efficiently."),
+ 'profile_training':fields.boolean('Training Centers',
+ help="Helps you manage your training sessions and "
+ "centers, from the conception of a training project to the "
+ "gathering of trainee feedback."),
+ 'profile_auction':fields.boolean('Auction Houses',
+ help="Installs a preselected set of OpenERP "
+ "applications selected to help you manage your auctions "
+ "as well as the business processes around them."),
+ 'profile_bookstore':fields.boolean('Book Stores',
+ help="Installs a preselected set of OpenERP "
+ "applications which will help you manage your book store "
+ "or your library."),
}
_defaults = {
'crm': True,
diff --git a/addons/base_setup/todo.py b/addons/base_setup/todo.py
new file mode 100644
index 00000000000..d23ac71d60b
--- /dev/null
+++ b/addons/base_setup/todo.py
@@ -0,0 +1,152 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL ().
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+from operator import itemgetter
+
+from osv import osv, fields
+import netsvc
+import tools
+
+class base_setup_company(osv.osv_memory):
+ """
+ """
+ _name = 'base.setup.company'
+ _inherit = 'res.config'
+ logger = netsvc.Logger()
+
+ def _get_all(self, cr, uid, model, context=None):
+ models = self.pool.get(model)
+ all_model_ids = models.search(cr, uid, [])
+
+ output = [(False, '')]
+ output.extend(
+ sorted([(o.id, o.name)
+ for o in models.browse(cr, uid, all_model_ids,
+ context=context)],
+ key=itemgetter(1)))
+ return output
+
+ def _get_all_states(self, cr, uid, context=None):
+ return self._get_all(
+ cr, uid, 'res.country.state', context=context)
+ def _get_all_countries(self, cr, uid, context=None):
+ return self._get_all(cr, uid, 'res.country', context=context)
+ def _get_all_currencies(self, cr, uid, context=None):
+ return self._get_all(cr, uid, 'res.currency', context=context)
+
+ def default_get(self, cr, uid, fields_list=None, context=None):
+ """ get default company if any, and the various other fields
+ from the company's fields
+ """
+ defaults = super(base_setup_company, self)\
+ .default_get(cr, uid, fields_list=fields_list, context=context)
+
+ companies = self.pool.get('res.company')
+ company_id = companies.search(cr, uid, [], limit=1, order="id")
+ if not company_id or 'company_id' not in fields_list:
+ return defaults
+ company = companies.browse(cr, uid, company_id[0])
+
+ defaults['company_id'] = company.id
+ defaults['currency'] = company.currency_id.id
+ for field in ['name','logo','rml_header1','rml_footer1','rml_footer2']:
+ defaults[field] = company[field]
+
+ if company.partner_id.address:
+ address = company.partner_id.address[0]
+ for field in ['street','street2','zip','city','email','phone']:
+ defaults[field] = address[field]
+ for field in ['country_id','state_id']:
+ if address[field]:
+ defaults[field] = address[field].id
+
+ return defaults
+
+ _columns = {
+ 'company_id':fields.many2one('res.company', 'Company'),
+ 'name':fields.char('Company Name', size=64, required=True),
+ 'street':fields.char('Street', size=128),
+ 'street2':fields.char('Street 2', size=128),
+ 'zip':fields.char('Zip Code', size=24),
+ 'city':fields.char('City', size=128),
+ 'state_id':fields.selection(_get_all_states, 'States'),
+ 'country_id':fields.selection(_get_all_countries, 'Countries'),
+ 'email':fields.char('E-mail', size=64),
+ 'phone':fields.char('Phone', size=64),
+ 'currency':fields.selection(_get_all_currencies, 'Currency', required=True),
+ 'rml_header1':fields.char('Report Header', size=200,
+ help='''This sentence will appear at the top right corner of your reports.
+We suggest you to put a slogan here:
+"Open Source Business Solutions".'''),
+ 'rml_footer1':fields.char('Report Footer 1', size=200,
+ help='''This sentence will appear at the bottom of your reports.
+We suggest you to write legal sentences here:
+Web: http://openerp.com - Fax: +32.81.73.35.01 - Fortis Bank: 126-2013269-07'''),
+ 'rml_footer2':fields.char('Report Footer 2', size=200,
+ help='''This sentence will appear at the bottom of your reports.
+We suggest you to put bank information here:
+IBAN: BE74 1262 0121 6907 - SWIFT: CPDF BE71 - VAT: BE0477.472.701'''),
+ 'logo':fields.binary('Logo'),
+ }
+
+ def execute(self, cr, uid, ids, context=None):
+ assert len(ids) == 1, "We should only get one object from the form"
+ payload = self.browse(cr, uid, ids[0], context=context)
+ if not getattr(payload, 'company_id', None):
+ raise ValueError('Case where no default main company is setup '
+ 'not handled yet')
+
+ company = payload.company_id
+ company.write({
+ 'name':payload.name,
+ 'rml_header1':payload.rml_header1,
+ 'rml_footer1':payload.rml_footer1,
+ 'rml_footer2':payload.rml_footer2,
+ 'logo':payload.logo,
+ })
+
+ company.partner_id.write({
+ 'name':payload.name,
+ })
+
+ address_data = {
+ 'name':payload.name,
+ 'street':payload.street,
+ 'street2':payload.street2,
+ 'zip':payload.zip,
+ 'city':payload.city,
+ 'email':payload.email,
+ 'phone':payload.phone,
+ 'country_id':int(payload.country_id),
+ 'state_id':int(payload.state_id),
+ }
+
+ if company.partner_id.address:
+ company.partner_id.address[0].write(
+ address_data)
+ else:
+ self.pool.get('res.partner.address').create(cr, uid,
+ dict(address_data,
+ partner_id=int(company.partner_id)),
+ context=context)
+base_setup_company()
+
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/base_setup/wizard/wizard_base_setup.py b/addons/base_setup/wizard/wizard_base_setup.py
deleted file mode 100644
index 0dd9175129d..00000000000
--- a/addons/base_setup/wizard/wizard_base_setup.py
+++ /dev/null
@@ -1,416 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL ().
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-
-import wizard
-import pooler
-import time
-import tools
-import os
-
-view_form_profit = """
-"""
-
-
-
-view_form_company = """
-"""
-
-view_form_update = """
-
-"""
-
-view_form_finish = """
-
-"""
-
-class wizard_base_setup(wizard.interface):
-
- def _get_profiles(self, cr, uid, context):
- module_obj=pooler.get_pool(cr.dbname).get('ir.module.module')
- ids=module_obj.search(cr, uid, [('category_id', '=', 'Profile'),
- ('state', '<>', 'uninstallable')])
- res=[(m.id, m.shortdesc) for m in module_obj.browse(cr, uid, ids, context=context)]
- res.append((-1, 'Minimal Profile'))
- res.sort()
- return res
-
- def _get_company(self, cr, uid, data, context):
- pool = pooler.get_pool(cr.dbname)
- company_obj = pool.get('res.company')
- ids=company_obj.search(cr, uid, [])
- if not ids:
- return {}
- company = company_obj.browse(cr, uid, ids)[0]
-
- res = {'currency': company.currency_id.id}
-
- for field in 'name logo rml_header1 rml_footer1 rml_footer2'.split():
- res[field] = company[field]
-
- if company.partner_id.address:
- address = company.partner_id.address[0]
- for field in 'street street2 zip city email phone'.split():
- res[field] = address[field]
-
- for field in 'country_id state_id'.split():
- if address[field]:
- res[field] = address[field].id
-
- serv_pro_id = pool.get('ir.module.module').search(cr, uid, [('name','=','profile_service')]) or False
- if serv_pro_id:
- res['profile'] = serv_pro_id[0]
-
- return res
-
-
- def _get_all(self, cr, uid, context, model):
- pool = pooler.get_pool(cr.dbname)
- obj = pool.get(model)
- ids = obj.search(cr, uid, [])
- res = [(o.id, o.name) for o in obj.browse(cr, uid, ids, context=context)]
- res.append((-1, ''))
- res.sort(key=lambda x: x[1])
- return res
-
- def _get_states(self, cr, uid, context):
- return self._get_all(cr, uid, context, 'res.country.state')
-
- def _get_countries(self, cr, uid, context):
- return self._get_all(cr, uid, context, 'res.country')
-
- def _get_currency(self, cr, uid, context):
- return self._get_all(cr, uid, context, 'res.currency')
-
- def _update(self, cr, uid, data, context):
- pool=pooler.get_pool(cr.dbname)
- form=data['form']
- if 'profile' in data['form'] and data['form']['profile'] > 0:
- module_obj=pool.get('ir.module.module')
- module_obj.state_update(cr, uid, [data['form']['profile']], 'to install', ['uninstalled'], context)
-
- company_obj=pool.get('res.company')
- partner_obj=pool.get('res.partner')
- address_obj=pool.get('res.partner.address')
- ids=company_obj.search(cr, uid, [])
- company=company_obj.browse(cr, uid, ids)[0]
- company_obj.write(cr, uid, [company.id], {
- 'name': form['name'],
- 'rml_header1': form['rml_header1'],
- 'rml_footer1': form['rml_footer1'],
- 'rml_footer2': form['rml_footer2'],
- 'currency_id': form['currency'],
- 'logo': form['logo'],
- })
- partner_obj.write(cr, uid, [company.partner_id.id], {
- 'name': form['name'],
- })
- values={
- 'name': form['name'],
- 'street': form['street'],
- 'street2': form['street2'],
- 'zip': form['zip'],
- 'city': form['city'],
- 'email': form['email'],
- 'phone': form['phone'],
- }
- # we can do this, or set res.append((False, '')) in _get_all()
- if form['country_id'] > 0:
- values['country_id'] = form['country_id']
- if form['state_id'] > 0:
- values['state_id'] = form['state_id']
- if company.partner_id.address:
- address=company.partner_id.address[0]
- address_obj.write(cr, uid, [address.id], values)
- else:
- values['partner_id']=company.partner_id.id
- add_id=address_obj.create(cr, uid, values)
-
- cr.commit()
- (db, pool)=pooler.restart_pool(cr.dbname, update_module=True)
-
- return {}
-
- def _menu(self, cr, uid, data, context):
- users_obj=pooler.get_pool(cr.dbname).get('res.users')
- action_obj=pooler.get_pool(cr.dbname).get('ir.actions.act_window')
-
- ids=action_obj.search(cr, uid, [('name', '=', 'Menu')])
- menu=action_obj.browse(cr, uid, ids)[0]
-
- ids=users_obj.search(cr, uid, [('action_id', '=', 'Setup')])
- users_obj.write(cr, uid, ids, {'action_id': menu.id})
- ids=users_obj.search(cr, uid, [('menu_id', '=', 'Setup')])
- users_obj.write(cr, uid, ids, {'menu_id': menu.id})
-
- return {
- 'name': menu.name,
- 'type': menu.type,
- 'view_id': (menu.view_id and\
- (menu.view_id.id, menu.view_id.name)) or False,
- 'domain': menu.domain,
- 'res_model': menu.res_model,
- 'src_model': menu.src_model,
- 'view_type': menu.view_type,
- 'view_mode': menu.view_mode,
- 'views': menu.views,
- }
-
- def _next(self, cr, uid, data, context):
- if not data['form']['profile'] or data['form']['profile'] <= 0:
- return 'company'
- return 'charts'
-
- def _previous(self, cr, uid, data, context):
- if 'profile' not in data['form'] or data['form']['profile'] <= 0:
- return 'init'
- return 'charts'
-
- def _config(self, cr, uid, data, context=None):
- pool = pooler.get_pool(cr.dbname)
- users_obj=pool.get('res.users')
- action_obj=pool.get('ir.actions.act_window')
-
- ids=action_obj.search(cr, uid, [('name', '=', 'Menu')])
- menu=action_obj.browse(cr, uid, ids)[0]
-
- ids=users_obj.search(cr, uid, [('action_id', '=', 'Setup')])
- users_obj.write(cr, uid, ids, {'action_id': menu.id})
- ids=users_obj.search(cr, uid, [('menu_id', '=', 'Setup')])
- users_obj.write(cr, uid, ids, {'menu_id': menu.id})
-
- return pool.get('res.config').next(cr, uid, [], context=context)
-
- fields={
- 'profile':{
- 'string':'Profile',
- 'type':'selection',
- 'selection':_get_profiles,
- 'required': True,
- },
-
- 'name':{
- 'string': 'Company Name',
- 'type': 'char',
- 'size': 64,
- },
- 'street':{
- 'string': 'Street',
- 'type': 'char',
- 'size': 128,
- },
- 'street2':{
- 'string': 'Street2',
- 'type': 'char',
- 'size': 128,
- },
- 'zip':{
- 'string': 'Zip code',
- 'type': 'char',
- 'size': 24,
- },
- 'city':{
- 'string': 'City',
- 'type': 'char',
- 'size': 128,
- },
- 'state_id':{
- 'string': 'State',
- 'type': 'selection',
- 'selection':_get_states,
- },
- 'country_id':{
- 'string': 'Country',
- 'type': 'selection',
- 'selection':_get_countries,
- },
- 'email':{
- 'string': 'E-mail',
- 'type': 'char',
- 'size': 64,
- },
- 'phone':{
- 'string': 'Phone',
- 'type': 'char',
- 'size': 64,
- },
- 'currency': {
- 'string': 'Currency',
- 'type': 'selection',
- 'selection':_get_currency,
- 'required': True,
- },
- 'rml_header1':{
- 'string': 'Report Header',
- 'type': 'char',
- 'help': """This sentence will appear at the top right corner of your reports.
-We suggest you to put a slogan here:
-"Open Source Business Solutions".""",
- 'size': 200,
- },
- 'rml_footer1':{
- 'string': 'Report Footer 1',
- 'type': 'char',
- 'help': """This sentence will appear at the bottom of your reports.
-We suggest you to write legal sentences here:
-Web: http://openerp.com - Fax: +32.81.73.35.01 - Fortis Bank: 126-2013269-07""",
- 'size': 200,
- },
- 'rml_footer2':{
- 'string': 'Report Footer 2',
- 'help': """This sentence will appear at the bottom of your reports.
-We suggest you to put bank information here:
-IBAN: BE74 1262 0121 6907 - SWIFT: CPDF BE71 - VAT: BE0477.472.701""",
- 'type': 'char',
- 'size': 200,
- },
- 'logo':{
- 'string': 'Logo',
- 'type': 'binary',
- },
- }
- states={
- 'init':{
- 'actions': [_get_company],
- 'result': {'type': 'form', 'arch': view_form_profit, 'fields': fields,
- 'state': [
- ('menu', 'Cancel', 'gtk-cancel'),
- ('company', 'Next', 'gtk-go-forward', True)
- ]
- }
- },
-# 'next': {
-# 'actions': [],
-# 'result': {'type': 'choice', 'next_state': _next}
-# },
-# 'charts':{
-# 'actions': [],
-# 'result': {'type': 'form', 'arch': view_form_charts, 'fields': fields,
-# 'state':[
-# ('init', 'Previous', 'gtk-go-back'),
-# ('company', 'Next', 'gtk-go-forward', True)
-# ]
-# }
-# },
- 'company':{
- 'actions': [],
- 'result': {'type': 'form', 'arch': view_form_company, 'fields': fields,
- 'state': [
- ('init', 'Previous', 'gtk-go-back'),
- ('update', 'Next', 'gtk-go-forward', True)
- ]
- }
- },
-# 'previous':{
-# 'actions': [],
-# 'result': {'type': 'choice', 'next_state': _previous}
-# },
- 'update':{
- 'actions': [],
- 'result': {'type': 'form', 'arch': view_form_update, 'fields': fields,
- 'state': [
- ('company', 'Previous', 'gtk-go-back'),
- ('finish', 'Install', 'gtk-ok', True)
- ]
- }
- },
- 'finish':{
- 'actions': [_update],
- 'result': {'type': 'form', 'arch': view_form_finish, 'fields': {},
- 'state': [
- ('menu', 'Use Directly', 'gtk-ok'),
- ('config', 'Start Configuration', 'gtk-go-forward', True)
- ]
- }
- },
- 'config': {
- 'result': {
- 'type': 'action',
- 'action': _config,
- 'state': 'end',
- },
- },
- 'menu': {
- 'actions': [],
- 'result': {'type': 'action', 'action': _menu, 'state': 'end'}
- },
- }
-
-wizard_base_setup('base_setup.base_setup')
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/board/i18n/tr.po b/addons/board/i18n/tr.po
index b99dbf0dd4c..36b59330d9d 100644
--- a/addons/board/i18n/tr.po
+++ b/addons/board/i18n/tr.po
@@ -7,30 +7,30 @@ msgstr ""
"Project-Id-Version: OpenERP Server 5.0.4\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2008-11-21 16:19+0000\n"
-"Last-Translator: Tugrulbey \n"
+"PO-Revision-Date: 2010-02-07 02:18+0000\n"
+"Last-Translator: Oktay Altunergil \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2009-12-16 05:20+0000\n"
+"X-Launchpad-Export-Date: 2010-02-08 04:45+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: board
#: constraint:ir.model:0
msgid ""
"The Object name must start with x_ and not contain any special character !"
-msgstr ""
+msgstr "Nesne adı x_ ile başlamalı ve özel karakterler içermemelidir!"
#. module: board
#: model:ir.model,name:board.model_board_board
msgid "board.board"
-msgstr ""
+msgstr "board.board"
#. module: board
#: field:board.note,user_id:0
msgid "Author"
-msgstr "Yazar"
+msgstr "Yazan"
#. module: board
#: model:ir.module.module,shortdesc:board.module_meta_information
@@ -51,7 +51,7 @@ msgstr "Genişlik"
#. module: board
#: constraint:ir.actions.act_window:0
msgid "Invalid model name in the action definition."
-msgstr ""
+msgstr "İşlem tanımlamasında geçersiz model adı."
#. module: board
#: field:board.board.line,name:0
diff --git a/addons/board_project/__terp__.py b/addons/board_project/__terp__.py
index 558b633d36e..c2667fd113a 100644
--- a/addons/board_project/__terp__.py
+++ b/addons/board_project/__terp__.py
@@ -36,7 +36,7 @@ This module implements a dashboard for project member that includes:
'project',
'report_timesheet',
'board',
- 'report_analytic_planning',
+ 'project_planning',
'report_analytic_line',
'report_task',
'hr_timesheet_sheet',
diff --git a/addons/board_project/board_project_manager_view.xml b/addons/board_project/board_project_manager_view.xml
index 3baca91bce6..893a3a7df68 100644
--- a/addons/board_project/board_project_manager_view.xml
+++ b/addons/board_project/board_project_manager_view.xml
@@ -64,7 +64,7 @@
-
+
diff --git a/addons/board_sale/i18n/it.po b/addons/board_sale/i18n/it.po
index 141f8c2afed..4eed0da04cc 100644
--- a/addons/board_sale/i18n/it.po
+++ b/addons/board_sale/i18n/it.po
@@ -7,25 +7,25 @@ msgstr ""
"Project-Id-Version: OpenERP Server 5.0.0\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:57+0000\n"
-"Last-Translator: LucaSub \n"
+"PO-Revision-Date: 2010-02-05 08:57+0000\n"
+"Last-Translator: Carlo Vettore \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2009-12-16 05:06+0000\n"
+"X-Launchpad-Export-Date: 2010-02-06 04:53+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: board_sale
#: model:ir.module.module,shortdesc:board_sale.module_meta_information
msgid "Dashboard for sales"
-msgstr ""
+msgstr "Cruscotto per le vendite"
#. module: board_sale
#: model:ir.actions.act_window,name:board_sale.open_board_sales_manager
#: model:ir.ui.menu,name:board_sale.menu_board_sales_manager
msgid "Sale Dashboard"
-msgstr "Dashboard Vendite"
+msgstr "Cruscotto Vendite"
#. module: board_sale
#: view:board.board:0
@@ -40,7 +40,7 @@ msgstr "Dashboard Sales Manager"
#. module: board_sale
#: view:board.board:0
msgid "Cases of the month"
-msgstr ""
+msgstr "Casi del Mese"
#. module: board_sale
#: constraint:ir.ui.view:0
@@ -55,7 +55,7 @@ msgstr "Le Mie Domande Aperte"
#. module: board_sale
#: constraint:ir.actions.act_window:0
msgid "Invalid model name in the action definition."
-msgstr ""
+msgstr "Nome del modulo non valido nella definizione dell'azione."
#. module: board_sale
#: model:ir.ui.menu,name:board_sale.next_id_88
diff --git a/addons/caldav/caldav.py b/addons/caldav/caldav.py
index d440902f9e2..f8c30e10478 100644
--- a/addons/caldav/caldav.py
+++ b/addons/caldav/caldav.py
@@ -172,6 +172,99 @@ html_invitation = """