diff --git a/addons/account/account.py b/addons/account/account.py index 45f798f7487..ffb7b4b2166 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -2414,6 +2414,7 @@ class wizard_multi_charts_accounts(osv.osv_memory): obj_acc_template = self.pool.get('account.account.template') obj_fiscal_position_template = self.pool.get('account.fiscal.position.template') obj_fiscal_position = self.pool.get('account.fiscal.position') + data_pool = self.pool.get('ir.model.data') # Creating Account obj_acc_root = obj_multi.chart_template_id.account_root_id @@ -2524,7 +2525,10 @@ class wizard_multi_charts_accounts(osv.osv_memory): # Creating Journals vals_journal={} - view_id = self.pool.get('account.journal.view').search(cr,uid,[('name','=','Journal View')])[0] + data_id = data_pool.search(cr, uid, [('model','=','account.journal.view'), ('name','=','account_journal_view')]) + data = data_pool.browse(cr, uid, data_id[0]) + view_id = data.res_id + seq_id = obj_sequence.search(cr, uid, [('name','=','Account Journal')])[0] if obj_multi.seq_journal: @@ -2561,8 +2565,15 @@ class wizard_multi_charts_accounts(osv.osv_memory): obj_journal.create(cr,uid,vals_journal) # Bank Journals - view_id_cash = self.pool.get('account.journal.view').search(cr, uid, [('name','=','Bank/Cash Journal View')])[0] #TOFIX: why put fix name - view_id_cur = self.pool.get('account.journal.view').search(cr, uid, [('name','=','Bank/Cash Journal (Multi-Currency) View')])[0] #TOFIX: why put fix name + data_id = data_pool.search(cr, uid, [('model','=','account.journal.view'), ('name','=','account_journal_bank_view')]) + data = data_pool.browse(cr, uid, data_id[0]) + view_id_cash = data.res_id + #view_id_cash = self.pool.get('account.journal.view').search(cr, uid, [('name','=','Bank/Cash Journal View')])[0] #TOFIX: why put fix name + + data_id = data_pool.search(cr, uid, [('model','=','account.journal.view'), ('name','=','account_journal_bank_view_multi')]) + data = data_pool.browse(cr, uid, data_id[0]) + ref_acc_bank = data.res_id + #ref_acc_bank = self.pool.get('account.journal.view').search(cr, uid, [('name','=','Bank/Cash Journal (Multi-Currency) View')])[0] #TOFIX: why put fix name ref_acc_bank = obj_multi.chart_template_id.bank_account_view_id current_num = 1 diff --git a/addons/account/account_menuitem.xml b/addons/account/account_menuitem.xml index 56d83debe4c..e0ac10abb50 100644 --- a/addons/account/account_menuitem.xml +++ b/addons/account/account_menuitem.xml @@ -8,7 +8,7 @@ - + diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index daae3043a41..80fb20e1fad 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -358,14 +358,11 @@ - - - @@ -1130,10 +1127,6 @@ - - - - @@ -1179,15 +1172,21 @@ src_model="account.move"/> - Journal Entries to Review + Journal Entries ir.actions.act_window account.move form - [('to_check','=',True)] + [('to_check','=',True), ('state','=','draft')] - + + + @@ -1553,7 +1552,7 @@ - + @@ -1842,17 +1841,17 @@ search - - - - - + + + + + - - - + + + @@ -1878,7 +1877,7 @@ form
- + @@ -1903,19 +1902,19 @@ search - - - - - - + + + + + + - + @@ -2060,20 +2059,20 @@ - + account.tax.code.template.search account.tax.code.template search - - - - + + + + - + diff --git a/addons/account/invoice.py b/addons/account/invoice.py index 0030d36d896..423c39deea1 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -223,7 +223,7 @@ class account_invoice(osv.osv): _log_create = True _columns = { 'name': fields.char('Description', size=64, select=True, readonly=True, states={'draft':[('readonly',False)]}), - 'origin': fields.char('Source Document', size=64, help="Reference of the document that produced this invoice."), + 'origin': fields.char('Source Document', size=64, help="Reference of the document that produced this invoice.", readonly=True, states={'draft':[('readonly',False)]}), 'type': fields.selection([ ('out_invoice','Customer Invoice'), ('in_invoice','Supplier Invoice'), @@ -250,8 +250,8 @@ class account_invoice(osv.osv): \n* The \'Open\' state is used when user create invoice,a invoice number is generated.Its in open state till user does not pay invoice. \ \n* The \'Done\' state is set automatically when invoice is paid.\ \n* The \'Cancelled\' state is used when user cancel invoice.'), - 'date_invoice': fields.date('Date Invoiced', states={'open':[('readonly',True)], 'close':[('readonly',True)]}, help="Keep empty to use the current date"), - 'date_due': fields.date('Due Date', states={'open':[('readonly',True)], 'close':[('readonly',True)]}, + 'date_invoice': fields.date('Date Invoiced', states={'paid':[('readonly',True)], 'open':[('readonly',True)], 'close':[('readonly',True)]}, help="Keep empty to use the current date"), + 'date_due': fields.date('Due Date', states={'paid':[('readonly',True)], 'open':[('readonly',True)], 'close':[('readonly',True)]}, help="If you use payment terms, the due date will be computed automatically at the generation "\ "of accounting entries. If you keep the payment term and the due date empty, it means direct payment. The payment term may compute several due dates, for example 50% now, 50% in one month."), 'partner_id': fields.many2one('res.partner', 'Partner', change_default=True, readonly=True, required=True, states={'draft':[('readonly',False)]}), @@ -291,7 +291,7 @@ class account_invoice(osv.osv): multi='all'), 'currency_id': fields.many2one('res.currency', 'Currency', required=True, readonly=True, states={'draft':[('readonly',False)]}), 'journal_id': fields.many2one('account.journal', 'Journal', required=True, readonly=True, states={'draft':[('readonly',False)]}), - 'company_id': fields.many2one('res.company', 'Company', required=True, change_default=True), + 'company_id': fields.many2one('res.company', 'Company', required=True, change_default=True, readonly=True, states={'draft':[('readonly',False)]}), 'check_total': fields.float('Total', digits_compute=dp.get_precision('Account'), states={'open':[('readonly',True)],'close':[('readonly',True)]}), 'reconciled': fields.function(_reconciled, method=True, string='Paid/Reconciled', type='boolean', store={ @@ -300,7 +300,7 @@ class account_invoice(osv.osv): 'account.move.reconcile': (_get_invoice_from_reconcile, None, 50), }, help="The Ledger Postings of the invoice have been reconciled with Ledger Postings of the payment(s)."), 'partner_bank': fields.many2one('res.partner.bank', 'Bank Account', - help='The bank account to pay to or to be paid from'), + help='The bank account to pay to or to be paid from', readonly=True, states={'draft':[('readonly',False)]}), 'move_lines':fields.function(_get_lines , method=True, type='many2many', relation='account.move.line', string='Entry Lines'), 'residual': fields.function(_amount_residual, method=True, digits_compute=dp.get_precision('Account'), string='Residual', store={ @@ -314,7 +314,7 @@ class account_invoice(osv.osv): 'payment_ids': fields.function(_compute_lines, method=True, relation='account.move.line', type="many2many", string='Payments'), 'move_name': fields.char('Ledger Posting', size=64, readonly=True, states={'draft':[('readonly',False)]}), 'user_id': fields.many2one('res.users', 'Salesman', readonly=True, states={'draft':[('readonly',False)]}), - 'fiscal_position': fields.many2one('account.fiscal.position', 'Fiscal Position') + 'fiscal_position': fields.many2one('account.fiscal.position', 'Fiscal Position', readonly=True, states={'draft':[('readonly',False)]}) } _defaults = { 'type': _get_type, diff --git a/addons/account/report/account_invoice_report_view.xml b/addons/account/report/account_invoice_report_view.xml index ca89cd10852..3a5a4812c1b 100644 --- a/addons/account/report/account_invoice_report_view.xml +++ b/addons/account/report/account_invoice_report_view.xml @@ -30,10 +30,10 @@ - + - - + + @@ -93,24 +93,24 @@ - + - + - - + + - - + + - - + + - + - - - + + + diff --git a/addons/account/wizard/account_invoice_refund.py b/addons/account/wizard/account_invoice_refund.py index 41baac36f89..6a19dc988df 100644 --- a/addons/account/wizard/account_invoice_refund.py +++ b/addons/account/wizard/account_invoice_refund.py @@ -61,7 +61,8 @@ class account_invoice_refund(osv.osv_memory): date = False period = False description = False - for inv in inv_obj.browse(cr, uid, context['active_ids'], context=context): + company = self.pool.get('res.users').browse(cr, uid, uid).company_id + for inv in inv_obj.browse(cr, uid, context.get('active_ids'), context=context): if inv.state in ['draft', 'proforma2', 'cancel']: raise osv.except_osv(_('Error !'), _('Can not %s draft/proforma/cancel invoice.') % (mode)) if form['period'] : @@ -77,11 +78,8 @@ class account_invoice_refund(osv.osv_memory): and name = 'company_id'") result_query = cr.fetchone() if result_query: - cr.execute("""SELECT id - from account_period where date(%s) - between date_start AND date_stop \ - and company_id = %s limit 1 """, - (date, self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.id,)) + cr.execute("""select p.id from account_fiscalyear y, account_period p where y.id=p.fiscalyear_id \ + and date(%s) between p.date_start AND p.date_stop and y.company_id = %s limit 1""", (date, company.id,)) else: cr.execute("""SELECT id from account_period where date(%s) @@ -154,7 +152,7 @@ class account_invoice_refund(osv.osv_memory): 'tax_line': tax_lines, 'period_id': period, 'name': description - }) + }) for field in ('address_contact_id', 'address_invoice_id', 'partner_id', 'account_id', 'currency_id', 'payment_term', 'journal_id'): @@ -192,4 +190,4 @@ class account_invoice_refund(osv.osv_memory): account_invoice_refund() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_budget/crossovered_budget_demo.xml b/addons/account_budget/crossovered_budget_demo.xml index 8e9ba6a9493..7c4c6e3ea15 100644 --- a/addons/account_budget/crossovered_budget_demo.xml +++ b/addons/account_budget/crossovered_budget_demo.xml @@ -2,337 +2,337 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/addons/account_followup/account_followup_view.xml b/addons/account_followup/account_followup_view.xml index 50c1cb5df34..82e3450163a 100644 --- a/addons/account_followup/account_followup_view.xml +++ b/addons/account_followup/account_followup_view.xml @@ -153,8 +153,8 @@ form - + diff --git a/addons/account_voucher/voucher.py b/addons/account_voucher/voucher.py index 00d12f8063b..13df5a496fc 100644 --- a/addons/account_voucher/voucher.py +++ b/addons/account_voucher/voucher.py @@ -212,9 +212,21 @@ class account_voucher(osv.osv): self.write(cr, uid, ids, {'state':'posted'}) return True - def action_cancel_draft(self, cr, uid, ids, *args): + def action_cancel_draft(self, cr, uid, ids, context={}): self.write(cr, uid, ids, {'state':'draft'}) return True + + def audit_pass(self, cr, uid, ids, context={}): + move_pool = self.pool.get('account.move') + result = True + audit_pass = [] + for voucher in self.browse(cr, uid, ids): + if voucher.move_id and voucher.move_id.state == 'draft': + result = result and move_pool.button_validate(cr, uid, [voucher.move_id.id]) + audit_pass += [voucher.id] + + self.write(cr, uid, audit_pass, {'state':'audit'}) + return result def cancel_voucher(self, cr, uid, ids, context={}): move_pool = self.pool.get('account.move') @@ -258,7 +270,6 @@ class account_voucher(osv.osv): company_currency = inv.company_id.currency_id.id diff_currency_p = inv.currency_id.id <> company_currency - ref = inv.reference journal = journal_pool.browse(cr, uid, inv.journal_id.id) if journal.sequence_id: @@ -289,7 +300,7 @@ class account_voucher(osv.osv): 'journal_id': inv.journal_id.id, 'period_id': inv.period_id.id, 'partner_id': False, - 'ref': ref, + 'ref': inv.reference, 'date': inv.date } if diff_currency_p: @@ -318,7 +329,7 @@ class account_voucher(osv.osv): 'journal_id': inv.journal_id.id, 'period_id': inv.period_id.id, 'partner_id': line.partner_id.id or False, - 'ref': ref, + 'ref': line.ref, 'date': inv.date, 'analytic_account_id': False } diff --git a/addons/account_voucher/voucher_view.xml b/addons/account_voucher/voucher_view.xml index 1d9d1e6a8d0..658b8f8429b 100644 --- a/addons/account_voucher/voucher_view.xml +++ b/addons/account_voucher/voucher_view.xml @@ -199,12 +199,28 @@ + + + Vouchers Entries + account.voucher + form + tree,form + + [('state','=','posted')] + {'state':'posted'} + + + + diff --git a/addons/account_voucher/voucher_workflow.xml b/addons/account_voucher/voucher_workflow.xml index 091e84cfd88..f1444761c48 100644 --- a/addons/account_voucher/voucher_workflow.xml +++ b/addons/account_voucher/voucher_workflow.xml @@ -18,16 +18,14 @@ proforma - write({'state':'proforma'}) - open_voucher() + open_voucher() function done - write({'state':'posted'}) - proforma_voucher() + proforma_voucher() function @@ -48,7 +46,7 @@ audit - write({'state':'audit'}) + audit_pass() True function diff --git a/addons/account_voucher_payment/account_voucher_payment.py b/addons/account_voucher_payment/account_voucher_payment.py index 39c67787157..f2c6507181c 100755 --- a/addons/account_voucher_payment/account_voucher_payment.py +++ b/addons/account_voucher_payment/account_voucher_payment.py @@ -53,8 +53,7 @@ class account_voucher(osv.osv): company_currency = inv.company_id.currency_id.id diff_currency_p = inv.currency_id.id <> company_currency - ref = inv.reference - + journal = journal_pool.browse(cr, uid, inv.journal_id.id) if journal.sequence_id: name = sequence_pool.get_id(cr, uid, journal.sequence_id.id) @@ -84,7 +83,7 @@ class account_voucher(osv.osv): 'journal_id': inv.journal_id.id, 'period_id': inv.period_id.id, 'partner_id': False, - 'ref': ref, + 'ref': inv.reference, 'date': inv.date } if diff_currency_p: @@ -113,7 +112,7 @@ class account_voucher(osv.osv): 'journal_id': inv.journal_id.id, 'period_id': inv.period_id.id, 'partner_id': line.partner_id.id or False, - 'ref': ref, + 'ref': line.ref, 'date': inv.date, 'analytic_account_id': False } @@ -198,7 +197,8 @@ class account_voucher_line(osv.osv): res.update({ 'amount': residual, - 'account_id': invoice.account_id.id + 'account_id': invoice.account_id.id, + 'ref':invoice.number }) return { diff --git a/addons/crm/crm_lead_data.xml b/addons/crm/crm_lead_data.xml index 2b47140e396..41eeb529154 100644 --- a/addons/crm/crm_lead_data.xml +++ b/addons/crm/crm_lead_data.xml @@ -1,81 +1,105 @@ - + - - - New - - - - - Assigned - - - - - In Process - - - - - Converted - - - - - Recycled - - - - - Dead - - - + + + New + + + + + - - - Telesales - - - - - Mail - - - - - Email - - - - - Print - - - - - Web - - - - - Radio - - - - - Television - - - - - Newsletter - - - + + Qualification + + + + + - + + Proposition + + + + + + + + Negotiation + + + + + + + + Win + + + + + + + + Lost + + + + + + + + + Telesales + + + + + + Mail + + + + + + Email + + + + + + Print + + + + + + Web + + + + + + Radio + + + + + + Television + + + + + + Newsletter + + + + + diff --git a/addons/crm/crm_opportunity_data.xml b/addons/crm/crm_opportunity_data.xml index a7cfd2d46ca..fd4d76d5865 100644 --- a/addons/crm/crm_opportunity_data.xml +++ b/addons/crm/crm_opportunity_data.xml @@ -1,6 +1,6 @@ - + Existing Customer @@ -42,43 +42,6 @@ - - - Prospecting - - - - - Needs Analysis - - - - - Value Proposition - - - - - Proposal/Price Quote - - - - - Negotiation/Review - - - - - Closed Won - - - - - Closed Lost - - - - Existing Business diff --git a/addons/crm/crm_opportunity_demo.xml b/addons/crm/crm_opportunity_demo.xml index 3c06d16dc19..48812b17cf0 100644 --- a/addons/crm/crm_opportunity_demo.xml +++ b/addons/crm/crm_opportunity_demo.xml @@ -20,7 +20,7 @@ - + @@ -36,7 +36,7 @@ - + @@ -53,7 +53,7 @@ - + @@ -70,7 +70,7 @@ - + @@ -86,7 +86,7 @@ - + diff --git a/addons/crm/test/test_crm_opportunity.yml b/addons/crm/test/test_crm_opportunity.yml index e3a4f28cb5e..48a71de1dce 100644 --- a/addons/crm/test/test_crm_opportunity.yml +++ b/addons/crm/test/test_crm_opportunity.yml @@ -8,7 +8,7 @@ partner_address_id: base.res_partner_address_1 partner_id: base.res_partner_9 probability: 1.0 - stage_id: crm.stage_oppor1 + stage_id: crm.stage_lead1 categ_id: crm.categ_oppor2 section_id: crm.section_sales_department diff --git a/addons/crm/wizard/crm_lead_to_partner_view.xml b/addons/crm/wizard/crm_lead_to_partner_view.xml index 2f7f8540e7f..8b9c0d1fee9 100644 --- a/addons/crm/wizard/crm_lead_to_partner_view.xml +++ b/addons/crm/wizard/crm_lead_to_partner_view.xml @@ -1,25 +1,6 @@ - - - - crm.lead2partner.view.create - crm.lead2partner - form - - -