diff --git a/README.md b/README.md
index d76976405b3..d5570e7a028 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-[](http://runbot.odoo.com/runbot)
+[](http://runbot.odoo.com/runbot)
Odoo
----
diff --git a/addons/account/__init__.py b/addons/account/__init__.py
index bc27e14380c..3d6f6061a72 100644
--- a/addons/account/__init__.py
+++ b/addons/account/__init__.py
@@ -22,7 +22,6 @@
import partner
import account
import installer
-import project
import account_invoice
import account_bank_statement
import account_bank
diff --git a/addons/account/__openerp__.py b/addons/account/__openerp__.py
index b5aa1cbb20d..42cb8c89c73 100644
--- a/addons/account/__openerp__.py
+++ b/addons/account/__openerp__.py
@@ -97,24 +97,16 @@ for a particular financial year and for preparation of vouchers there is a modul
'wizard/account_automatic_reconcile_view.xml',
'wizard/account_financial_report_view.xml',
'wizard/pos_box.xml',
- 'project/wizard/project_account_analytic_line_view.xml',
'account_end_fy.xml',
'account_invoice_view.xml',
'data/account_data.xml',
'data/data_account_type.xml',
'data/configurable_account_chart.xml',
'account_invoice_workflow.xml',
- 'project/project_view.xml',
- 'project/project_report.xml',
- 'project/wizard/account_analytic_balance_report_view.xml',
- 'project/wizard/account_analytic_cost_ledger_view.xml',
- 'project/wizard/account_analytic_inverted_balance_report.xml',
- 'project/wizard/account_analytic_journal_report_view.xml',
- 'project/wizard/account_analytic_cost_ledger_for_journal_report_view.xml',
- 'project/wizard/account_analytic_chart_view.xml',
'partner_view.xml',
'product_view.xml',
'account_assert_test.xml',
+ 'account_analytic_view.xml',
'ir_sequence_view.xml',
'company_view.xml',
'edi/invoice_action_data.xml',
@@ -135,11 +127,6 @@ for a particular financial year and for preparation of vouchers there is a modul
'views/report_partnerledgerother.xml',
'views/report_financial.xml',
'views/report_generalledger.xml',
- 'project/views/report_analyticbalance.xml',
- 'project/views/report_analyticjournal.xml',
- 'project/views/report_analyticcostledgerquantity.xml',
- 'project/views/report_analyticcostledger.xml',
- 'project/views/report_invertedanalyticbalance.xml',
'views/account.xml',
],
'qweb' : [
@@ -149,8 +136,6 @@ for a particular financial year and for preparation of vouchers there is a modul
],
'demo': [
'demo/account_demo.xml',
- 'project/project_demo.xml',
- 'project/analytic_account_demo.xml',
'demo/account_minimal.xml',
'demo/account_invoice_demo.xml',
'demo/account_bank_statement.xml',
diff --git a/addons/account/account.py b/addons/account/account.py
index 1aa3d490f15..19576d1cf98 100644
--- a/addons/account/account.py
+++ b/addons/account/account.py
@@ -669,7 +669,7 @@ class account_account(osv.osv):
# For legal reason (forbiden to modify journal entries which belongs to a closed fy or period), Forbid to modify
# the code of an account if journal entries have been already posted on this account. This cannot be simply
- # 'configurable' since it can lead to a lack of confidence in OpenERP and this is what we want to change.
+ # 'configurable' since it can lead to a lack of confidence in Odoo and this is what we want to change.
def _check_allow_code_change(self, cr, uid, ids, context=None):
line_obj = self.pool.get('account.move.line')
for account in self.browse(cr, uid, ids, context=context):
@@ -738,6 +738,7 @@ class account_journal(osv.osv):
'loss_account_id' : fields.many2one('account.account', 'Loss Account'),
'internal_account_id' : fields.many2one('account.account', 'Internal Transfers Account', select=1),
'cash_control' : fields.boolean('Cash Control', help='If you want the journal should be control at opening/closing, check this option'),
+ 'analytic_journal_id':fields.many2one('account.analytic.journal','Analytic Journal', help="Journal for analytic entries"),
}
_defaults = {
@@ -2488,7 +2489,7 @@ class account_account_template(osv.osv):
('other','Regular'),
('closed','Closed'),
], 'Internal Type', required=True,help="This type is used to differentiate types with "\
- "special effects in OpenERP: view can not have entries, consolidation are accounts that "\
+ "special effects in Odoo: view can not have entries, consolidation are accounts that "\
"can have children accounts for multi-company consolidations, payable/receivable are for "\
"partners accounts (for debit/credit computations), closed for depreciated accounts."),
'user_type': fields.many2one('account.account.type', 'Account Type', required=True,
diff --git a/addons/account/account_analytic_line.py b/addons/account/account_analytic_line.py
index d5ec3496d92..641cd5995c7 100644
--- a/addons/account/account_analytic_line.py
+++ b/addons/account/account_analytic_line.py
@@ -29,13 +29,14 @@ class account_analytic_line(osv.osv):
_columns = {
'product_uom_id': fields.many2one('product.uom', 'Unit of Measure'),
'product_id': fields.many2one('product.product', 'Product'),
- 'general_account_id': fields.many2one('account.account', 'General Account', required=True, ondelete='restrict'),
+ 'general_account_id': fields.many2one('account.account', 'Financial Account', required=True, ondelete='restrict'),
'move_id': fields.many2one('account.move.line', 'Move Line', ondelete='cascade', select=True),
'journal_id': fields.many2one('account.analytic.journal', 'Analytic Journal', required=True, ondelete='restrict', select=True),
'code': fields.char('Code', size=8),
'ref': fields.char('Ref.'),
'currency_id': fields.related('move_id', 'currency_id', type='many2one', relation='res.currency', string='Account Currency', store=True, help="The related account currency if not equal to the company one.", readonly=True),
'amount_currency': fields.related('move_id', 'amount_currency', type='float', string='Amount Currency', store=True, help="The amount expressed in the related account currency if not equal to the company one.", readonly=True),
+ 'partner_id': fields.related('account_id', 'partner_id', type='many2one', relation='res.partner', string='Partner', store=True),
}
_defaults = {
@@ -74,13 +75,19 @@ class account_analytic_line(osv.osv):
product_obj = self.pool.get('product.product')
analytic_journal_obj =self.pool.get('account.analytic.journal')
product_price_type_obj = self.pool.get('product.price.type')
+ product_uom_obj = self.pool.get('product.uom')
j_id = analytic_journal_obj.browse(cr, uid, journal_id, context=context)
prod = product_obj.browse(cr, uid, prod_id, context=context)
result = 0.0
if prod_id:
- unit = prod.uom_id.id
+ unit_obj = False
+ if unit:
+ unit_obj = product_uom_obj.browse(cr, uid, unit, context=context)
+ if not unit_obj or prod.uom_id.category_id.id != unit_obj.category_id.id:
+ unit = prod.uom_id.id
if j_id.type == 'purchase':
- unit = prod.uom_po_id.id
+ if not unit_obj or prod.uom_po_id.category_id.id != unit_obj.category_id.id:
+ unit = prod.uom_po_id.id
if j_id.type <> 'sale':
a = prod.property_account_expense.id
if not a:
diff --git a/addons/account/account_analytic_view.xml b/addons/account/account_analytic_view.xml
new file mode 100644
index 00000000000..c73e0cbfd73
--- /dev/null
+++ b/addons/account/account_analytic_view.xml
@@ -0,0 +1,127 @@
+
+
+
+
+ account.analytic.line.form.inherit.account
+ account.analytic.line
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ account.analytic.line.tree.inherit.account
+ account.analytic.line
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ account.analytic.line.select.inherit.account
+ account.analytic.line
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ account.journal.form.1
+ account.journal
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/account/account_bank_statement.py b/addons/account/account_bank_statement.py
index 65dae8a2cc1..4d9c3f3efbd 100644
--- a/addons/account/account_bank_statement.py
+++ b/addons/account/account_bank_statement.py
@@ -326,16 +326,26 @@ class account_bank_statement(osv.osv):
or (not st.journal_id.default_debit_account_id):
raise osv.except_osv(_('Configuration Error!'), _('Please verify that an account is defined in the journal.'))
for line in st.move_line_ids:
- if line.state <> 'valid':
+ if line.state != 'valid':
raise osv.except_osv(_('Error!'), _('The account entries lines are not in valid state.'))
move_ids = []
for st_line in st.line_ids:
if not st_line.amount:
continue
- if not st_line.journal_entry_id.id:
+ if st_line.account_id and not st_line.journal_entry_id.id:
+ #make an account move as before
+ vals = {
+ 'debit': st_line.amount < 0 and -st_line.amount or 0.0,
+ 'credit': st_line.amount > 0 and st_line.amount or 0.0,
+ 'account_id': st_line.account_id.id,
+ 'name': st_line.name
+ }
+ self.pool.get('account.bank.statement.line').process_reconciliation(cr, uid, st_line.id, [vals], context=context)
+ elif not st_line.journal_entry_id.id:
raise osv.except_osv(_('Error!'), _('All the account entries lines must be processed in order to close the statement.'))
move_ids.append(st_line.journal_entry_id.id)
- self.pool.get('account.move').post(cr, uid, move_ids, context=context)
+ if move_ids:
+ self.pool.get('account.move').post(cr, uid, move_ids, context=context)
self.message_post(cr, uid, [st.id], body=_('Statement %s confirmed, journal items were created.') % (st.name,), context=context)
self.link_bank_to_partner(cr, uid, ids, context=context)
return self.write(cr, uid, ids, {'state': 'confirm'}, context=context)
@@ -728,7 +738,12 @@ class account_bank_statement_line(osv.osv):
move_id = am_obj.create(cr, uid, move_vals, context=context)
# Create the move line for the statement line
- amount = currency_obj.compute(cr, uid, st_line.statement_id.currency.id, company_currency.id, st_line.amount, context=context)
+ if st_line.statement_id.currency.id != company_currency.id:
+ ctx = context.copy()
+ ctx['date'] = st_line.date
+ amount = currency_obj.compute(cr, uid, st_line.statement_id.currency.id, company_currency.id, st_line.amount_currency, context=ctx)
+ else:
+ amount = st_line.amount
bank_st_move_vals = bs_obj._prepare_bank_move_line(cr, uid, st_line, move_id, amount, company_currency.id, context=context)
aml_obj.create(cr, uid, bank_st_move_vals, context=context)
# Complete the dicts
@@ -805,18 +820,19 @@ class account_bank_statement_line(osv.osv):
_description = "Bank Statement Line"
_inherit = ['ir.needaction_mixin']
_columns = {
- 'name': fields.char('Description', required=True, copy=False),
- 'date': fields.date('Date', required=True, copy=False),
+ 'name': fields.char('Description', required=True),
+ 'date': fields.date('Date', required=True),
'amount': fields.float('Amount', digits_compute=dp.get_precision('Account')),
'partner_id': fields.many2one('res.partner', 'Partner'),
'bank_account_id': fields.many2one('res.partner.bank','Bank Account'),
+ 'account_id': fields.many2one('account.account', 'Account', help="This technical field can be used at the statement line creation/import time in order to avoid the reconciliation process on it later on. The statement line will simply create a counterpart on this account"),
'statement_id': fields.many2one('account.bank.statement', 'Statement', select=True, required=True, ondelete='cascade'),
'journal_id': fields.related('statement_id', 'journal_id', type='many2one', relation='account.journal', string='Journal', store=True, readonly=True),
'ref': fields.char('Structured Communication'),
'note': fields.text('Notes'),
'sequence': fields.integer('Sequence', select=True, help="Gives the sequence order when displaying a list of bank statement lines."),
'company_id': fields.related('statement_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, readonly=True),
- 'journal_entry_id': fields.many2one('account.move', 'Journal Entry'),
+ 'journal_entry_id': fields.many2one('account.move', 'Journal Entry', copy=False),
'amount_currency': fields.float('Amount Currency', help="The amount expressed in an optional other currency if it is a multi-currency entry.", digits_compute=dp.get_precision('Account')),
'currency_id': fields.many2one('res.currency', 'Currency', help="The optional other currency if it is a multi-currency entry."),
}
diff --git a/addons/account/account_bank_view.xml b/addons/account/account_bank_view.xml
index ef793a1bef5..426309e0c34 100644
--- a/addons/account/account_bank_view.xml
+++ b/addons/account/account_bank_view.xml
@@ -47,7 +47,7 @@
Configure your company's bank account and select those that must
appear on the report footer.
- If you use the accounting application of OpenERP, journals and
+ If you use the accounting application of Odoo, journals and
accounts will be created automatically based on these data.
diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py
index f9e9ff2813d..a8be8375044 100644
--- a/addons/account/account_invoice.py
+++ b/addons/account/account_invoice.py
@@ -379,7 +379,7 @@ class account_invoice(models.Model):
assert len(self) == 1, 'This option should only be used for a single id at a time.'
template = self.env.ref('account.email_template_edi_invoice', False)
compose_form = self.env.ref('mail.email_compose_message_wizard_form', False)
- ctx = dict(self._context,
+ ctx = dict(
default_model='account.invoice',
default_res_id=self.id,
default_use_template=bool(template),
@@ -793,7 +793,10 @@ class account_invoice(models.Model):
continue
ctx = dict(self._context, lang=inv.partner_id.lang)
- date_invoice = inv.date_invoice or fields.Date.context_today(self)
+
+ if not inv.date_invoice:
+ inv.with_context(ctx).write({'date_invoice': fields.Date.context_today(self)})
+ date_invoice = inv.date_invoice
company_currency = inv.company_id.currency_id
# create the analytical lines, one move line per invoice line
@@ -906,7 +909,6 @@ class account_invoice(models.Model):
move = account_move.with_context(ctx).create(move_vals)
# make the invoice point to that move
vals = {
- 'date_invoice': date_invoice,
'move_id': move.id,
'period_id': period.id,
'move_name': move.name,
@@ -1005,15 +1007,18 @@ class account_invoice(models.Model):
#TODO: implement messages system
return True
- @api.one
- def _compute_display_name(self):
+ @api.multi
+ def name_get(self):
TYPES = {
'out_invoice': _('Invoice'),
'in_invoice': _('Supplier Invoice'),
'out_refund': _('Refund'),
'in_refund': _('Supplier Refund'),
}
- self.display_name = "%s %s" % (self.number or TYPES[self.type], self.name or '')
+ result = []
+ for inv in self:
+ result.append((inv.id, "%s %s" % (inv.number or TYPES[inv.type], inv.name or '')))
+ return result
@api.model
def name_search(self, name, args=None, operator='ilike', limit=100):
@@ -1627,8 +1632,8 @@ class mail_compose_message(models.Model):
context.get('default_res_id') and context.get('mark_invoice_as_sent'):
invoice = self.env['account.invoice'].browse(context['default_res_id'])
invoice = invoice.with_context(mail_post_autofollow=True)
- self.write({'sent': True})
- self.message_post(body=_("Invoice sent"))
+ invoice.write({'sent': True})
+ invoice.message_post(body=_("Invoice sent"))
return super(mail_compose_message, self).send_mail()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml
index 64159dab18d..93dd7bf2e41 100644
--- a/addons/account/account_invoice_view.xml
+++ b/addons/account/account_invoice_view.xml
@@ -61,7 +61,7 @@
-
+
@@ -95,7 +95,7 @@
-
+
@@ -201,7 +201,7 @@
domain="[('company_id', '=', parent.company_id), ('journal_id', '=', parent.journal_id), ('type', '=', 'other')]"
on_change="onchange_account_id(product_id, parent.partner_id, parent.type, parent.fiscal_position,account_id)"/>
+ domain="[('type','!=','view'), ('company_id', '=', parent.company_id), ('state','not in',('close','cancelled'))]"/>
@@ -358,7 +358,7 @@
domain="[('company_id', '=', parent.company_id), ('journal_id', '=', parent.journal_id), ('type', '=', 'other')]"
on_change="onchange_account_id(product_id, parent.partner_id, parent.type, parent.fiscal_position,account_id)"/>
+ domain="[('type','!=','view'), ('company_id', '=', parent.company_id), ('state','not in',('close','cancelled'))]"/>
@@ -523,7 +523,7 @@
Click to create a customer invoice.
- OpenERP's electronic invoicing allows to ease and fasten the
+ Odoo's electronic invoicing allows to ease and fasten the
collection of customer payments. Your customer receives the
invoice by email and he can pay online and/or import it
in his own system.
@@ -564,7 +564,7 @@
Click to record a new supplier invoice.
You can control the invoice from your supplier according to
- what you purchased or received. OpenERP can also generate
+ what you purchased or received. Odoo can also generate
draft invoices automatically from purchase orders or receipts.
diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py
index 776111613ec..c513261a9cf 100644
--- a/addons/account/account_move_line.py
+++ b/addons/account/account_move_line.py
@@ -583,7 +583,7 @@ class account_move_line(osv.osv):
def _check_no_view(self, cr, uid, ids, context=None):
lines = self.browse(cr, uid, ids, context=context)
for l in lines:
- if l.account_id.type == 'view':
+ if l.account_id.type in ('view', 'consolidation'):
return False
return True
@@ -635,7 +635,7 @@ class account_move_line(osv.osv):
return True
_constraints = [
- (_check_no_view, 'You cannot create journal items on an account of type view.', ['account_id']),
+ (_check_no_view, 'You cannot create journal items on an account of type view or consolidation.', ['account_id']),
(_check_no_closed, 'You cannot create journal items on closed account.', ['account_id']),
(_check_company_id, 'Account and Period must belong to the same company.', ['company_id']),
(_check_date, 'The date of your Journal Entry is not in the defined period! You should change the date or remove this constraint from the journal.', ['date']),
@@ -1038,6 +1038,8 @@ class account_move_line(osv.osv):
all_moves = list(set(all_moves) - set(move_ids))
if unlink_ids:
if opening_reconciliation:
+ raise osv.except_osv(_('Warning!'),
+ _('Opening Entries have already been generated. Please run "Cancel Closing Entries" wizard to cancel those entries and then run this wizard.'))
obj_move_rec.write(cr, uid, unlink_ids, {'opening_reconciliation': False})
obj_move_rec.unlink(cr, uid, unlink_ids)
if len(all_moves) >= 2:
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index d11fa30726c..47f21266c18 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -650,7 +650,7 @@
occurring over a given period of time on a bank account. You
should receive this periodicaly from your bank.
- OpenERP allows you to reconcile a statement line directly with
+ Odoo allows you to reconcile a statement line directly with
the related sale or puchase invoices.
@@ -920,7 +920,7 @@
Click to define a new tax code.
Depending on the country, a tax code is usually a cell to fill
- in your legal tax statement. OpenERP allows you to define the
+ in your legal tax statement. Odoo allows you to define the
tax structure and each tax computation will be registered in
one or several tax code.
@@ -1269,8 +1269,8 @@
Select the period and the journal you want to fill.
This view can be used by accountants in order to quickly record
- entries in OpenERP. If you want to record a supplier invoice,
- start by recording the line of the expense account. OpenERP
+ entries in Odoo. If you want to record a supplier invoice,
+ start by recording the line of the expense account. Odoo
will propose to you automatically the Tax related to this
account and the counterpart "Account Payable".
@@ -1506,7 +1506,7 @@
A journal entry consists of several journal items, each of
which is either a debit or a credit transaction.
- OpenERP automatically creates one journal entry per accounting
+ Odoo automatically creates one journal entry per accounting
document: invoice, refund, supplier payment, bank statements,
etc. So, you should record journal entries manually only/mainly
for miscellaneous operations.
@@ -1925,7 +1925,7 @@
-
+
diff --git a/addons/account/demo/account_minimal.xml b/addons/account/demo/account_minimal.xml
index 3940c1e5357..54ced4602c8 100644
--- a/addons/account/demo/account_minimal.xml
+++ b/addons/account/demo/account_minimal.xml
@@ -315,7 +315,7 @@
-
+
@@ -325,7 +325,7 @@
-
+
@@ -357,7 +357,7 @@
-
+
@@ -367,7 +367,7 @@
-
+
@@ -381,13 +381,13 @@
-
+
@@ -395,7 +395,7 @@
TMISgeneral
-
+
diff --git a/addons/account/partner.py b/addons/account/partner.py
index 8c47967b44c..9c8220cbb9c 100644
--- a/addons/account/partner.py
+++ b/addons/account/partner.py
@@ -22,6 +22,7 @@
from operator import itemgetter
import time
+from openerp import SUPERUSER_ID
from openerp.osv import fields, osv
from openerp import api
@@ -222,8 +223,9 @@ class res_partner(osv.osv):
result = {}
account_invoice_report = self.pool.get('account.invoice.report')
for partner in self.browse(cr, uid, ids, context=context):
- invoice_ids = account_invoice_report.search(cr, uid, [('partner_id','child_of',partner.id)], context=context)
- invoices = account_invoice_report.browse(cr, uid, invoice_ids, context=context)
+ domain = [('partner_id', 'child_of', partner.id)]
+ invoice_ids = account_invoice_report.search(cr, SUPERUSER_ID, domain, context=context)
+ invoices = account_invoice_report.browse(cr, SUPERUSER_ID, invoice_ids, context=context)
result[partner.id] = sum(inv.user_currency_price_total for inv in invoices)
return result
@@ -267,7 +269,8 @@ class res_partner(osv.osv):
fnct_search=_credit_search, string='Total Receivable', multi='dc', help="Total amount this customer owes you."),
'debit': fields.function(_credit_debit_get, fnct_search=_debit_search, string='Total Payable', multi='dc', help="Total amount you have to pay to this supplier."),
'debit_limit': fields.float('Payable Limit'),
- 'total_invoiced': fields.function(_invoice_total, string="Total Invoiced", type='float'),
+ 'total_invoiced': fields.function(_invoice_total, string="Total Invoiced", type='float', groups='account.group_account_invoice'),
+
'contracts_count': fields.function(_journal_item_count, string="Contracts", type='integer', multi="invoice_journal"),
'journal_item_count': fields.function(_journal_item_count, string="Journal Items", type="integer", multi="invoice_journal"),
'property_account_payable': fields.property(
diff --git a/addons/account/partner_view.xml b/addons/account/partner_view.xml
index 309296c7955..679baa8ee50 100644
--- a/addons/account/partner_view.xml
+++ b/addons/account/partner_view.xml
@@ -62,8 +62,8 @@
{'search_default_partner_id': [active_id], 'default_partner_id': active_id}Contracts/Analytic Accountsaccount.analytic.account
-
-
+
+ partner.view.buttons
@@ -74,6 +74,7 @@
+ attrs="{'readonly':[('sale_ok','=',0)]}"/>
).
-#
-# 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 project
-import report
-import wizard
-
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/account/project/project.py b/addons/account/project/project.py
deleted file mode 100644
index ec89fd8dcbc..00000000000
--- a/addons/account/project/project.py
+++ /dev/null
@@ -1,50 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2009 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 openerp.osv import fields, osv
-
-class account_analytic_journal(osv.osv):
- _name = 'account.analytic.journal'
- _description = 'Analytic Journal'
- _columns = {
- 'name': fields.char('Journal Name', required=True),
- 'code': fields.char('Journal Code', size=8),
- 'active': fields.boolean('Active', help="If the active field is set to False, it will allow you to hide the analytic journal without removing it."),
- 'type': fields.selection([('sale','Sale'), ('purchase','Purchase'), ('cash','Cash'), ('general','General'), ('situation','Situation')], 'Type', required=True, help="Gives the type of the analytic journal. When it needs for a document (eg: an invoice) to create analytic entries, OpenERP will look for a matching journal of the same type."),
- 'line_ids': fields.one2many('account.analytic.line', 'journal_id', 'Lines'),
- 'company_id': fields.many2one('res.company', 'Company', required=True),
- }
- _defaults = {
- 'active': True,
- 'type': 'general',
- 'company_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id,
- }
-
-
-class account_journal(osv.osv):
- _inherit="account.journal"
-
- _columns = {
- 'analytic_journal_id':fields.many2one('account.analytic.journal','Analytic Journal', help="Journal for analytic entries"),
- }
-
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/project/wizard/project_account_analytic_line.py b/addons/account/project/wizard/project_account_analytic_line.py
deleted file mode 100644
index 40777f73e7d..00000000000
--- a/addons/account/project/wizard/project_account_analytic_line.py
+++ /dev/null
@@ -1,57 +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 .
-#
-##############################################################################
-from openerp.osv import fields, osv
-from openerp.tools.translate import _
-
-class project_account_analytic_line(osv.osv_memory):
- _name = "project.account.analytic.line"
- _description = "Analytic Entries by line"
- _columns = {
- 'from_date': fields.date('From'),
- 'to_date': fields.date('To'),
- }
-
- def action_open_window(self, cr, uid, ids, context=None):
- mod_obj =self.pool.get('ir.model.data')
- domain = []
- data = self.read(cr, uid, ids, [])[0]
- from_date = data['from_date']
- to_date = data['to_date']
- if from_date and to_date:
- domain = [('date','>=',from_date), ('date','<=',to_date)]
- elif from_date:
- domain = [('date','>=',from_date)]
- elif to_date:
- domain = [('date','<=',to_date)]
- result = mod_obj.get_object_reference(cr, uid, 'account', 'view_account_analytic_line_filter')
- id = result and result[1] or False
- return {
- 'name': _('Analytic Entries by line'),
- 'view_type': 'form',
- "view_mode": 'tree,form',
- 'res_model': 'account.analytic.line',
- 'type': 'ir.actions.act_window',
- 'domain': domain,
- 'search_view_id': id['res_id'],
- }
-
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/project/wizard/project_account_analytic_line_view.xml b/addons/account/project/wizard/project_account_analytic_line_view.xml
deleted file mode 100644
index ac3047e7e1d..00000000000
--- a/addons/account/project/wizard/project_account_analytic_line_view.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-
-
-
- project.account.analytic.line.form
- project.account.analytic.line
-
-
-
-
-
-
- Entries By Line
- project.account.analytic.line
- form
- tree,form
-
- new
-
-
-
-
diff --git a/addons/account/report/account_analytic_entries_report.py b/addons/account/report/account_analytic_entries_report.py
index 1cd0f4c9026..a5da58eb4b8 100644
--- a/addons/account/report/account_analytic_entries_report.py
+++ b/addons/account/report/account_analytic_entries_report.py
@@ -33,8 +33,8 @@ class analytic_entries_report(osv.osv):
'partner_id': fields.many2one('res.partner', 'Partner'),
'company_id': fields.many2one('res.company', 'Company', required=True),
'currency_id': fields.many2one('res.currency', 'Currency', required=True),
- 'account_id': fields.many2one('account.analytic.account', 'Account', required=False),
- 'general_account_id': fields.many2one('account.account', 'General Account', required=True),
+ 'account_id': fields.many2one('account.analytic.account', 'Analytic Account', required=False),
+ 'general_account_id': fields.many2one('account.account', 'Financial Account', required=True),
'journal_id': fields.many2one('account.analytic.journal', 'Journal', required=True),
'move_id': fields.many2one('account.move.line', 'Move', required=True),
'product_id': fields.many2one('product.product', 'Product', required=True),
diff --git a/addons/account/report/account_analytic_entries_report_view.xml b/addons/account/report/account_analytic_entries_report_view.xml
index ee7bc934ce3..ac0551de8f8 100644
--- a/addons/account/report/account_analytic_entries_report_view.xml
+++ b/addons/account/report/account_analytic_entries_report_view.xml
@@ -14,15 +14,13 @@
-
-
+
+
-
-
-
+
diff --git a/addons/account/report/account_entries_report.py b/addons/account/report/account_entries_report.py
index a0789ba8860..2a8049ba403 100644
--- a/addons/account/report/account_entries_report.py
+++ b/addons/account/report/account_entries_report.py
@@ -37,14 +37,8 @@ class account_entries_report(osv.osv):
'debit': fields.float('Debit', readonly=True),
'credit': fields.float('Credit', readonly=True),
'balance': fields.float('Balance', readonly=True),
- 'day': fields.char('Day', size=128, readonly=True),
- 'year': fields.char('Year', size=4, readonly=True),
- 'date': fields.date('Date', size=128, readonly=True),
'currency_id': fields.many2one('res.currency', 'Currency', readonly=True),
'amount_currency': fields.float('Amount Currency', digits_compute=dp.get_precision('Account'), readonly=True),
- 'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'),
- ('05','May'), ('06','June'), ('07','July'), ('08','August'), ('09','September'),
- ('10','October'), ('11','November'), ('12','December')], 'Month', readonly=True),
'period_id': fields.many2one('account.period', 'Period', readonly=True),
'account_id': fields.many2one('account.account', 'Account', readonly=True),
'journal_id': fields.many2one('account.journal', 'Journal', readonly=True),
@@ -53,7 +47,7 @@ class account_entries_report(osv.osv):
'product_uom_id': fields.many2one('product.uom', 'Product Unit of Measure', readonly=True),
'move_state': fields.selection([('draft','Unposted'), ('posted','Posted')], 'Status', readonly=True),
'move_line_state': fields.selection([('draft','Unbalanced'), ('valid','Valid')], 'State of Move Line', readonly=True),
- 'reconcile_id': fields.many2one('account.move.reconcile', readonly=True),
+ 'reconcile_id': fields.many2one('account.move.reconcile', 'Reconciliation number', readonly=True),
'partner_id': fields.many2one('res.partner','Partner', readonly=True),
'analytic_account_id': fields.many2one('account.analytic.account', 'Analytic Account', readonly=True),
'quantity': fields.float('Products Quantity', digits=(16,2), readonly=True),
@@ -67,7 +61,7 @@ class account_entries_report(osv.osv):
('other', 'Regular'),
('closed', 'Closed'),
], 'Internal Type', readonly=True, help="This type is used to differentiate types with "\
- "special effects in OpenERP: view can not have entries, consolidation are accounts that "\
+ "special effects in Odoo: view can not have entries, consolidation are accounts that "\
"can have children accounts for multi-company consolidations, payable/receivable are for "\
"partners accounts (for debit/credit computations), closed for depreciated accounts."),
'company_id': fields.many2one('res.company', 'Company', readonly=True),
@@ -123,9 +117,6 @@ class account_entries_report(osv.osv):
am.state as move_state,
l.state as move_line_state,
l.reconcile_id as reconcile_id,
- to_char(am.date, 'YYYY') as year,
- to_char(am.date, 'MM') as month,
- to_char(am.date, 'YYYY-MM-DD') as day,
l.partner_id as partner_id,
l.product_id as product_id,
l.product_uom_id as product_uom_id,
diff --git a/addons/account/report/account_entries_report_view.xml b/addons/account/report/account_entries_report_view.xml
index dbff131388d..f52717d5c73 100644
--- a/addons/account/report/account_entries_report_view.xml
+++ b/addons/account/report/account_entries_report_view.xml
@@ -18,9 +18,6 @@
-
-
-
diff --git a/addons/account/report/account_invoice_report_view.xml b/addons/account/report/account_invoice_report_view.xml
index 1aaf2ff98e8..3fcae5d711b 100644
--- a/addons/account/report/account_invoice_report_view.xml
+++ b/addons/account/report/account_invoice_report_view.xml
@@ -86,9 +86,7 @@
-
-
-
+
diff --git a/addons/account/res_config.py b/addons/account/res_config.py
index 65f38d6e26b..f729f8070aa 100644
--- a/addons/account/res_config.py
+++ b/addons/account/res_config.py
@@ -42,7 +42,7 @@ class account_config_settings(osv.osv_memory):
'currency_id': fields.related('company_id', 'currency_id', type='many2one', relation='res.currency', required=True,
string='Default company currency', help="Main currency of the company."),
'paypal_account': fields.related('company_id', 'paypal_account', type='char', size=128,
- string='Paypal account', help="Paypal account (email) for receiving online payments (credit card, etc.) If you set a paypal account, the customer will be able to pay your invoices or quotations with a button \"Pay with Paypal\" in automated emails or through the OpenERP portal."),
+ string='Paypal account', help="Paypal account (email) for receiving online payments (credit card, etc.) If you set a paypal account, the customer will be able to pay your invoices or quotations with a button \"Pay with Paypal\" in automated emails or through the Odoo portal."),
'company_footer': fields.related('company_id', 'rml_footer', type='text', readonly=True,
string='Bank accounts footer preview', help="Bank accounts as printed in the footer of each printed document"),
@@ -108,6 +108,12 @@ class account_config_settings(osv.osv_memory):
'module_product_email_template': fields.boolean('Send products tools and information at the invoice confirmation',
help='With this module, link your products to a template to send complete information and tools to your customer.\n'
'For instance when invoicing a training, the training agenda and materials will automatically be send to your customers.'),
+ 'module_account_bank_statement_import_ofx': fields.boolean('Import of Bank Statements in .OFX Format',
+ help='Get your bank statements from you bank and import them in Odoo in .OFX format.\n'
+ '-that installs the module account_bank_statement_import.'),
+ 'module_account_bank_statement_import_qif': fields.boolean('Import of Bank Statements in .QIF Format.',
+ help='Get your bank statements from you bank and import them in Odoo in .QIF format.\n'
+ '-that installs the module account_bank_statement_import_qif.'),
'group_proforma_invoices': fields.boolean('Allow pro-forma invoices',
implied_group='account.group_proforma_invoices',
help="Allows you to put invoices in pro-forma state."),
diff --git a/addons/account/res_config_view.xml b/addons/account/res_config_view.xml
index 0740e2c0f39..5e43fd15d0c 100644
--- a/addons/account/res_config_view.xml
+++ b/addons/account/res_config_view.xml
@@ -243,7 +243,18 @@
-By far the most beautiful and full featured accounting software. OpenERP Accounting allows a better way to collaborate with your accountants, your customers and control your suppliers.
+By far the most beautiful and full featured accounting software. Odoo Accounting allows a better way to collaborate with your accountants, your customers and control your suppliers.
Activate features on demand, from integrated analytic accounting to budget, assets and multiple companies consolidation.
@@ -29,7 +29,7 @@ Activate features on demand, from integrated analytic accounting to budget, asse
Record transactions in a few clicks and easily manage all financial activities
-in one place. OpenERP's user interface is designed with productivity in mind.
+in one place. Odoo's user interface is designed with productivity in mind.
@@ -135,7 +135,7 @@ Integrate your analytic accounting operations with timesheets, projects, invoice
-Manage your assets, track expenses, control budgets, multi-level analytic accounting; OpenERP has all the features you need to sustain all your business activities.
+Manage your assets, track expenses, control budgets, multi-level analytic accounting; Odoo has all the features you need to sustain all your business activities.
@@ -148,7 +148,7 @@ Manage your assets, track expenses, control budgets, multi-level analytic accoun
Used by very small to very large organizations
-OpenERP supports multiple currencies, multiple users with different access rights, multiple companies with real time consolidation and unlimited analytic plans.
+Odoo supports multiple currencies, multiple users with different access rights, multiple companies with real time consolidation and unlimited analytic plans.
@@ -166,7 +166,7 @@ OpenERP supports multiple currencies, multiple users with different access right
- OpenERP Accounting is a great way to record all business transactions
+ Odoo Accounting is a great way to record all business transactions
right when they happen. Awesome and cost-effective!
@@ -178,7 +178,7 @@ OpenERP supports multiple currencies, multiple users with different access right
- We have found accounting module of OpenERP to be user
+ We have found accounting module of Odoo to be user
friendly and highly customizable. It proved to be an accounting gem.
diff --git a/addons/account/static/src/js/account_widgets.js b/addons/account/static/src/js/account_widgets.js
index 3b04058c33f..c9bdaac7071 100644
--- a/addons/account/static/src/js/account_widgets.js
+++ b/addons/account/static/src/js/account_widgets.js
@@ -139,7 +139,7 @@ openerp.account = function (instance) {
}
// Retreive statement infos and reconciliation data from the model
- var lines_filter = [['journal_entry_id', '=', false]];
+ var lines_filter = [['journal_entry_id', '=', false], ['account_id', '=', false]];
var deferred_promises = [];
if (self.statement_id) {
diff --git a/addons/account/test/account_fiscalyear_close.yml b/addons/account/test/account_fiscalyear_close.yml
index 75c94a6eae6..e9d232ece13 100644
--- a/addons/account/test/account_fiscalyear_close.yml
+++ b/addons/account/test/account_fiscalyear_close.yml
@@ -34,7 +34,7 @@
name: End of Year
code: NEW
type: situation
- analytic_journal_id: sit
+ analytic_journal_id: analytic.sit
default_debit_account_id: cash
default_credit_account_id: cash
company_id: base.main_company
diff --git a/addons/account/test/account_report.yml b/addons/account/test/account_report.yml
index 9173c37b61e..d13b38708e2 100644
--- a/addons/account/test/account_report.yml
+++ b/addons/account/test/account_report.yml
@@ -135,47 +135,47 @@
-
!python {model: account.analytic.account}: |
ctx={}
- ctx.update({'model': 'account.analytic.account','active_ids': [ref('account.analytic_root')]})
+ ctx.update({'model': 'account.analytic.account','active_ids': [ref('analytic.analytic_root')]})
data_dict = {}
from openerp.tools import test_reports
- test_reports.try_report_action(cr, uid, 'action_account_analytic_balance',wiz_data=data_dict, context=ctx, our_module='account')
+ test_reports.try_report_action(cr, uid, 'analytic.action_account_analytic_balance',wiz_data=data_dict, context=ctx, our_module='account')
-
Print the Cost Ledger Report through the wizard
-
!python {model: account.analytic.account}: |
ctx={}
- ctx.update({'model': 'account.analytic.account','active_ids': [ref('account.analytic_root'),ref('account.analytic_absences'),ref('account.analytic_internal'),ref('account.analytic_our_super_product')]})
+ ctx.update({'model': 'account.analytic.account','active_ids': [ref('analytic.analytic_root'),ref('analytic.analytic_absences'),ref('analytic.analytic_internal'),ref('analytic.analytic_our_super_product')]})
data_dict = {}
from openerp.tools import test_reports
- test_reports.try_report_action(cr, uid, 'action_account_analytic_cost',wiz_data=data_dict, context=ctx, our_module='account')
+ test_reports.try_report_action(cr, uid, 'analytic.action_account_analytic_cost',wiz_data=data_dict, context=ctx, our_module='account')
-
Print the Cost Ledger(Only Quantities) Report through the wizard
-
!python {model: account.analytic.account}: |
ctx={}
- ctx.update({'model': 'account.analytic.account','active_ids': [ref('account.analytic_root'),ref('account.analytic_absences'),ref('account.analytic_internal'),ref('account.analytic_our_super_product')]})
+ ctx.update({'model': 'account.analytic.account','active_ids': [ref('analytic.analytic_root'),ref('analytic.analytic_absences'),ref('analytic.analytic_internal'),ref('analytic.analytic_our_super_product')]})
data_dict = {}
from openerp.tools import test_reports
- test_reports.try_report_action(cr, uid, 'action_account_analytic_cost_ledger_journal',wiz_data=data_dict, context=ctx, our_module='account')
+ test_reports.try_report_action(cr, uid, 'analytic.action_account_analytic_cost_ledger_journal',wiz_data=data_dict, context=ctx, our_module='account')
-
Print the Analytic Journal Report through the wizard
-
!python {model: account.analytic.journal}: |
ctx={}
- ctx.update({'model': 'account.analytic.journal','active_ids': [ref('account.cose_journal_sale'), ref('account.exp'), ref('account.sit')]})
+ ctx.update({'model': 'account.analytic.journal','active_ids': [ref('analytic.cose_journal_sale'), ref('account.exp'), ref('analytic.sit')]})
data_dict = {}
from openerp.tools import test_reports
- test_reports.try_report_action(cr, uid, 'action_account_analytic_journal',wiz_data=data_dict, context=ctx, our_module='account')
+ test_reports.try_report_action(cr, uid, 'analytic.action_account_analytic_journal',wiz_data=data_dict, context=ctx, our_module='account')
-
Print the Inverted Analytic Balance Report through the wizard
-
!python {model: account.analytic.account}: |
ctx={}
- ctx.update({'model': 'account.analytic.account','active_ids': [ref('account.analytic_root')]})
+ ctx.update({'model': 'account.analytic.account','active_ids': [ref('analytic.analytic_root')]})
data_dict = {}
from openerp.tools import test_reports
- test_reports.try_report_action(cr, uid, 'action_account_analytic_invert_balance',wiz_data=data_dict, context=ctx, our_module='account')
+ test_reports.try_report_action(cr, uid, 'analytic.action_account_analytic_invert_balance',wiz_data=data_dict, context=ctx, our_module='account')
\ No newline at end of file
diff --git a/addons/account/wizard/account_automatic_reconcile_view.xml b/addons/account/wizard/account_automatic_reconcile_view.xml
index 62d985a29d5..22cd3a8b529 100644
--- a/addons/account/wizard/account_automatic_reconcile_view.xml
+++ b/addons/account/wizard/account_automatic_reconcile_view.xml
@@ -8,7 +8,7 @@
+
+
+ product.template.stock.move
+ product.template
+
+
+
+
+
+
+
+
+
+
+
+ Import Bank Statements
+ account.bank.statement.import
+ 1
+
+
+
+
+
+
+
+
+
+ How to import your bank statement in OpenERP.
+
+
+
+
+
+
+
+
+
+
+
+ Import Bank Statements
+ ir.actions.act_window
+ account.bank.statement.import
+ form
+ form
+ new
+
+
+
+
+
+
+
diff --git a/addons/account_bank_statement_import/demo/fiscalyear_period.xml b/addons/account_bank_statement_import/demo/fiscalyear_period.xml
new file mode 100644
index 00000000000..41b4be34f52
--- /dev/null
+++ b/addons/account_bank_statement_import/demo/fiscalyear_period.xml
@@ -0,0 +1,119 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/account_bank_statement_import/demo/partner_bank.xml b/addons/account_bank_statement_import/demo/partner_bank.xml
new file mode 100644
index 00000000000..47e8fa76f48
--- /dev/null
+++ b/addons/account_bank_statement_import/demo/partner_bank.xml
@@ -0,0 +1,38 @@
+
+
+
+
+
+ Agrolait
+ 00987654321
+
+ bank
+
+
+
+
+ China Export
+ 00987654322
+
+ bank
+
+
+
+
+ Delta PC
+ 10987654320
+
+ bank
+
+
+
+
+ Epic Technologies
+ 10987654322
+
+ bank
+
+
+
+
+
diff --git a/addons/account_bank_statement_import_ofx/__init__.py b/addons/account_bank_statement_import_ofx/__init__.py
new file mode 100644
index 00000000000..fe838c2d20d
--- /dev/null
+++ b/addons/account_bank_statement_import_ofx/__init__.py
@@ -0,0 +1,5 @@
+# -*- encoding: utf-8 -*-
+
+import account_bank_statement_import_ofx
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account_bank_statement_import_ofx/__openerp__.py b/addons/account_bank_statement_import_ofx/__openerp__.py
new file mode 100644
index 00000000000..baf0c66066f
--- /dev/null
+++ b/addons/account_bank_statement_import_ofx/__openerp__.py
@@ -0,0 +1,25 @@
+# -*- encoding: utf-8 -*-
+{
+ 'name': 'Import OFX Bank Statement',
+ 'version': '1.0',
+ 'author': 'OpenERP SA',
+ 'depends': ['account_bank_statement_import'],
+ 'demo': [],
+ 'description' : """
+Module to import OFX bank statements.
+======================================
+
+This module allows you to import the machine readable OFX Files in Odoo: they are parsed and stored in human readable format in
+Accounting \ Bank and Cash \ Bank Statements.
+
+Bank Statements may be generated containing a subset of the OFX information (only those transaction lines that are required for the
+creation of the Financial Accounting records).
+
+ """,
+ 'data' : [],
+ 'demo': [],
+ 'auto_install': False,
+ 'installable': True,
+}
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account_bank_statement_import_ofx/account_bank_statement_import_ofx.py b/addons/account_bank_statement_import_ofx/account_bank_statement_import_ofx.py
new file mode 100644
index 00000000000..13966c072e6
--- /dev/null
+++ b/addons/account_bank_statement_import_ofx/account_bank_statement_import_ofx.py
@@ -0,0 +1,74 @@
+# -*- coding: utf-8 -*-
+
+import logging
+import base64
+import os
+
+from openerp.osv import osv
+from openerp.tools.translate import _
+
+_logger = logging.getLogger(__name__)
+
+from openerp.addons.account_bank_statement_import import account_bank_statement_import as ibs
+ibs.add_file_type(('ofx', 'OFX'))
+
+try:
+ from ofxparse import OfxParser as ofxparser
+except ImportError:
+ _logger.warning("OFX parser unavailable because the `ofxparse` Python library cannot be found."
+ "It can be downloaded and installed from `https://pypi.python.org/pypi/ofxparse`.")
+ ofxparser = None
+
+class account_bank_statement_import(osv.TransientModel):
+ _inherit = 'account.bank.statement.import'
+
+ def process_ofx(self, cr, uid, data_file, journal_id=False, context=None):
+ """ Import a file in the .OFX format"""
+ if ofxparser is None:
+ raise osv.except_osv(_("Error"), _("OFX parser unavailable because the `ofxparse` Python library cannot be found."
+ "It can be downloaded and installed from `https://pypi.python.org/pypi/ofxparse`."))
+ try:
+ tempfile = open("temp.ofx", "w+")
+ tempfile.write(base64.decodestring(data_file))
+ tempfile.read()
+ pathname = os.path.dirname('temp.ofx')
+ path = os.path.join(os.path.abspath(pathname), 'temp.ofx')
+ ofx = ofxparser.parse(file(path))
+ except:
+ raise osv.except_osv(_('Import Error!'), _('Please check OFX file format is proper or not.'))
+ line_ids = []
+ total_amt = 0.00
+ try:
+ for transaction in ofx.account.statement.transactions:
+ bank_account_id, partner_id = self._detect_partner(cr, uid, transaction.payee, identifying_field='owner_name', context=context)
+ vals_line = {
+ 'date': transaction.date,
+ 'name': transaction.payee + ': ' + transaction.memo,
+ 'ref': transaction.id,
+ 'amount': transaction.amount,
+ 'partner_id': partner_id,
+ 'bank_account_id': bank_account_id,
+ }
+ total_amt += float(transaction.amount)
+ line_ids.append((0, 0, vals_line))
+ except Exception, e:
+ raise osv.except_osv(_('Error!'), _("Following problem has been occurred while importing your file, Please verify the file is proper or not.\n\n %s" % e.message))
+ st_start_date = ofx.account.statement.start_date or False
+ st_end_date = ofx.account.statement.end_date or False
+ period_obj = self.pool.get('account.period')
+ if st_end_date:
+ period_ids = period_obj.find(cr, uid, st_end_date, context=context)
+ else:
+ period_ids = period_obj.find(cr, uid, st_start_date, context=context)
+ vals_bank_statement = {
+ 'name': ofx.account.routing_number,
+ 'balance_start': ofx.account.statement.balance,
+ 'balance_end_real': float(ofx.account.statement.balance) + total_amt,
+ 'period_id': period_ids and period_ids[0] or False,
+ 'journal_id': journal_id
+ }
+ vals_bank_statement.update({'line_ids': line_ids})
+ os.remove(path)
+ return [vals_bank_statement]
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account_bank_statement_import_ofx/test_ofx_file/test_ofx.ofx b/addons/account_bank_statement_import_ofx/test_ofx_file/test_ofx.ofx
new file mode 100644
index 00000000000..37df4d0c996
--- /dev/null
+++ b/addons/account_bank_statement_import_ofx/test_ofx_file/test_ofx.ofx
@@ -0,0 +1,100 @@
+
+
+
+
+
+
+ 0
+ INFO
+
+ 20130831165153.000[-8:PST]
+ ENG
+
+
+
+
+ 0
+
+ 0
+ INFO
+
+
+ USD
+
+ 000000123
+ 123456
+ CHECKING
+
+
+ 20130801
+ 20130831165153.000[-8:PST]
+
+ POS
+ 20130824080000
+ -80
+ 219378
+ Agrolait
+
+
+
+ 20130801
+ 20130831165153.000[-8:PST]
+
+ POS
+ 20130824080000
+ -90
+ 219379
+ China Export
+
+
+
+ 20130801
+ 20130831165153.000[-8:PST]
+
+ POS
+ 20130824080000
+ -100
+ 219380
+ Axelor Scuba
+
+
+
+ 20130801
+ 20130831165153.000[-8:PST]
+
+ POS
+ 20130824080000
+ -90
+ 219381
+ China Scuba
+
+
+
+ 2156.56
+ 20130831165153
+
+
+
+
+
+
+ 0
+
+ 0
+ INFO
+
+
+ USD
+
+ 123412341234
+
+
+
+
+ -562.00
+ 20130831165153
+
+
+
+
+
diff --git a/addons/account_bank_statement_import_ofx/tests/__init__.py b/addons/account_bank_statement_import_ofx/tests/__init__.py
new file mode 100644
index 00000000000..8a5a8e9b1f7
--- /dev/null
+++ b/addons/account_bank_statement_import_ofx/tests/__init__.py
@@ -0,0 +1,5 @@
+from . import test_import_bank_statement
+
+checks = [
+ test_import_bank_statement
+]
diff --git a/addons/account_bank_statement_import_ofx/tests/test_import_bank_statement.py b/addons/account_bank_statement_import_ofx/tests/test_import_bank_statement.py
new file mode 100644
index 00000000000..967d647f124
--- /dev/null
+++ b/addons/account_bank_statement_import_ofx/tests/test_import_bank_statement.py
@@ -0,0 +1,30 @@
+from openerp.tests.common import TransactionCase
+from openerp.modules.module import get_module_resource
+
+class TestOfxFile(TransactionCase):
+ """Tests for import bank statement ofx file format (account.bank.statement.import)
+ """
+
+ def setUp(self):
+ super(TestOfxFile, self).setUp()
+ self.statement_import_model = self.registry('account.bank.statement.import')
+ self.bank_statement_model = self.registry('account.bank.statement')
+
+ def test_ofx_file_import(self):
+ try:
+ from ofxparse import OfxParser as ofxparser
+ except ImportError:
+ #the Python library isn't installed on the server, the OFX import is unavailable and the test cannot be run
+ return True
+ cr, uid = self.cr, self.uid
+ ofx_file_path = get_module_resource('account_bank_statement_import_ofx', 'test_ofx_file', 'test_ofx.ofx')
+ ofx_file = open(ofx_file_path, 'rb').read().encode('base64')
+ bank_statement_id = self.statement_import_model.create(cr, uid, dict(
+ file_type='ofx',
+ data_file=ofx_file,
+ ))
+ self.statement_import_model.parse_file(cr, uid, [bank_statement_id])
+ statement_id = self.bank_statement_model.search(cr, uid, [('name', '=', '000000123')])[0]
+ bank_st_record = self.bank_statement_model.browse(cr, uid, statement_id)
+ self.assertEquals(bank_st_record.balance_start, 2156.56)
+ self.assertEquals(bank_st_record.balance_end_real, 1796.56)
diff --git a/addons/account_bank_statement_import_qif/__init__.py b/addons/account_bank_statement_import_qif/__init__.py
new file mode 100644
index 00000000000..befbd0e3d47
--- /dev/null
+++ b/addons/account_bank_statement_import_qif/__init__.py
@@ -0,0 +1,5 @@
+# -*- coding: utf-8 -*-
+
+import account_bank_statement_import_qif
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account_bank_statement_import_qif/__openerp__.py b/addons/account_bank_statement_import_qif/__openerp__.py
new file mode 100644
index 00000000000..dad736a059f
--- /dev/null
+++ b/addons/account_bank_statement_import_qif/__openerp__.py
@@ -0,0 +1,25 @@
+# -*- coding: utf-8 -*-
+
+{
+ 'name': 'Import QIF Bank Statement',
+ 'version': '1.0',
+ 'author': 'OpenERP SA',
+ 'description': '''
+Module to import QIF bank statements.
+======================================
+
+This module allows you to import the machine readable QIF Files in Odoo: they are parsed and stored in human readable format in
+Accounting \ Bank and Cash \ Bank Statements.
+
+Bank Statements may be generated containing a subset of the QIF information (only those transaction lines that are required for the
+creation of the Financial Accounting records).
+''',
+ 'images' : [],
+ 'depends': ['account_bank_statement_import'],
+ 'demo': [],
+ 'data': [],
+ 'auto_install': False,
+ 'installable': True,
+}
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account_bank_statement_import_qif/account_bank_statement_import_qif.py b/addons/account_bank_statement_import_qif/account_bank_statement_import_qif.py
new file mode 100644
index 00000000000..a253cb62dd0
--- /dev/null
+++ b/addons/account_bank_statement_import_qif/account_bank_statement_import_qif.py
@@ -0,0 +1,75 @@
+# -*- coding: utf-8 -*-
+
+import dateutil.parser
+import base64
+from tempfile import TemporaryFile
+
+from openerp.tools.translate import _
+from openerp.osv import osv
+
+from openerp.addons.account_bank_statement_import import account_bank_statement_import as ibs
+
+ibs.add_file_type(('qif', 'QIF'))
+
+class account_bank_statement_import(osv.TransientModel):
+ _inherit = "account.bank.statement.import"
+
+ def process_qif(self, cr, uid, data_file, journal_id=False, context=None):
+ """ Import a file in the .QIF format"""
+ try:
+ fileobj = TemporaryFile('wb+')
+ fileobj.write(base64.b64decode(data_file))
+ fileobj.seek(0)
+ file_data = ""
+ for line in fileobj.readlines():
+ file_data += line
+ fileobj.close()
+ if '\r' in file_data:
+ data_list = file_data.split('\r')
+ else:
+ data_list = file_data.split('\n')
+ header = data_list[0].strip()
+ header = header.split(":")[1]
+ except:
+ raise osv.except_osv(_('Import Error!'), _('Please check QIF file format is proper or not.'))
+ line_ids = []
+ vals_line = {}
+ total = 0
+ if header == "Bank":
+ vals_bank_statement = {}
+ for line in data_list:
+ line = line.strip()
+ if not line:
+ continue
+ if line[0] == 'D': # date of transaction
+ vals_line['date'] = dateutil.parser.parse(line[1:], fuzzy=True).date()
+ if vals_line.get('date') and not vals_bank_statement.get('period_id'):
+ period_ids = self.pool.get('account.period').find(cr, uid, vals_line['date'], context=context)
+ vals_bank_statement.update({'period_id': period_ids and period_ids[0] or False})
+ elif line[0] == 'T': # Total amount
+ total += float(line[1:].replace(',', ''))
+ vals_line['amount'] = float(line[1:].replace(',', ''))
+ elif line[0] == 'N': # Check number
+ vals_line['ref'] = line[1:]
+ elif line[0] == 'P': # Payee
+ bank_account_id, partner_id = self._detect_partner(cr, uid, line[1:], identifying_field='owner_name', context=context)
+ vals_line['partner_id'] = partner_id
+ vals_line['bank_account_id'] = bank_account_id
+ vals_line['name'] = 'name' in vals_line and line[1:] + ': ' + vals_line['name'] or line[1:]
+ elif line[0] == 'M': # Memo
+ vals_line['name'] = 'name' in vals_line and vals_line['name'] + ': ' + line[1:] or line[1:]
+ elif line[0] == '^': # end of item
+ line_ids.append((0, 0, vals_line))
+ vals_line = {}
+ elif line[0] == '\n':
+ line_ids = []
+ else:
+ pass
+ else:
+ raise osv.except_osv(_('Error!'), _('Cannot support this Format !Type:%s.') % (header,))
+ vals_bank_statement.update({'balance_end_real': total,
+ 'line_ids': line_ids,
+ 'journal_id': journal_id})
+ return [vals_bank_statement]
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account_bank_statement_import_qif/test_qif_file/test_qif.qif b/addons/account_bank_statement_import_qif/test_qif_file/test_qif.qif
new file mode 100644
index 00000000000..5388e6dae1a
--- /dev/null
+++ b/addons/account_bank_statement_import_qif/test_qif_file/test_qif.qif
@@ -0,0 +1,21 @@
+!Type:Bank
+D8/12/13
+T-1,000.00
+PDelta PC
+^
+D8/15/13
+T-75.46
+PWalts Drugs
+^
+D3/3/13
+T-379.00
+PEpic Technologies
+^
+D3/4/13
+T-20.28
+PYOUR LOCAL SUPERMARKET
+^
+D3/3/13
+T-421.35
+PSPRINGFIELD WATER UTILITY
+^
diff --git a/addons/account_bank_statement_import_qif/tests/__init__.py b/addons/account_bank_statement_import_qif/tests/__init__.py
new file mode 100644
index 00000000000..05b23c400e4
--- /dev/null
+++ b/addons/account_bank_statement_import_qif/tests/__init__.py
@@ -0,0 +1,5 @@
+from . import test_import_bank_statement
+checks = [
+ test_import_bank_statement
+]
+
diff --git a/addons/account_bank_statement_import_qif/tests/test_import_bank_statement.py b/addons/account_bank_statement_import_qif/tests/test_import_bank_statement.py
new file mode 100644
index 00000000000..0f9ef4d99bb
--- /dev/null
+++ b/addons/account_bank_statement_import_qif/tests/test_import_bank_statement.py
@@ -0,0 +1,27 @@
+from openerp.tests.common import TransactionCase
+from openerp.modules.module import get_module_resource
+
+class TestQifFile(TransactionCase):
+ """Tests for import bank statement qif file format (account.bank.statement.import)
+ """
+
+ def setUp(self):
+ super(TestQifFile, self).setUp()
+ self.statement_import_model = self.registry('account.bank.statement.import')
+ self.bank_statement_model = self.registry('account.bank.statement')
+ self.bank_statement_line_model = self.registry('account.bank.statement.line')
+
+ def test_qif_file_import(self):
+ from openerp.tools import float_compare
+ cr, uid = self.cr, self.uid
+ qif_file_path = get_module_resource('account_bank_statement_import_qif', 'test_qif_file', 'test_qif.qif')
+ qif_file = open(qif_file_path, 'rb').read().encode('base64')
+ bank_statement_id = self.statement_import_model.create(cr, uid, dict(
+ file_type='qif',
+ data_file=qif_file,
+ ))
+ self.statement_import_model.parse_file(cr, uid, [bank_statement_id])
+ line_id = self.bank_statement_line_model.search(cr, uid, [('name', '=', 'YOUR LOCAL SUPERMARKET')])[0]
+ statement_id = self.bank_statement_line_model.browse(cr, uid, line_id).statement_id.id
+ bank_st_record = self.bank_statement_model.browse(cr, uid, statement_id)
+ assert float_compare(bank_st_record.balance_end_real, -1896.09, 2) == 0
diff --git a/addons/account_budget/account_budget_demo.xml b/addons/account_budget/account_budget_demo.xml
index d93e78e3448..f5de2cfcdc5 100644
--- a/addons/account_budget/account_budget_demo.xml
+++ b/addons/account_budget/account_budget_demo.xml
@@ -42,7 +42,7 @@
-
+
@@ -50,7 +50,7 @@
-
+
@@ -58,7 +58,7 @@
-
+
@@ -66,7 +66,7 @@
-
+
@@ -74,7 +74,7 @@
-
+
@@ -84,7 +84,7 @@
-
+
@@ -93,7 +93,7 @@
-
+
@@ -101,7 +101,7 @@
-
+
@@ -112,7 +112,7 @@
-
+
@@ -120,7 +120,7 @@
-
+
@@ -128,7 +128,7 @@
-
+
@@ -136,7 +136,7 @@
-
+
@@ -144,7 +144,7 @@
-
+
@@ -154,7 +154,7 @@
-
+
@@ -162,7 +162,7 @@
-
+
@@ -170,7 +170,7 @@
-
+
@@ -178,7 +178,7 @@
-
+
diff --git a/addons/account_budget/test/account_budget.yml b/addons/account_budget/test/account_budget.yml
index f656d214405..cab07c3600e 100644
--- a/addons/account_budget/test/account_budget.yml
+++ b/addons/account_budget/test/account_budget.yml
@@ -16,12 +16,12 @@
-
!record {model: crossovered.budget, id: crossovered_budget_budget0}:
crossovered_budget_line:
- - analytic_account_id: account.analytic_consultancy
+ - analytic_account_id: analytic.analytic_consultancy
date_from: !eval "'%s-01-01' %(datetime.now().year+1)"
date_to: !eval "'%s-12-31' %(datetime.now().year+1)"
general_budget_id: account_budget.account_budget_post_purchase0
planned_amount: 10000.0
- - analytic_account_id: account.analytic_super_product_trainings
+ - analytic_account_id: analytic.analytic_super_product_trainings
date_from: !eval "'%s-09-01' %(datetime.now().year+1)"
date_to: !eval "'%s-09-30' %(datetime.now().year+1)"
general_budget_id: account_budget.account_budget_post_sales0
diff --git a/addons/account_budget/test/account_budget_report.yml b/addons/account_budget/test/account_budget_report.yml
index a36c2d87d04..4b2d9d2bbcf 100644
--- a/addons/account_budget/test/account_budget_report.yml
+++ b/addons/account_budget/test/account_budget_report.yml
@@ -2,7 +2,7 @@
Print the Analytic Budget Report through wizard
-
!python {model: account.analytic.account}: |
- ctx = {'model': 'account.analytic.account','active_ids': [ref('account.analytic_root')]}
+ ctx = {'model': 'account.analytic.account','active_ids': [ref('analytic.analytic_root')]}
from openerp.tools import test_reports
test_reports.try_report_action(cr, uid, 'action_account_budget_analytic',wiz_data={}, context=ctx, our_module='account_budget')
diff --git a/addons/account_check_writing/account_voucher_view.xml b/addons/account_check_writing/account_voucher_view.xml
index de7ecd327a9..2201a7cd7e0 100644
--- a/addons/account_check_writing/account_voucher_view.xml
+++ b/addons/account_check_writing/account_voucher_view.xml
@@ -39,7 +39,7 @@
The check payment form allows you to track the payment you do
to your suppliers using checks. When you select a supplier, the
- payment method and an amount for the payment, OpenERP will
+ payment method and an amount for the payment, Odoo will
propose to reconcile your payment with the open supplier
invoices or bills.
diff --git a/addons/account_sequence/account_sequence_installer.py b/addons/account_sequence/account_sequence_installer.py
index bcf1e14c20f..af3f5a971bf 100644
--- a/addons/account_sequence/account_sequence_installer.py
+++ b/addons/account_sequence/account_sequence_installer.py
@@ -31,7 +31,7 @@ class account_sequence_installer(osv.osv_memory):
'suffix': fields.char('Suffix', size=64, help="Suffix value of the record for the sequence"),
'number_next': fields.integer('Next Number', required=True, help="Next number of this sequence"),
'number_increment': fields.integer('Increment Number', required=True, help="The next number of the sequence will be incremented by this number"),
- 'padding' : fields.integer('Number padding', required=True, help="OpenERP will automatically adds some '0' on the left of the 'Next Number' to get the required padding size."),
+ 'padding' : fields.integer('Number padding', required=True, help="Odoo will automatically adds some '0' on the left of the 'Next Number' to get the required padding size."),
'company_id': fields.many2one('res.company', 'Company'),
}
_defaults = {
diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py
index 275e002695e..6341c8b1e10 100644
--- a/addons/account_voucher/account_voucher.py
+++ b/addons/account_voucher/account_voucher.py
@@ -946,6 +946,8 @@ class account_voucher(osv.osv):
# refresh to make sure you don't unlink an already removed move
voucher.refresh()
for line in voucher.move_ids:
+ # refresh to make sure you don't unreconcile an already unreconciled entry
+ line.refresh()
if line.reconcile_id:
move_lines = [move_line.id for move_line in line.reconcile_id.line_id]
move_lines.remove(line.id)
diff --git a/addons/account_voucher/account_voucher_data.xml b/addons/account_voucher/account_voucher_data.xml
index 6329176c6e9..6d141869184 100644
--- a/addons/account_voucher/account_voucher_data.xml
+++ b/addons/account_voucher/account_voucher_data.xml
@@ -9,7 +9,7 @@
notificationeInvoicing & Payments application installed!
- OpenERP's electronic invoicing accelerates the creation of invoices and collection of customer payments. Invoices are created in a few clicks and your customers receive them by email. They can pay online and/or import them in their own system.
+ Odoo's electronic invoicing accelerates the creation of invoices and collection of customer payments. Invoices are created in a few clicks and your customers receive them by email. They can pay online and/or import them in their own system.
You can track customer payments easily and automate follow-ups. You get an overview of the discussion with your customers on each invoice for easier traceability. For advanced accounting features, you should install the "Accounting and Finance" module.
]]>
diff --git a/addons/account_voucher/report/account_voucher_sales_receipt.py b/addons/account_voucher/report/account_voucher_sales_receipt.py
index 246cd8b47e8..b615143567d 100644
--- a/addons/account_voucher/report/account_voucher_sales_receipt.py
+++ b/addons/account_voucher/report/account_voucher_sales_receipt.py
@@ -28,11 +28,6 @@ class sale_receipt_report(osv.osv):
_rec_name = 'date'
_columns = {
'date': fields.date('Date', readonly=True),
- 'year': fields.char('Year', size=4, readonly=True),
- 'day': fields.char('Day', size=128, readonly=True),
- 'month': fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'),
- ('05','May'), ('06','June'), ('07','July'), ('08','August'), ('09','September'),
- ('10','October'), ('11','November'), ('12','December')], 'Month', readonly=True),
'currency_id': fields.many2one('res.currency', 'Currency', readonly=True),
'journal_id': fields.many2one('account.journal', 'Journal', readonly=True),
'partner_id': fields.many2one('res.partner', 'Partner', readonly=True),
@@ -69,9 +64,6 @@ class sale_receipt_report(osv.osv):
create or replace view sale_receipt_report as (
select min(avl.id) as id,
av.date as date,
- to_char(av.date, 'YYYY') as year,
- to_char(av.date, 'MM') as month,
- to_char(av.date, 'YYYY-MM-DD') as day,
av.partner_id as partner_id,
aj.currency as currency_id,
av.journal_id as journal_id,
@@ -107,9 +99,6 @@ class sale_receipt_report(osv.osv):
group by
av.date,
av.id,
- to_char(av.date, 'YYYY'),
- to_char(av.date, 'MM'),
- to_char(av.date, 'YYYY-MM-DD'),
av.partner_id,
aj.currency,
av.journal_id,
diff --git a/addons/account_voucher/report/account_voucher_sales_receipt_view.xml b/addons/account_voucher/report/account_voucher_sales_receipt_view.xml
index a6e153573e7..78af9d28fc5 100644
--- a/addons/account_voucher/report/account_voucher_sales_receipt_view.xml
+++ b/addons/account_voucher/report/account_voucher_sales_receipt_view.xml
@@ -1,34 +1,7 @@
-
-
+
sale.receipt.report.graphsale.receipt.report
@@ -65,9 +38,7 @@
-
-
-
+
diff --git a/addons/account_voucher/static/description/index.html b/addons/account_voucher/static/description/index.html
index a363291f12e..4f149075ed8 100644
--- a/addons/account_voucher/static/description/index.html
+++ b/addons/account_voucher/static/description/index.html
@@ -112,7 +112,7 @@ material. Define recurrencies to produce recurring invoice automatically.
- OpenERP allowed us to automate sending 10.000 invoices per month.
+ Odoo allowed us to automate sending 10.000 invoices per month.
@@ -124,7 +124,7 @@ material. Define recurrencies to produce recurring invoice automatically.
- We have found invoicing module of OpenERP to be user
+ We have found invoicing module of Odoo to be user
friendly and highly customizable.
diff --git a/addons/account_voucher/test/case1_usd_usd.yml b/addons/account_voucher/test/case1_usd_usd.yml
index 4c19c33eb5f..bda36a5f267 100644
--- a/addons/account_voucher/test/case1_usd_usd.yml
+++ b/addons/account_voucher/test/case1_usd_usd.yml
@@ -60,7 +60,7 @@
name: Bank Journal(USD)
code: BUSD
type: bank
- analytic_journal_id: account.sit
+ analytic_journal_id: analytic.sit
sequence_id: account.sequence_bank_journal
default_debit_account_id: account_cash_usd_id
default_credit_account_id: account_cash_usd_id
diff --git a/addons/account_voucher/test/case1_usd_usd_payment_rate.yml b/addons/account_voucher/test/case1_usd_usd_payment_rate.yml
index 7f5cf15284d..9b2244ff76a 100644
--- a/addons/account_voucher/test/case1_usd_usd_payment_rate.yml
+++ b/addons/account_voucher/test/case1_usd_usd_payment_rate.yml
@@ -60,7 +60,7 @@
name: Bank Journal(USD)
code: BUSD
type: bank
- analytic_journal_id: account.sit
+ analytic_journal_id: analytic.sit
sequence_id: account.sequence_bank_journal
default_debit_account_id: account_cash_usd_id
default_credit_account_id: account_cash_usd_id
diff --git a/addons/account_voucher/test/case2_usd_eur_debtor_in_eur.yml b/addons/account_voucher/test/case2_usd_eur_debtor_in_eur.yml
index 0eb71d66d4d..e679a4c631c 100644
--- a/addons/account_voucher/test/case2_usd_eur_debtor_in_eur.yml
+++ b/addons/account_voucher/test/case2_usd_eur_debtor_in_eur.yml
@@ -54,7 +54,7 @@
name: Bank Journal(EUR)
code: BEUR
type: bank
- analytic_journal_id: account.sit
+ analytic_journal_id: analytic.sit
sequence_id: account.sequence_bank_journal
default_debit_account_id: account.cash
default_credit_account_id: account.cash
@@ -66,7 +66,7 @@
name: Bank Journal(USD)
code: BUSD
type: bank
- analytic_journal_id: account.sit
+ analytic_journal_id: analytic.sit
sequence_id: account.sequence_bank_journal
default_debit_account_id: account_cash_usd_id
default_credit_account_id: account_cash_usd_id
diff --git a/addons/account_voucher/test/case2_usd_eur_debtor_in_usd.yml b/addons/account_voucher/test/case2_usd_eur_debtor_in_usd.yml
index 12d6f07b33a..f52fcbbaa0c 100644
--- a/addons/account_voucher/test/case2_usd_eur_debtor_in_usd.yml
+++ b/addons/account_voucher/test/case2_usd_eur_debtor_in_usd.yml
@@ -54,7 +54,7 @@
name: Bank Journal(EUR)
code: BEUR
type: bank
- analytic_journal_id: account.sit
+ analytic_journal_id: analytic.sit
sequence_id: account.sequence_bank_journal
default_debit_account_id: account.cash
default_credit_account_id: account.cash
@@ -66,7 +66,7 @@
name: Bank Journal(USD)
code: BUSD
type: bank
- analytic_journal_id: account.sit
+ analytic_journal_id: analytic.sit
sequence_id: account.sequence_bank_journal
default_debit_account_id: account_cash_usd_id
default_credit_account_id: account_cash_usd_id
diff --git a/addons/account_voucher/test/case3_eur_eur.yml b/addons/account_voucher/test/case3_eur_eur.yml
index 6c48c2e2136..b2732bbce72 100644
--- a/addons/account_voucher/test/case3_eur_eur.yml
+++ b/addons/account_voucher/test/case3_eur_eur.yml
@@ -22,7 +22,7 @@
name: Bank Journal(EUR)
code: BEUR
type: bank
- analytic_journal_id: account.sit
+ analytic_journal_id: analytic.sit
sequence_id: account.sequence_bank_journal
default_debit_account_id: account.cash
default_credit_account_id: account.cash
diff --git a/addons/account_voucher/test/case4_cad_chf.yml b/addons/account_voucher/test/case4_cad_chf.yml
index e31dd5783c0..d06b851fd19 100644
--- a/addons/account_voucher/test/case4_cad_chf.yml
+++ b/addons/account_voucher/test/case4_cad_chf.yml
@@ -55,7 +55,7 @@
name: Bank Journal(CHF)
code: BCHF
type: bank
- analytic_journal_id: account.sit
+ analytic_journal_id: analytic.sit
sequence_id: account.sequence_bank_journal
default_debit_account_id: account_cash_chf_id
default_credit_account_id: account_cash_chf_id
diff --git a/addons/account_voucher/test/case5_suppl_usd_usd.yml b/addons/account_voucher/test/case5_suppl_usd_usd.yml
index 327cd9de25c..c46e3be46ec 100644
--- a/addons/account_voucher/test/case5_suppl_usd_usd.yml
+++ b/addons/account_voucher/test/case5_suppl_usd_usd.yml
@@ -41,7 +41,7 @@
name: Bank Journal(EUR)
code: BEUR
type: bank
- analytic_journal_id: account.sit
+ analytic_journal_id: analytic.sit
sequence_id: account.sequence_bank_journal
default_debit_account_id: account.cash
default_credit_account_id: account.cash
@@ -53,7 +53,7 @@
name: Bank Journal(USD)
code: BUSD
type: bank
- analytic_journal_id: account.sit
+ analytic_journal_id: analytic.sit
sequence_id: account.sequence_bank_journal
default_debit_account_id: account_cash_usd_id2
default_credit_account_id: account_cash_usd_id2
diff --git a/addons/account_voucher/test/case_eur_usd.yml b/addons/account_voucher/test/case_eur_usd.yml
index ce2b71d7ac0..4f0c711fed1 100644
--- a/addons/account_voucher/test/case_eur_usd.yml
+++ b/addons/account_voucher/test/case_eur_usd.yml
@@ -39,7 +39,7 @@
name: Bank Journal Test(USD)
code: BEUSD
type: bank
- analytic_journal_id: account.sit
+ analytic_journal_id: analytic.sit
sequence_id: account.sequence_bank_journal
default_debit_account_id: account_eur_usd_id
default_credit_account_id: account_eur_usd_id
diff --git a/addons/account_voucher/voucher_payment_receipt_view.xml b/addons/account_voucher/voucher_payment_receipt_view.xml
index aa427bbf91e..dd316ea2600 100644
--- a/addons/account_voucher/voucher_payment_receipt_view.xml
+++ b/addons/account_voucher/voucher_payment_receipt_view.xml
@@ -270,7 +270,7 @@
Click to create a new supplier payment.
- OpenERP helps you easily track payments you make and the remaining balances you need to pay your suppliers.
+ Odoo helps you easily track payments you make and the remaining balances you need to pay your suppliers.
@@ -554,7 +554,7 @@
Click to register a new payment.
Enter the customer and the payment method and then, either
- create manually a payment record or OpenERP will propose to you
+ create manually a payment record or Odoo will propose to you
automatically the reconciliation of this payment with the open
invoices or sales receipts.
- Once the end date of the contract is
- passed or the maximum number of service
- units (e.g. support contract) is
- reached, the account manager is notified
- by email to renew the contract with the
- customer.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/addons/account/project/analytic_account_demo.xml b/addons/analytic/data/analytic_account_demo.xml
similarity index 100%
rename from addons/account/project/analytic_account_demo.xml
rename to addons/analytic/data/analytic_account_demo.xml
diff --git a/addons/analytic/analytic_data.xml b/addons/analytic/data/analytic_data.xml
similarity index 100%
rename from addons/analytic/analytic_data.xml
rename to addons/analytic/data/analytic_data.xml
diff --git a/addons/account/project/project_demo.xml b/addons/analytic/data/analytic_demo.xml
similarity index 100%
rename from addons/account/project/project_demo.xml
rename to addons/analytic/data/analytic_demo.xml
diff --git a/addons/analytic/analytic_sequence.xml b/addons/analytic/data/analytic_sequence.xml
similarity index 100%
rename from addons/analytic/analytic_sequence.xml
rename to addons/analytic/data/analytic_sequence.xml
diff --git a/addons/analytic/models/__init__.py b/addons/analytic/models/__init__.py
new file mode 100644
index 00000000000..dca9f87f0ec
--- /dev/null
+++ b/addons/analytic/models/__init__.py
@@ -0,0 +1,3 @@
+# -*- coding: utf-8 -*-
+
+import analytic
diff --git a/addons/analytic/analytic.py b/addons/analytic/models/analytic.py
similarity index 93%
rename from addons/analytic/analytic.py
rename to addons/analytic/models/analytic.py
index e31efa0eb2a..340a37f2d78 100644
--- a/addons/analytic/analytic.py
+++ b/addons/analytic/models/analytic.py
@@ -326,6 +326,7 @@ class account_analytic_line(osv.osv):
'account_id': fields.many2one('account.analytic.account', 'Analytic Account', required=True, ondelete='restrict', select=True, domain=[('type','<>','view')]),
'user_id': fields.many2one('res.users', 'User'),
'company_id': fields.related('account_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, readonly=True),
+ 'journal_id': fields.many2one('account.analytic.journal', 'Analytic Journal', required=True, ondelete='restrict', select=True),
}
@@ -354,4 +355,23 @@ class account_analytic_line(osv.osv):
(_check_no_view, 'You cannot create analytic line on view account.', ['account_id']),
]
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
+class account_analytic_journal(osv.osv):
+ _name = 'account.analytic.journal'
+ _description = 'Analytic Journal'
+ _columns = {
+ 'name': fields.char('Journal Name', required=True),
+ 'code': fields.char('Journal Code', size=8),
+ 'active': fields.boolean('Active', help="If the active field is set to False, it will allow you to hide the analytic journal without removing it."),
+ 'type': fields.selection(
+ [('sale', 'Sale'), ('purchase', 'Purchase'), ('cash', 'Cash'),
+ ('general', 'General'), ('situation', 'Situation')],
+ 'Type', required=True, help="Gives the type of the analytic journal. When it needs for a document (eg: an invoice) to create analytic entries, Odoo will look for a matching journal of the same type."),
+ 'line_ids': fields.one2many('account.analytic.line', 'journal_id', 'Lines'),
+ 'company_id': fields.many2one('res.company', 'Company', required=True),
+ }
+ _defaults = {
+ 'active': True,
+ 'type': 'general',
+ 'company_id': lambda self, cr, uid, c=None: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id,
+ }
diff --git a/addons/account/project/report/__init__.py b/addons/analytic/report/__init__.py
similarity index 91%
rename from addons/account/project/report/__init__.py
rename to addons/analytic/report/__init__.py
index 32226f801e9..ff72ccd21f1 100644
--- a/addons/account/project/report/__init__.py
+++ b/addons/analytic/report/__init__.py
@@ -21,9 +21,9 @@
import analytic_journal
import analytic_balance
-import inverted_analytic_balance
-import cost_ledger
-import quantity_cost_ledger
+import analytic_inverted_balance
+import analytic_cost_ledger
+import analytic_quantity_cost_ledger
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/project/report/analytic_balance.py b/addons/analytic/report/analytic_balance.py
similarity index 99%
rename from addons/account/project/report/analytic_balance.py
rename to addons/analytic/report/analytic_balance.py
index 7c333b84c45..b8908898b77 100644
--- a/addons/account/project/report/analytic_balance.py
+++ b/addons/analytic/report/analytic_balance.py
@@ -151,7 +151,7 @@ class account_analytic_balance(report_sxw.rml_parse):
class report_analyticbalance(osv.AbstractModel):
_name = 'report.account.report_analyticbalance'
_inherit = 'report.abstract_report'
- _template = 'account.report_analyticbalance'
+ _template = 'analytic.report_analyticbalance'
_wrapped_report_class = account_analytic_balance
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/project/report/cost_ledger.py b/addons/analytic/report/analytic_cost_ledger.py
similarity index 99%
rename from addons/account/project/report/cost_ledger.py
rename to addons/analytic/report/analytic_cost_ledger.py
index 5eef375eaab..77c6cad04a4 100644
--- a/addons/account/project/report/cost_ledger.py
+++ b/addons/analytic/report/analytic_cost_ledger.py
@@ -105,7 +105,7 @@ class account_analytic_cost_ledger(report_sxw.rml_parse):
class report_analyticcostledger(osv.AbstractModel):
_name = 'report.account.report_analyticcostledger'
_inherit = 'report.abstract_report'
- _template = 'account.report_analyticcostledger'
+ _template = 'analytic.report_analyticcostledger'
_wrapped_report_class = account_analytic_cost_ledger
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/project/report/inverted_analytic_balance.py b/addons/analytic/report/analytic_inverted_balance.py
similarity index 98%
rename from addons/account/project/report/inverted_analytic_balance.py
rename to addons/analytic/report/analytic_inverted_balance.py
index 23129144555..8a47322546c 100644
--- a/addons/account/project/report/inverted_analytic_balance.py
+++ b/addons/analytic/report/analytic_inverted_balance.py
@@ -124,7 +124,7 @@ class account_inverted_analytic_balance(report_sxw.rml_parse):
class report_invertedanalyticbalance(osv.AbstractModel):
_name = 'report.account.report_invertedanalyticbalance'
_inherit = 'report.abstract_report'
- _template = 'account.report_invertedanalyticbalance'
+ _template = 'analytic.report_invertedanalyticbalance'
_wrapped_report_class = account_inverted_analytic_balance
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/project/report/analytic_journal.py b/addons/analytic/report/analytic_journal.py
similarity index 98%
rename from addons/account/project/report/analytic_journal.py
rename to addons/analytic/report/analytic_journal.py
index c59efb057d7..38231b69f5f 100644
--- a/addons/account/project/report/analytic_journal.py
+++ b/addons/analytic/report/analytic_journal.py
@@ -62,7 +62,7 @@ class account_analytic_journal(report_sxw.rml_parse):
class report_analyticjournal(osv.AbstractModel):
_name = 'report.account.report_analyticjournal'
_inherit = 'report.abstract_report'
- _template = 'account.report_analyticjournal'
+ _template = 'analytic.report_analyticjournal'
_wrapped_report_class = account_analytic_journal
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/project/report/quantity_cost_ledger.py b/addons/analytic/report/analytic_quantity_cost_ledger.py
similarity index 99%
rename from addons/account/project/report/quantity_cost_ledger.py
rename to addons/analytic/report/analytic_quantity_cost_ledger.py
index d3ed1cdc3a8..c4bf9ade72f 100644
--- a/addons/account/project/report/quantity_cost_ledger.py
+++ b/addons/analytic/report/analytic_quantity_cost_ledger.py
@@ -121,7 +121,7 @@ class account_analytic_quantity_cost_ledger(report_sxw.rml_parse):
class report_analyticcostledgerquantity(osv.AbstractModel):
_name = 'report.account.report_analyticcostledgerquantity'
_inherit = 'report.abstract_report'
- _template = 'account.report_analyticcostledgerquantity'
+ _template = 'analytic.report_analyticcostledgerquantity'
_wrapped_report_class = account_analytic_quantity_cost_ledger
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/analytic/security/analytic_security.xml b/addons/analytic/security/analytic_security.xml
index bf103ca8988..43bf89de406 100644
--- a/addons/analytic/security/analytic_security.xml
+++ b/addons/analytic/security/analytic_security.xml
@@ -15,6 +15,13 @@
['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]
+
+
+ Analytic journal multi-company
+
+
+ ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]
+
diff --git a/addons/account/project/project_view.xml b/addons/analytic/views/analytic_view.xml
similarity index 74%
rename from addons/account/project/project_view.xml
rename to addons/analytic/views/analytic_view.xml
index 068f3721371..0df238fbd0a 100644
--- a/addons/account/project/project_view.xml
+++ b/addons/analytic/views/analytic_view.xml
@@ -2,6 +2,67 @@
+
+ analytic.analytic.account.form
+ account.analytic.account
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Once the end date of the contract is
+ passed or the maximum number of service
+ units (e.g. support contract) is
+ reached, the account manager is notified
+ by email to renew the contract with the
+ customer.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
account.analytic.account.listaccount.analytic.account
@@ -37,7 +98,7 @@
-
+
@@ -82,11 +143,8 @@
formtree,form
-
+
-
Accounts to Renew
@@ -114,7 +172,7 @@
term of costs/revenues reporting.
They are usually structured by contracts, projects, products or
- departements. Most of the OpenERP operations (invoices,
+ departements. Most of the Odoo operations (invoices,
timesheets, expenses, etc) generate analytic entries on the
related account.
-
#
# Open journal entries
@@ -347,26 +367,6 @@
formtree,form
-
- #
- # Reporting
- #
-
-
-
- account.journal.form.1
- account.journal
-
-
-
-
-
-
-
-
-
+
diff --git a/addons/account/project/views/report_analyticbalance.xml b/addons/analytic/views/report_analyticbalance.xml
similarity index 100%
rename from addons/account/project/views/report_analyticbalance.xml
rename to addons/analytic/views/report_analyticbalance.xml
diff --git a/addons/account/project/views/report_analyticcostledger.xml b/addons/analytic/views/report_analyticcostledger.xml
similarity index 100%
rename from addons/account/project/views/report_analyticcostledger.xml
rename to addons/analytic/views/report_analyticcostledger.xml
diff --git a/addons/account/project/views/report_analyticcostledgerquantity.xml b/addons/analytic/views/report_analyticcostledgerquantity.xml
similarity index 100%
rename from addons/account/project/views/report_analyticcostledgerquantity.xml
rename to addons/analytic/views/report_analyticcostledgerquantity.xml
diff --git a/addons/account/project/views/report_analyticjournal.xml b/addons/analytic/views/report_analyticjournal.xml
similarity index 100%
rename from addons/account/project/views/report_analyticjournal.xml
rename to addons/analytic/views/report_analyticjournal.xml
diff --git a/addons/account/project/views/report_invertedanalyticbalance.xml b/addons/analytic/views/report_invertedanalyticbalance.xml
similarity index 100%
rename from addons/account/project/views/report_invertedanalyticbalance.xml
rename to addons/analytic/views/report_invertedanalyticbalance.xml
diff --git a/addons/account/project/wizard/__init__.py b/addons/analytic/wizard/__init__.py
similarity index 97%
rename from addons/account/project/wizard/__init__.py
rename to addons/analytic/wizard/__init__.py
index 972373f87af..de0737e07c3 100644
--- a/addons/account/project/wizard/__init__.py
+++ b/addons/analytic/wizard/__init__.py
@@ -24,7 +24,6 @@ import account_analytic_balance_report
import account_analytic_inverted_balance_report
import account_analytic_cost_ledger_report
import account_analytic_cost_ledger_for_journal_report
-import project_account_analytic_line
import account_analytic_chart
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/project/wizard/account_analytic_balance_report.py b/addons/analytic/wizard/account_analytic_balance_report.py
similarity index 100%
rename from addons/account/project/wizard/account_analytic_balance_report.py
rename to addons/analytic/wizard/account_analytic_balance_report.py
diff --git a/addons/account/project/wizard/account_analytic_balance_report_view.xml b/addons/analytic/wizard/account_analytic_balance_report_view.xml
similarity index 100%
rename from addons/account/project/wizard/account_analytic_balance_report_view.xml
rename to addons/analytic/wizard/account_analytic_balance_report_view.xml
diff --git a/addons/account/project/wizard/account_analytic_chart.py b/addons/analytic/wizard/account_analytic_chart.py
similarity index 94%
rename from addons/account/project/wizard/account_analytic_chart.py
rename to addons/analytic/wizard/account_analytic_chart.py
index 4a26eec7c95..410830a0e9e 100644
--- a/addons/account/project/wizard/account_analytic_chart.py
+++ b/addons/analytic/wizard/account_analytic_chart.py
@@ -35,7 +35,7 @@ class account_analytic_chart(osv.osv_memory):
result_context = {}
if context is None:
context = {}
- result = mod_obj.get_object_reference(cr, uid, 'account', 'action_account_analytic_account_tree2')
+ result = mod_obj.get_object_reference(cr, uid, 'analytic', 'action_account_analytic_account_tree2')
id = result and result[1] or False
result = act_obj.read(cr, uid, [id], context=context)[0]
data = self.read(cr, uid, ids, [])[0]
diff --git a/addons/account/project/wizard/account_analytic_chart_view.xml b/addons/analytic/wizard/account_analytic_chart_view.xml
similarity index 83%
rename from addons/account/project/wizard/account_analytic_chart_view.xml
rename to addons/analytic/wizard/account_analytic_chart_view.xml
index 2fb44f50489..8cbab1d5878 100644
--- a/addons/account/project/wizard/account_analytic_chart_view.xml
+++ b/addons/analytic/wizard/account_analytic_chart_view.xml
@@ -31,13 +31,5 @@
new
-
-
diff --git a/addons/account/project/wizard/account_analytic_cost_ledger_for_journal_report.py b/addons/analytic/wizard/account_analytic_cost_ledger_for_journal_report.py
similarity index 100%
rename from addons/account/project/wizard/account_analytic_cost_ledger_for_journal_report.py
rename to addons/analytic/wizard/account_analytic_cost_ledger_for_journal_report.py
diff --git a/addons/account/project/wizard/account_analytic_cost_ledger_for_journal_report_view.xml b/addons/analytic/wizard/account_analytic_cost_ledger_for_journal_report_view.xml
similarity index 100%
rename from addons/account/project/wizard/account_analytic_cost_ledger_for_journal_report_view.xml
rename to addons/analytic/wizard/account_analytic_cost_ledger_for_journal_report_view.xml
diff --git a/addons/account/project/wizard/account_analytic_cost_ledger_report.py b/addons/analytic/wizard/account_analytic_cost_ledger_report.py
similarity index 100%
rename from addons/account/project/wizard/account_analytic_cost_ledger_report.py
rename to addons/analytic/wizard/account_analytic_cost_ledger_report.py
diff --git a/addons/account/project/wizard/account_analytic_cost_ledger_view.xml b/addons/analytic/wizard/account_analytic_cost_ledger_view.xml
similarity index 100%
rename from addons/account/project/wizard/account_analytic_cost_ledger_view.xml
rename to addons/analytic/wizard/account_analytic_cost_ledger_view.xml
diff --git a/addons/account/project/wizard/account_analytic_inverted_balance_report.py b/addons/analytic/wizard/account_analytic_inverted_balance_report.py
similarity index 100%
rename from addons/account/project/wizard/account_analytic_inverted_balance_report.py
rename to addons/analytic/wizard/account_analytic_inverted_balance_report.py
diff --git a/addons/account/project/wizard/account_analytic_inverted_balance_report.xml b/addons/analytic/wizard/account_analytic_inverted_balance_report.xml
similarity index 100%
rename from addons/account/project/wizard/account_analytic_inverted_balance_report.xml
rename to addons/analytic/wizard/account_analytic_inverted_balance_report.xml
diff --git a/addons/account/project/wizard/account_analytic_journal_report.py b/addons/analytic/wizard/account_analytic_journal_report.py
similarity index 100%
rename from addons/account/project/wizard/account_analytic_journal_report.py
rename to addons/analytic/wizard/account_analytic_journal_report.py
diff --git a/addons/account/project/wizard/account_analytic_journal_report_view.xml b/addons/analytic/wizard/account_analytic_journal_report_view.xml
similarity index 80%
rename from addons/account/project/wizard/account_analytic_journal_report_view.xml
rename to addons/analytic/wizard/account_analytic_journal_report_view.xml
index b196081451a..3aaea712582 100644
--- a/addons/account/project/wizard/account_analytic_journal_report_view.xml
+++ b/addons/analytic/wizard/account_analytic_journal_report_view.xml
@@ -32,7 +32,7 @@
-
+ Account Analytic Journalclient_print_multi
@@ -40,12 +40,5 @@
account.analytic.journal
-
-
-
diff --git a/addons/analytic_user_function/analytic_user_function_view.xml b/addons/analytic_user_function/analytic_user_function_view.xml
index 147e96f0be0..51e020b3f81 100644
--- a/addons/analytic_user_function/analytic_user_function_view.xml
+++ b/addons/analytic_user_function/analytic_user_function_view.xml
@@ -47,7 +47,7 @@
of the default values when invoicing the customer.
- OpenERP will recursively search on parent accounts
+ Odoo will recursively search on parent accounts
to check if specific conditions are defined for a
specific user. This allows to set invoicing
conditions for a group of contracts.
diff --git a/addons/auth_ldap/users_ldap.py b/addons/auth_ldap/users_ldap.py
index 9ddc3d6ed45..70323bb6a0e 100644
--- a/addons/auth_ldap/users_ldap.py
+++ b/addons/auth_ldap/users_ldap.py
@@ -190,7 +190,7 @@ class CompanyLDAP(osv.osv):
if res[1]:
user_id = res[0]
elif conf['create_user']:
- _logger.debug("Creating new OpenERP user \"%s\" from LDAP" % login)
+ _logger.debug("Creating new Odoo user \"%s\" from LDAP" % login)
user_obj = self.pool['res.users']
values = self.map_ldap_attributes(cr, uid, conf, login, ldap_entry)
if conf['user']:
diff --git a/addons/auth_oauth/controllers/main.py b/addons/auth_oauth/controllers/main.py
index 1a166c39cde..e48aeebd8a5 100644
--- a/addons/auth_oauth/controllers/main.py
+++ b/addons/auth_oauth/controllers/main.py
@@ -173,7 +173,7 @@ class OAuthController(http.Controller):
@http.route('/auth_oauth/oea', type='http', auth='none')
def oea(self, **kw):
- """login user via OpenERP Account provider"""
+ """login user via Odoo Account provider"""
dbname = kw.pop('db', None)
if not dbname:
dbname = db_monodb()
diff --git a/addons/auth_signup/auth_signup_data.xml b/addons/auth_signup/auth_signup_data.xml
index 2789fcd8315..096d2327393 100644
--- a/addons/auth_signup/auth_signup_data.xml
+++ b/addons/auth_signup/auth_signup_data.xml
@@ -28,7 +28,7 @@
${object.email|safe}Password resetA password reset was requested for the OpenERP account linked to this email.
+
A password reset was requested for the Odoo account linked to this email.
You may change your password by following this link.
- You have been invited to connect to "${object.company_id.name}" in order to get access to your documents in OpenERP.
+ You have been invited to connect to "${object.company_id.name}" in order to get access to your documents in Odoo.
To accept the invitation, click on the following link:
diff --git a/addons/base_action_rule/base_action_rule.py b/addons/base_action_rule/base_action_rule.py
index b743603f805..d8fbec09d16 100644
--- a/addons/base_action_rule/base_action_rule.py
+++ b/addons/base_action_rule/base_action_rule.py
@@ -156,6 +156,75 @@ class base_action_rule(osv.osv):
""" Wrap the methods `create` and `write` of the models specified by
the rules given by `ids` (or all existing rules if `ids` is `None`.)
"""
+ #
+ # Note: the patched methods create and write must be defined inside
+ # another function, otherwise their closure may be wrong. For instance,
+ # the function create refers to the outer variable 'create', which you
+ # expect to be bound to create itself. But that expectation is wrong if
+ # create is defined inside a loop; in that case, the variable 'create'
+ # is bound to the last function defined by the loop.
+ #
+
+ def make_create():
+ """ instanciate a create method that processes action rules """
+ def create(self, cr, uid, vals, context=None, **kwargs):
+ # avoid loops or cascading actions
+ if context and context.get('action'):
+ return create.origin(self, cr, uid, vals, context=context)
+
+ # call original method with a modified context
+ context = dict(context or {}, action=True)
+ new_id = create.origin(self, cr, uid, vals, context=context, **kwargs)
+
+ # as it is a new record, we do not consider the actions that have a prefilter
+ action_model = self.pool.get('base.action.rule')
+ action_dom = [('model', '=', self._name),
+ ('kind', 'in', ['on_create', 'on_create_or_write'])]
+ action_ids = action_model.search(cr, uid, action_dom, context=context)
+
+ # check postconditions, and execute actions on the records that satisfy them
+ for action in action_model.browse(cr, uid, action_ids, context=context):
+ if action_model._filter(cr, uid, action, action.filter_id, [new_id], context=context):
+ action_model._process(cr, uid, action, [new_id], context=context)
+ return new_id
+
+ return create
+
+ def make_write():
+ """ instanciate a write method that processes action rules """
+ def write(self, cr, uid, ids, vals, context=None, **kwargs):
+ # avoid loops or cascading actions
+ if context and context.get('action'):
+ return write.origin(self, cr, uid, ids, vals, context=context)
+
+ # modify context
+ context = dict(context or {}, action=True)
+ ids = [ids] if isinstance(ids, (int, long, str)) else ids
+
+ # retrieve the action rules to possibly execute
+ action_model = self.pool.get('base.action.rule')
+ action_dom = [('model', '=', self._name),
+ ('kind', 'in', ['on_write', 'on_create_or_write'])]
+ action_ids = action_model.search(cr, uid, action_dom, context=context)
+ actions = action_model.browse(cr, uid, action_ids, context=context)
+
+ # check preconditions
+ pre_ids = {}
+ for action in actions:
+ pre_ids[action] = action_model._filter(cr, uid, action, action.filter_pre_id, ids, context=context)
+
+ # call original method
+ write.origin(self, cr, uid, ids, vals, context=context, **kwargs)
+
+ # check postconditions, and execute actions on the records that satisfy them
+ for action in actions:
+ post_ids = action_model._filter(cr, uid, action, action.filter_id, pre_ids[action], context=context)
+ if post_ids:
+ action_model._process(cr, uid, action, post_ids, context=context)
+ return True
+
+ return write
+
updated = False
if ids is None:
ids = self.search(cr, SUPERUSER_ID, [])
@@ -164,61 +233,8 @@ class base_action_rule(osv.osv):
model_obj = self.pool[model]
if not hasattr(model_obj, 'base_action_ruled'):
# monkey-patch methods create and write
-
- def create(self, cr, uid, vals, context=None, **kwargs):
- # avoid loops or cascading actions
- if context and context.get('action'):
- return create.origin(self, cr, uid, vals, context=context)
-
- # call original method with a modified context
- context = dict(context or {}, action=True)
- new_id = create.origin(self, cr, uid, vals, context=context, **kwargs)
-
- # as it is a new record, we do not consider the actions that have a prefilter
- action_model = self.pool.get('base.action.rule')
- action_dom = [('model', '=', self._name),
- ('kind', 'in', ['on_create', 'on_create_or_write'])]
- action_ids = action_model.search(cr, uid, action_dom, context=context)
-
- # check postconditions, and execute actions on the records that satisfy them
- for action in action_model.browse(cr, uid, action_ids, context=context):
- if action_model._filter(cr, uid, action, action.filter_id, [new_id], context=context):
- action_model._process(cr, uid, action, [new_id], context=context)
- return new_id
-
- def write(self, cr, uid, ids, vals, context=None, **kwargs):
- # avoid loops or cascading actions
- if context and context.get('action'):
- return write.origin(self, cr, uid, ids, vals, context=context)
-
- # modify context
- context = dict(context or {}, action=True)
- ids = [ids] if isinstance(ids, (int, long, str)) else ids
-
- # retrieve the action rules to possibly execute
- action_model = self.pool.get('base.action.rule')
- action_dom = [('model', '=', self._name),
- ('kind', 'in', ['on_write', 'on_create_or_write'])]
- action_ids = action_model.search(cr, uid, action_dom, context=context)
- actions = action_model.browse(cr, uid, action_ids, context=context)
-
- # check preconditions
- pre_ids = {}
- for action in actions:
- pre_ids[action] = action_model._filter(cr, uid, action, action.filter_pre_id, ids, context=context)
-
- # call original method
- write.origin(self, cr, uid, ids, vals, context=context, **kwargs)
-
- # check postconditions, and execute actions on the records that satisfy them
- for action in actions:
- post_ids = action_model._filter(cr, uid, action, action.filter_id, pre_ids[action], context=context)
- if post_ids:
- action_model._process(cr, uid, action, post_ids, context=context)
- return True
-
- model_obj._patch_method('create', create)
- model_obj._patch_method('write', write)
+ model_obj._patch_method('create', make_create())
+ model_obj._patch_method('write', make_write())
model_obj.base_action_ruled = True
updated = True
diff --git a/addons/base_action_rule/test_models.py b/addons/base_action_rule/test_models.py
index 2a88def6f75..b931b0fc3be 100644
--- a/addons/base_action_rule/test_models.py
+++ b/addons/base_action_rule/test_models.py
@@ -1,4 +1,5 @@
from openerp.osv import fields, osv
+from openerp import api
AVAILABLE_STATES = [
('draft', 'New'),
@@ -25,6 +26,7 @@ class lead_test(osv.Model):
'active' : True,
}
+ @api.cr_uid_ids_context
def message_post(self, cr, uid, thread_id, body='', subject=None, type='notification', subtype=None, parent_id=False, attachments=None, context=None, **kwargs):
pass
diff --git a/addons/base_gengo/controller/gengo_callback.py b/addons/base_gengo/controller/gengo_callback.py
index 44fa9b9390a..328be0ae357 100644
--- a/addons/base_gengo/controller/gengo_callback.py
+++ b/addons/base_gengo/controller/gengo_callback.py
@@ -18,17 +18,18 @@ class website_gengo(http.Controller):
@http.route('/website/gengo_callback', type='http', auth='none')
def gengo_callback(self, **post):
+ print "IN website/gengo_callback"
cr, uid, context = request.cr, openerp.SUPERUSER_ID, request.context
translation_pool = request.registry['ir.translation']
if post and post.get('job') and post.get('pgk'):
if post.get('pgk') != self.get_gengo_key(cr):
- return Response("Bad authentication - 403/412", status=412)
+ return Response("Bad authentication", status=104)
job = json.loads(post['job'], 'utf-8')
tid = job.get('custom_data', False)
if (job.get('status') == 'approved') and tid:
term = translation_pool.browse(cr, uid, int(tid), context=context)
if term.src != job.get('body_src'):
- return Response("Text Altered - Not saved", status=100)
+ return Response("Text Altered - Not saved", status=418)
domain = [
'|',
('id', "=", int(tid)),
@@ -49,5 +50,5 @@ class website_gengo(http.Controller):
translation_pool.write(cr, uid, all_ir_tanslations, vals, context=context)
return Response("OK", status=200)
else:
- return Response("No terms found", status=104)
- return Response("Not saved", status=100)
+ return Response("No terms found", status=412)
+ return Response("Not saved", status=418)
diff --git a/addons/base_gengo/gengo_sync_schedular_data.xml b/addons/base_gengo/gengo_sync_schedular_data.xml
index e916489e5f7..0af74d8ccf1 100644
--- a/addons/base_gengo/gengo_sync_schedular_data.xml
+++ b/addons/base_gengo/gengo_sync_schedular_data.xml
@@ -8,7 +8,7 @@
6hours-1
- 0
+
@@ -21,7 +21,7 @@
6hours-1
- 0
+
diff --git a/addons/base_gengo/wizard/base_gengo_translations.py b/addons/base_gengo/wizard/base_gengo_translations.py
index 4ef13eb7b46..afa06c782d1 100644
--- a/addons/base_gengo/wizard/base_gengo_translations.py
+++ b/addons/base_gengo/wizard/base_gengo_translations.py
@@ -119,7 +119,7 @@ class base_gengo_translations(osv.osv_memory):
"""
This method will be called by cron services to get translations from
Gengo. It will read translated terms and comments from Gengo and will
- update respective ir.translation in openerp.
+ update respective ir.translation in Odoo.
"""
translation_pool = self.pool.get('ir.translation')
flag, gengo = self.gengo_authentication(cr, uid, context=context)
@@ -245,7 +245,7 @@ class base_gengo_translations(osv.osv_memory):
A special key 'gengo_language' can be passed in the context in order to
request only translations of that language only. Its value is the language
- ID in openerp.
+ ID in Odoo.
"""
if context is None:
context = {}
diff --git a/addons/base_geolocalize/views/res_partner_view.xml b/addons/base_geolocalize/views/res_partner_view.xml
index 1bd537ae3ff..f05376a4259 100644
--- a/addons/base_geolocalize/views/res_partner_view.xml
+++ b/addons/base_geolocalize/views/res_partner_view.xml
@@ -8,9 +8,9 @@
-
+
-
+