diff --git a/README.md b/README.md index d76976405b3..d5570e7a028 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Build Status](http://runbot.odoo.com/runbot/badge/default/1/master.svg)](http://runbot.odoo.com/runbot) +[![Build Status](http://runbot.odoo.com/runbot/badge/default/1/8.0.svg)](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..066c0a66323 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -100,24 +100,22 @@ + +
+ - + @@ -116,7 +116,7 @@ - +