diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index c23f0c37115..5b09f815f54 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -409,7 +409,7 @@ class account_invoice(osv.osv): ''' assert len(ids) == 1, 'This option should only be used for a single id at a time.' self.write(cr, uid, ids, {'sent': True}, context=context) - return self.pool['report'].get_action(cr, uid, [], 'account.report_invoice', context=context) + return self.pool['report'].get_action(cr, uid, ids, 'account.report_invoice', context=context) def action_invoice_sent(self, cr, uid, ids, context=None): ''' @@ -1780,7 +1780,7 @@ class res_partner(osv.osv): """ Inherits partner and adds invoice information in the partner form """ _inherit = 'res.partner' _columns = { - 'invoice_ids': fields.one2many('account.invoice.line', 'partner_id', 'Invoices', readonly=True), + 'invoice_ids': fields.one2many('account.invoice', 'partner_id', 'Invoices', readonly=True), } def _find_accounting_partner(self, partner): diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index 729c9d16b7a..628cc7229e5 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -1040,7 +1040,7 @@ class account_move_line(osv.osv): if opening_reconciliation: obj_move_rec.write(cr, uid, unlink_ids, {'opening_reconciliation': False}) obj_move_rec.unlink(cr, uid, unlink_ids) - if all_moves: + if len(all_moves) >= 2: obj_move_line.reconcile_partial(cr, uid, all_moves, 'auto',context=context) return True diff --git a/addons/account/partner.py b/addons/account/partner.py index f24ffcf55b4..cafd5505cad 100644 --- a/addons/account/partner.py +++ b/addons/account/partner.py @@ -162,6 +162,26 @@ class res_partner(osv.osv): def _debit_search(self, cr, uid, obj, name, args, context=None): return self._asset_difference_search(cr, uid, obj, name, 'payable', args, context=context) + def _invoice_total(self, cr, uid, ids, field_name, arg, context=None): + 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) + result[partner.id] = sum(inv.user_currency_price_total for inv in invoices) + return result + + def _journal_item_count(self, cr, uid, ids, field_name, arg, context=None): + MoveLine = self.pool('account.move.line') + AnalyticAccount = self.pool('account.analytic.account') + return { + partner_id: { + 'journal_item_count': MoveLine.search_count(cr, uid, [('partner_id', '=', partner_id)], context=context), + 'contracts_count': AnalyticAccount.search_count(cr,uid, [('partner_id', '=', partner_id)], context=context) + } + for partner_id in ids + } + def has_something_to_reconcile(self, cr, uid, partner_id, context=None): ''' at least a debit, a credit and a line older than the last reconciliation date of the partner @@ -190,6 +210,9 @@ 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'), + '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( type='many2one', relation='account.account', diff --git a/addons/account/partner_view.xml b/addons/account/partner_view.xml index 829ce8dc0f0..0fa21444a09 100644 --- a/addons/account/partner_view.xml +++ b/addons/account/partner_view.xml @@ -64,13 +64,21 @@ - + + diff --git a/addons/account/project/wizard/account_analytic_balance_report.py b/addons/account/project/wizard/account_analytic_balance_report.py index 3a3c301cffc..062945fa53e 100644 --- a/addons/account/project/wizard/account_analytic_balance_report.py +++ b/addons/account/project/wizard/account_analytic_balance_report.py @@ -50,6 +50,6 @@ class account_analytic_balance(osv.osv_memory): datas['form']['active_ids'] = context.get('active_ids', False) - return self.pool['report'].get_action(cr, uid, ids, 'account.report_analyticbalance', data=datas, context=context) + return self.pool['report'].get_action(cr, uid, [], 'account.report_analyticbalance', data=datas, context=context) # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/project/wizard/account_analytic_cost_ledger_for_journal_report.py b/addons/account/project/wizard/account_analytic_cost_ledger_for_journal_report.py index 125dfda46fb..ab84af4880a 100644 --- a/addons/account/project/wizard/account_analytic_cost_ledger_for_journal_report.py +++ b/addons/account/project/wizard/account_analytic_cost_ledger_for_journal_report.py @@ -49,6 +49,6 @@ class account_analytic_cost_ledger_journal_report(osv.osv_memory): } datas['form']['active_ids'] = context.get('active_ids', False) - return self.pool['report'].get_action(cr, uid, ids, 'account.report_analyticcostledgerquantity', data=datas, context=context) + return self.pool['report'].get_action(cr, uid, [], 'account.report_analyticcostledgerquantity', data=datas, context=context) # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/project/wizard/account_analytic_cost_ledger_report.py b/addons/account/project/wizard/account_analytic_cost_ledger_report.py index 5f00c3c9ac5..978863f5900 100644 --- a/addons/account/project/wizard/account_analytic_cost_ledger_report.py +++ b/addons/account/project/wizard/account_analytic_cost_ledger_report.py @@ -49,6 +49,6 @@ class account_analytic_cost_ledger(osv.osv_memory): datas['form']['active_ids'] = context.get('active_ids', False) - return self.pool['report'].get_action(cr, uid, ids, 'account.report_analyticcostledger', data=datas, context=context) + return self.pool['report'].get_action(cr, uid, [], 'account.report_analyticcostledger', data=datas, context=context) # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/project/wizard/account_analytic_inverted_balance_report.py b/addons/account/project/wizard/account_analytic_inverted_balance_report.py index ad79c0b33f6..93946960297 100644 --- a/addons/account/project/wizard/account_analytic_inverted_balance_report.py +++ b/addons/account/project/wizard/account_analytic_inverted_balance_report.py @@ -47,6 +47,6 @@ class account_analytic_inverted_balance(osv.osv_memory): 'form': data } datas['form']['active_ids'] = context.get('active_ids', False) - return self.pool['report'].get_action(cr, uid, ids, 'account.report_invertedanalyticbalance', data=datas, context=context) + return self.pool['report'].get_action(cr, uid, [], 'account.report_invertedanalyticbalance', data=datas, context=context) # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/project/wizard/account_analytic_journal_report.py b/addons/account/project/wizard/account_analytic_journal_report.py index f2e406bc3a5..d8790e805d8 100644 --- a/addons/account/project/wizard/account_analytic_journal_report.py +++ b/addons/account/project/wizard/account_analytic_journal_report.py @@ -57,7 +57,7 @@ class account_analytic_journal_report(osv.osv_memory): context2 = context.copy() context2['active_model'] = 'account.analytic.journal' context2['active_ids'] = ids_list - return self.pool['report'].get_action(cr, uid, ids, 'account.report_analyticjournal', data=datas, context=context2) + return self.pool['report'].get_action(cr, uid, [], 'account.report_analyticjournal', data=datas, context=context2) def default_get(self, cr, uid, fields, context=None): if context is None: diff --git a/addons/account/views/report_invoice.xml b/addons/account/views/report_invoice.xml index 6757095a7d4..6c4b701c6cf 100644 --- a/addons/account/views/report_invoice.xml +++ b/addons/account/views/report_invoice.xml @@ -47,7 +47,6 @@ Description Quantity - Unit of measure Unit Price Discount (%) Taxes @@ -57,8 +56,10 @@ - - + + + + @@ -100,7 +101,7 @@
-
+
@@ -136,7 +137,7 @@

Fiscal Position: - +

diff --git a/addons/account/wizard/account_financial_report.py b/addons/account/wizard/account_financial_report.py index 6c1b57fa428..721e47193a2 100644 --- a/addons/account/wizard/account_financial_report.py +++ b/addons/account/wizard/account_financial_report.py @@ -89,6 +89,6 @@ class accounting_report(osv.osv_memory): def _print_report(self, cr, uid, ids, data, context=None): data['form'].update(self.read(cr, uid, ids, ['date_from_cmp', 'debit_credit', 'date_to_cmp', 'fiscalyear_id_cmp', 'period_from_cmp', 'period_to_cmp', 'filter_cmp', 'account_report_id', 'enable_filter', 'label_filter','target_move'], context=context)[0]) - return self.pool['report'].get_action(cr, uid, ids, 'account.report_financial', data=data, context=context) + return self.pool['report'].get_action(cr, uid, [], 'account.report_financial', data=data, context=context) # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/wizard/account_report_account_balance.py b/addons/account/wizard/account_report_account_balance.py index 3b9d3c21777..9eba5f24b99 100644 --- a/addons/account/wizard/account_report_account_balance.py +++ b/addons/account/wizard/account_report_account_balance.py @@ -21,6 +21,7 @@ from openerp.osv import fields, osv + class account_balance_report(osv.osv_memory): _inherit = "account.common.account.report" _name = 'account.balance.report' @@ -36,6 +37,6 @@ class account_balance_report(osv.osv_memory): def _print_report(self, cr, uid, ids, data, context=None): data = self.pre_print_report(cr, uid, ids, data, context=context) - return self.pool['report'].get_action(cr, uid, ids, 'account.report_trialbalance', data=data, context=context) + return self.pool['report'].get_action(cr, uid, [], 'account.report_trialbalance', data=data, context=context) # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/wizard/account_report_aged_partner_balance.py b/addons/account/wizard/account_report_aged_partner_balance.py index c918a1119fd..d7b57eaba02 100644 --- a/addons/account/wizard/account_report_aged_partner_balance.py +++ b/addons/account/wizard/account_report_aged_partner_balance.py @@ -81,6 +81,6 @@ class account_aged_trial_balance(osv.osv_memory): data['form'].update(res) if data.get('form',False): data['ids']=[data['form'].get('chart_account_id',False)] - return self.pool['report'].get_action(cr, uid, ids, 'account.report_agedpartnerbalance', data=data, context=context) + return self.pool['report'].get_action(cr, uid, [], 'account.report_agedpartnerbalance', data=data, context=context) # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/wizard/account_report_central_journal.py b/addons/account/wizard/account_report_central_journal.py index 9f22d49afac..a31fef91ae4 100644 --- a/addons/account/wizard/account_report_central_journal.py +++ b/addons/account/wizard/account_report_central_journal.py @@ -21,6 +21,7 @@ from openerp.osv import fields, osv + class account_central_journal(osv.osv_memory): _name = 'account.central.journal' _description = 'Account Central Journal' @@ -32,6 +33,6 @@ class account_central_journal(osv.osv_memory): def _print_report(self, cr, uid, ids, data, context=None): data = self.pre_print_report(cr, uid, ids, data, context=context) - return self.pool['report'].get_action(cr, uid, ids, 'account.report_centraljournal', data=data, context=context) + return self.pool['report'].get_action(cr, uid, [], 'account.report_centraljournal', data=data, context=context) # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/wizard/account_report_general_journal.py b/addons/account/wizard/account_report_general_journal.py index 3d9d55b19c1..c35a5920428 100644 --- a/addons/account/wizard/account_report_general_journal.py +++ b/addons/account/wizard/account_report_general_journal.py @@ -21,6 +21,7 @@ from openerp.osv import fields, osv + class account_general_journal(osv.osv_memory): _inherit = "account.common.journal.report" _name = 'account.general.journal' @@ -32,6 +33,6 @@ class account_general_journal(osv.osv_memory): def _print_report(self, cr, uid, ids, data, context=None): data = self.pre_print_report(cr, uid, ids, data, context=context) - return self.pool['report'].get_action(cr, uid, ids, 'account.report_generaljournal', data=data, context=context) + return self.pool['report'].get_action(cr, uid, [], 'account.report_generaljournal', data=data, context=context) # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/wizard/account_report_general_ledger.py b/addons/account/wizard/account_report_general_ledger.py index c75477da40a..5f0a302d720 100644 --- a/addons/account/wizard/account_report_general_ledger.py +++ b/addons/account/wizard/account_report_general_ledger.py @@ -59,6 +59,6 @@ class account_report_general_ledger(osv.osv_memory): if data['form']['landscape'] is False: data['form'].pop('landscape') - return self.pool['report'].get_action(cr, uid, ids, 'account.report_generalledger', data=data, context=context) + return self.pool['report'].get_action(cr, uid, [], 'account.report_generalledger', data=data, context=context) # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/wizard/account_report_partner_balance.py b/addons/account/wizard/account_report_partner_balance.py index d4b5fb27d14..7485bec67fe 100644 --- a/addons/account/wizard/account_report_partner_balance.py +++ b/addons/account/wizard/account_report_partner_balance.py @@ -44,6 +44,6 @@ class account_partner_balance(osv.osv_memory): context = {} data = self.pre_print_report(cr, uid, ids, data, context=context) data['form'].update(self.read(cr, uid, ids, ['display_partner'])[0]) - return self.pool['report'].get_action(cr, uid, ids, 'account.report_partnerbalance', data=data, context=context) + return self.pool['report'].get_action(cr, uid, [], 'account.report_partnerbalance', data=data, context=context) # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/wizard/account_report_partner_ledger.py b/addons/account/wizard/account_report_partner_ledger.py index eb743e32e4f..38ff6988fd7 100644 --- a/addons/account/wizard/account_report_partner_ledger.py +++ b/addons/account/wizard/account_report_partner_ledger.py @@ -58,7 +58,7 @@ class account_partner_ledger(osv.osv_memory): data = self.pre_print_report(cr, uid, ids, data, context=context) data['form'].update(self.read(cr, uid, ids, ['initial_balance', 'filter', 'page_split', 'amount_currency'])[0]) if data['form'].get('page_split') is True: - return self.pool['report'].get_action(cr, uid, ids, 'account.report_partnerledgerother', data=data, context=context) - return self.pool['report'].get_action(cr, uid, ids, 'account.report_partnerledger', data=data, context=context) + return self.pool['report'].get_action(cr, uid, [], 'account.report_partnerledgerother', data=data, context=context) + return self.pool['report'].get_action(cr, uid, [], 'account.report_partnerledger', data=data, context=context) # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/wizard/account_report_print_journal.py b/addons/account/wizard/account_report_print_journal.py index 3aafc63acf4..1f6b6e0cf4d 100644 --- a/addons/account/wizard/account_report_print_journal.py +++ b/addons/account/wizard/account_report_print_journal.py @@ -67,8 +67,8 @@ class account_print_journal(osv.osv_memory): data = self.pre_print_report(cr, uid, ids, data, context=context) data['form'].update(self.read(cr, uid, ids, ['sort_selection'], context=context)[0]) if context.get('sale_purchase_only'): - return self.pool['report'].get_action(cr, uid, ids, 'account.report_salepurchasejournal', data=data, context=context) + return self.pool['report'].get_action(cr, uid, [], 'account.report_salepurchasejournal', data=data, context=context) else: - return self.pool['report'].get_action(cr, uid, ids, 'account.report_journal', data=data, context=context) + return self.pool['report'].get_action(cr, uid, [], 'account.report_journal', data=data, context=context) # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/wizard/account_vat.py b/addons/account/wizard/account_vat.py index 5cc5c678df1..e7c806be2f9 100644 --- a/addons/account/wizard/account_vat.py +++ b/addons/account/wizard/account_vat.py @@ -61,6 +61,6 @@ class account_vat_declaration(osv.osv_memory): taxcode = taxcode_obj.browse(cr, uid, [taxcode_id], context=context)[0] datas['form']['company_id'] = taxcode.company_id.id - return self.pool['report'].get_action(cr, uid, ids, 'account.report_vat', data=datas, context=context) + return self.pool['report'].get_action(cr, uid, [], 'account.report_vat', data=datas, context=context) # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_analytic_analysis/account_analytic_analysis.py b/addons/account_analytic_analysis/account_analytic_analysis.py index 5aa4b5a49db..6c71f940e8a 100644 --- a/addons/account_analytic_analysis/account_analytic_analysis.py +++ b/addons/account_analytic_analysis/account_analytic_analysis.py @@ -652,12 +652,10 @@ class account_analytic_account(osv.osv): 'nodestroy': True, } - def _prepare_invoice(self, cr, uid, contract, context=None): + def _prepare_invoice_data(self, cr, uid, contract, context=None): context = context or {} - inv_obj = self.pool.get('account.invoice') journal_obj = self.pool.get('account.journal') - fpos_obj = self.pool.get('account.fiscal.position') if not contract.partner_id: raise osv.except_osv(_('No Customer Defined!'),_("You must first select a Customer for Contract %s!") % contract.name ) @@ -678,33 +676,36 @@ class account_analytic_account(osv.osv): elif contract.company_id: currency_id = contract.company_id.currency_id.id - inv_data = { - 'reference': contract.code or False, + invoice = { 'account_id': contract.partner_id.property_account_receivable.id, 'type': 'out_invoice', 'partner_id': contract.partner_id.id, 'currency_id': currency_id, 'journal_id': len(journal_ids) and journal_ids[0] or False, 'date_invoice': contract.recurring_next_date, - 'origin': contract.name, + 'origin': contract.code, 'fiscal_position': fpos and fpos.id, 'payment_term': partner_payment_term, 'company_id': contract.company_id.id or False, } - invoice_id = inv_obj.create(cr, uid, inv_data, context=context) + return invoice + def _prepare_invoice_lines(self, cr, uid, contract, fiscal_position_id, context=None): + fpos_obj = self.pool.get('account.fiscal.position') + fiscal_position = fpos_obj.browse(cr, uid, fiscal_position_id, context=context) + invoice_lines = [] for line in contract.recurring_invoice_line_ids: res = line.product_id account_id = res.property_account_income.id if not account_id: account_id = res.categ_id.property_account_income_categ.id - account_id = fpos_obj.map_account(cr, uid, fpos, account_id) + account_id = fpos_obj.map_account(cr, uid, fiscal_position, account_id) taxes = res.taxes_id or False - tax_id = fpos_obj.map_tax(cr, uid, fpos, taxes) + tax_id = fpos_obj.map_tax(cr, uid, fiscal_position, taxes) - invoice_line_vals = { + invoice_lines.append((0, 0, { 'name': line.name, 'account_id': account_id, 'account_analytic_id': contract.id, @@ -712,13 +713,14 @@ class account_analytic_account(osv.osv): 'quantity': line.quantity, 'uos_id': line.uom_id.id or False, 'product_id': line.product_id.id or False, - 'invoice_id' : invoice_id, 'invoice_line_tax_id': [(6, 0, tax_id)], - } - self.pool.get('account.invoice.line').create(cr, uid, invoice_line_vals, context=context) + })) + return invoice_lines - inv_obj.button_compute(cr, uid, [invoice_id], context=context) - return invoice_id + def _prepare_invoice(self, cr, uid, contract, context=None): + invoice = self._prepare_invoice_data(cr, uid, contract, context=context) + invoice['invoice_line'] = self._prepare_invoice_lines(cr, uid, contract, invoice['fiscal_position'], context=context) + return invoice def recurring_create_invoice(self, cr, uid, ids, context=None): return self._recurring_create_invoice(cr, uid, ids, context=context) @@ -728,6 +730,7 @@ class account_analytic_account(osv.osv): def _recurring_create_invoice(self, cr, uid, ids, automatic=False, context=None): context = context or {} + invoice_ids = [] current_date = time.strftime('%Y-%m-%d') if ids: contract_ids = ids @@ -735,8 +738,8 @@ class account_analytic_account(osv.osv): contract_ids = self.search(cr, uid, [('recurring_next_date','<=', current_date), ('state','=', 'open'), ('recurring_invoices','=', True), ('type', '=', 'contract')]) for contract in self.browse(cr, uid, contract_ids, context=context): try: - invoice_id = self._prepare_invoice(cr, uid, contract, context=context) - + invoice_values = self._prepare_invoice(cr, uid, contract, context=context) + invoice_ids.append(self.pool['account.invoice'].create(cr, uid, invoice_values, context=context)) next_date = datetime.datetime.strptime(contract.recurring_next_date or current_date, "%Y-%m-%d") interval = contract.recurring_interval if contract.recurring_rule_type == 'daily': @@ -754,7 +757,7 @@ class account_analytic_account(osv.osv): _logger.error(traceback.format_exc()) else: raise - return True + return invoice_ids class account_analytic_account_summary_user(osv.osv): _name = "account_analytic_analysis.summary.user" diff --git a/addons/account_analytic_default/account_analytic_default.py b/addons/account_analytic_default/account_analytic_default.py index 563a6a3eb9a..ac8698ae342 100644 --- a/addons/account_analytic_default/account_analytic_default.py +++ b/addons/account_analytic_default/account_analytic_default.py @@ -114,6 +114,16 @@ class sale_order_line(osv.osv): if rec: inv_line_obj.write(cr, uid, [line.id], {'account_analytic_id': rec.analytic_id.id}, context=context) return create_ids - +class product_product(osv.Model): + _inherit = 'product.product' + def _rules_count(self, cr, uid, ids, field_name, arg, context=None): + Analytic = self.pool['account.analytic.default'] + return { + product_id: Analytic.search_count(cr, uid, [('product_id', '=', product_id)], context=context) + for product_id in ids + } + _columns = { + 'rules_count': fields.function(_rules_count, string='# Analytic Rules', type='integer'), + } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_analytic_default/account_analytic_default_view.xml b/addons/account_analytic_default/account_analytic_default_view.xml index 8ff323e45c7..38f51a9ef20 100644 --- a/addons/account_analytic_default/account_analytic_default_view.xml +++ b/addons/account_analytic_default/account_analytic_default_view.xml @@ -80,7 +80,10 @@ - diff --git a/addons/account_analytic_plans/wizard/account_crossovered_analytic.py b/addons/account_analytic_plans/wizard/account_crossovered_analytic.py index ccac123c681..1bdc91f2995 100644 --- a/addons/account_analytic_plans/wizard/account_crossovered_analytic.py +++ b/addons/account_analytic_plans/wizard/account_crossovered_analytic.py @@ -24,6 +24,7 @@ import time from openerp.osv import fields, osv from openerp.tools.translate import _ + class account_crossovered_analytic(osv.osv_memory): _name = "account.crossovered.analytic" _description = "Print Crossovered Analytic" @@ -65,6 +66,6 @@ class account_crossovered_analytic(osv.osv_memory): 'model': 'account.analytic.account', 'form': data } - return self.pool['report'].get_action(cr, uid, ids, 'account_analytic_plans.report_crossoveredanalyticplans', data=datas, context=context) + return self.pool['report'].get_action(cr, uid, [], 'account_analytic_plans.report_crossoveredanalyticplans', data=datas, context=context) # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_asset/account_asset.py b/addons/account_asset/account_asset.py index 7041c3aafbf..0ba7182d0d4 100644 --- a/addons/account_asset/account_asset.py +++ b/addons/account_asset/account_asset.py @@ -237,9 +237,15 @@ class account_asset_asset(osv.osv): if salvage_value: val['value_residual'] = purchase_value - salvage_value return {'value': val} - + def _entry_count(self, cr, uid, ids, field_name, arg, context=None): + MoveLine = self.pool('account.move.line') + return { + asset_id: MoveLine.search_count(cr, uid, [('asset_id', '=', asset_id)], context=context) + for asset_id in ids + } _columns = { 'account_move_line_ids': fields.one2many('account.move.line', 'asset_id', 'Entries', readonly=True, states={'draft':[('readonly',False)]}), + 'entry_count': fields.function(_entry_count, string='# Asset Entries', type='integer'), 'name': fields.char('Asset Name', size=64, required=True, readonly=True, states={'draft':[('readonly',False)]}), 'code': fields.char('Reference', size=32, readonly=True, states={'draft':[('readonly',False)]}), 'purchase_value': fields.float('Gross Value', required=True, readonly=True, states={'draft':[('readonly',False)]}), diff --git a/addons/account_asset/account_asset_view.xml b/addons/account_asset/account_asset_view.xml index fe1fcf473ba..b0a5deacfcb 100644 --- a/addons/account_asset/account_asset_view.xml +++ b/addons/account_asset/account_asset_view.xml @@ -84,7 +84,9 @@
-
-
${object.event_id.get_interval(object.event_id.date, 'dayname')}
+
${object.event_id.get_interval(object.event_id.start, 'dayname')}
- ${object.event_id.get_interval(object.event_id.date,'day')} + ${object.event_id.get_interval(object.event_id.start,'day')}
-
${object.event_id.get_interval(object.event_id.date, 'month')}
-
${not object.event_id.allday and object.event_id.get_interval(object.event_id.date, 'time', tz=object.partner_id.tz) or ''}
+
${object.event_id.get_interval(object.event_id.start, 'month')}
+
${not object.event_id.allday and object.event_id.get_interval(object.event_id.start, 'time', tz=object.partner_id.tz) or ''}
@@ -269,18 +269,18 @@
Dear ${object.cn} ,

The date of the meeting has been changed...
- The meeting created by ${object.event_id.user_id.partner_id.name} is now scheduled for : ${object.event_id.display_time}.

+ The meeting created by ${object.event_id.user_id.partner_id.name} is now scheduled for : ${object.event_id.get_display_time_tz(tz=object.partner_id.tz)}.

-
${object.event_id.get_interval(object.event_id.date, 'dayname')}
+
${object.event_id.get_interval(object.event_id.start, 'dayname')}
- ${object.event_id.get_interval(object.event_id.date,'day')} + ${object.event_id.get_interval(object.event_id.start,'day')}
-
${object.event_id.get_interval(object.event_id.date, 'month')}
-
${not object.event_id.allday and object.event_id.get_interval(object.event_id.date, 'time', tz=object.partner_id.tz) or ''}
+
${object.event_id.get_interval(object.event_id.start, 'month')}
+
${not object.event_id.allday and object.event_id.get_interval(object.event_id.start, 'time', tz=object.partner_id.tz) or ''}
@@ -407,12 +407,12 @@
-
${object.event_id.get_interval(object.event_id.date, 'dayname')}
+
${object.event_id.get_interval(object.event_id.start, 'dayname')}
- ${object.event_id.get_interval(object.event_id.date,'day')} + ${object.event_id.get_interval(object.event_id.start,'day')}
-
${object.event_id.get_interval(object.event_id.date, 'month')}
-
${not object.event_id.allday and object.event_id.get_interval(object.event_id.date, 'time', tz=object.partner_id.tz) or ''}
+
${object.event_id.get_interval(object.event_id.start, 'month')}
+
${not object.event_id.allday and object.event_id.get_interval(object.event_id.start, 'time', tz=object.partner_id.tz) or ''}
diff --git a/addons/calendar/calendar_demo.xml b/addons/calendar/calendar_demo.xml index 4ac308a29c2..09c976a1244 100644 --- a/addons/calendar/calendar_demo.xml +++ b/addons/calendar/calendar_demo.xml @@ -23,22 +23,24 @@ Follow-up for Project proposal Meeting to discuss project plan and hash out the details of implementation. - + - + + open - + Initial discussion Discussion with partner for product. - - + + + draft @@ -49,9 +51,10 @@ Pricing Discussion Internal meeting for discussion for new pricing for product and services. - - + + + open @@ -61,9 +64,10 @@ Requirements review - - + + + open @@ -72,9 +76,9 @@ Changes in Designing - - - + + + open @@ -84,9 +88,10 @@ Presentation for new Services - - + + + draft @@ -96,9 +101,10 @@ Presentation of the new Calendar - - + + + draft diff --git a/addons/calendar/calendar_view.xml b/addons/calendar/calendar_view.xml index 7e1b6a55039..4c17e3e8e70 100644 --- a/addons/calendar/calendar_view.xml +++ b/addons/calendar/calendar_view.xml @@ -9,7 +9,7 @@ Meeting Types Tree calendar.event.type - + @@ -58,24 +58,24 @@ - - - + - + @@ -98,17 +98,17 @@
- +
diff --git a/addons/hr_holidays/hr_holidays.py b/addons/hr_holidays/hr_holidays.py index 932a290b4a1..2385983f020 100644 --- a/addons/hr_holidays/hr_holidays.py +++ b/addons/hr_holidays/hr_holidays.py @@ -367,9 +367,9 @@ class hr_holidays(osv.osv): 'duration': record.number_of_days_temp * 8, 'description': record.notes, 'user_id': record.user_id.id, - 'date': record.date_from, - 'end_date': record.date_to, - 'date_deadline': record.date_to, + 'start': record.date_from, + 'stop': record.date_to, + 'allday': False, 'state': 'open', # to block that meeting date in the calendar 'class': 'confidential' } @@ -549,6 +549,13 @@ class hr_employee(osv.osv): result[holiday.employee_id.id]['current_leave_id'] = holiday.holiday_status_id.id return result + def _leaves_count(self, cr, uid, ids, field_name, arg, context=None): + Holidays = self.pool['hr.holidays'] + return { + employee_id: Holidays.search_count(cr,uid, [('employee_id', '=', employee_id)], context=context) + for employee_id in ids + } + _columns = { 'remaining_leaves': fields.function(_get_remaining_days, string='Remaining Legal Leaves', fnct_inv=_set_remaining_days, type="float", help='Total number of legal leaves allocated to this employee, change this value to create allocation/leave request. Total based on all the leave types without overriding limit.'), 'current_leave_state': fields.function(_get_leave_status, multi="leave_status", string="Current Leave Status", type="selection", @@ -557,6 +564,8 @@ class hr_employee(osv.osv): 'current_leave_id': fields.function(_get_leave_status, multi="leave_status", string="Current Leave Type",type='many2one', relation='hr.holidays.status'), 'leave_date_from': fields.function(_get_leave_status, multi='leave_status', type='date', string='From Date'), 'leave_date_to': fields.function(_get_leave_status, multi='leave_status', type='date', string='To Date'), + 'leaves_count': fields.function(_leaves_count, type='integer', string='Leaves'), + } diff --git a/addons/hr_holidays/hr_holidays_view.xml b/addons/hr_holidays/hr_holidays_view.xml index d4b84bab012..a15a18d20aa 100644 --- a/addons/hr_holidays/hr_holidays_view.xml +++ b/addons/hr_holidays/hr_holidays_view.xml @@ -483,7 +483,13 @@ -
diff --git a/addons/hr_payroll/hr_payroll.py b/addons/hr_payroll/hr_payroll.py index 3c01847f812..1a34758fb50 100644 --- a/addons/hr_payroll/hr_payroll.py +++ b/addons/hr_payroll/hr_payroll.py @@ -258,6 +258,12 @@ class hr_payslip(osv.osv): for r in res: result[r[0]].append(r[1]) return result + + def _count_detail_payslip(self, cr, uid, ids, field_name, arg, context=None): + res = {} + for details in self.browse(cr, uid, ids, context=context): + res[details.id] = len(details.line_ids) + return res _columns = { 'struct_id': fields.many2one('hr.payroll.structure', 'Structure', readonly=True, states={'draft': [('readonly', False)]}, help='Defines the rules that have to be applied to this payslip, accordingly to the contract chosen. If you let empty the field contract, this field isn\'t mandatory anymore and thus the rules applied will be all the rules set on the structure of all contracts of the employee valid for the chosen period'), @@ -276,7 +282,6 @@ class hr_payslip(osv.osv): \n* If the payslip is under verification, the status is \'Waiting\'. \ \n* If the payslip is confirmed then status is set to \'Done\'.\ \n* When user cancel payslip the status is \'Rejected\'.'), -# 'line_ids': fields.one2many('hr.payslip.line', 'slip_id', 'Payslip Line', required=False, readonly=True, states={'draft': [('readonly', False)]}), 'line_ids': one2many_mod2('hr.payslip.line', 'slip_id', 'Payslip Lines', readonly=True, states={'draft':[('readonly',False)]}), 'company_id': fields.many2one('res.company', 'Company', required=False, readonly=True, states={'draft': [('readonly', False)]}), 'worked_days_line_ids': fields.one2many('hr.payslip.worked_days', 'payslip_id', 'Payslip Worked Days', required=False, readonly=True, states={'draft': [('readonly', False)]}), @@ -287,6 +292,7 @@ class hr_payslip(osv.osv): 'details_by_salary_rule_category': fields.function(_get_lines_salary_rule_category, method=True, type='one2many', relation='hr.payslip.line', string='Details by Salary Rule Category'), 'credit_note': fields.boolean('Credit Note', help="Indicates this payslip has a refund of another", readonly=True, states={'draft': [('readonly', False)]}), 'payslip_run_id': fields.many2one('hr.payslip.run', 'Payslip Batches', readonly=True, states={'draft': [('readonly', False)]}), + 'payslip_count': fields.function(_count_detail_payslip, type='integer', string="Payslip Computation Details"), } _defaults = { 'date_from': lambda *a: time.strftime('%Y-%m-01'), @@ -972,9 +978,17 @@ class hr_employee(osv.osv): res[employee.id] = {'basic': result['sum']} return res + def _payslip_count(self, cr, uid, ids, field_name, arg, context=None): + Payslip = self.pool['hr.payslip'] + return { + employee_id: Payslip.search_count(cr,uid, [('employee_id', '=', employee_id)], context=context) + for employee_id in ids + } + _columns = { 'slip_ids':fields.one2many('hr.payslip', 'employee_id', 'Payslips', required=False, readonly=True), 'total_wage': fields.function(_calculate_total_wage, method=True, type='float', string='Total Basic Salary', digits_compute=dp.get_precision('Payroll'), help="Sum of all current contract's wage of employee."), + 'payslip_count': fields.function(_payslip_count, type='integer', string='Payslips'), } diff --git a/addons/hr_payroll/hr_payroll_view.xml b/addons/hr_payroll/hr_payroll_view.xml index 564edf57c02..0f461842355 100644 --- a/addons/hr_payroll/hr_payroll_view.xml +++ b/addons/hr_payroll/hr_payroll_view.xml @@ -222,7 +222,12 @@
-
+
diff --git a/addons/marketing_campaign/marketing_campaign.py b/addons/marketing_campaign/marketing_campaign.py index e434090ad76..142d059e1f9 100644 --- a/addons/marketing_campaign/marketing_campaign.py +++ b/addons/marketing_campaign/marketing_campaign.py @@ -85,6 +85,15 @@ translate_selections = { class marketing_campaign(osv.osv): _name = "marketing.campaign" _description = "Marketing Campaign" + + def _count_segments(self, cr, uid, ids, field_name, arg, context=None): + res = {} + try: + for segments in self.browse(cr, uid, ids, context=context): + res[segments.id] = len(segments.segment_ids) + except: + pass + return res _columns = { 'name': fields.char('Name', size=64, required=True), @@ -121,6 +130,8 @@ Normal - the campaign runs normally and automatically sends all emails and repor 'activity_ids': fields.one2many('marketing.campaign.activity', 'campaign_id', 'Activities'), 'fixed_cost': fields.float('Fixed Cost', help="Fixed cost for running this campaign. You may also specify variable cost and revenue on each campaign activity. Cost and Revenue statistics are included in Campaign Reporting.", digits_compute=dp.get_precision('Product Price')), + 'segment_ids': fields.one2many('marketing.campaign.segment', 'campaign_id', 'Segments', readonly=False), + 'segments_count': fields.function(_count_segments, type='integer', string='Segments') } _defaults = { diff --git a/addons/marketing_campaign/marketing_campaign_view.xml b/addons/marketing_campaign/marketing_campaign_view.xml index 6503cc482ab..dc4d989ee5b 100644 --- a/addons/marketing_campaign/marketing_campaign_view.xml +++ b/addons/marketing_campaign/marketing_campaign_view.xml @@ -64,12 +64,21 @@
diff --git a/addons/mass_mailing/views/mass_mailing.xml b/addons/mass_mailing/views/mass_mailing.xml index 82c4cdad54d..a9cd33f9531 100644 --- a/addons/mass_mailing/views/mass_mailing.xml +++ b/addons/mass_mailing/views/mass_mailing.xml @@ -222,12 +222,11 @@
-
- -
+ diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index 42064718088..af1d54399f1 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -1114,8 +1114,22 @@ class mrp_production_product_line(osv.osv): class product_product(osv.osv): _inherit = "product.product" + def _bom_orders_count(self, cr, uid, ids, field_name, arg, context=None): + Bom = self.pool('mrp.bom') + Production = self.pool('mrp.production') + return { + product_id: { + 'bom_count': Bom.search_count(cr, uid, [('product_id', '=', product_id), ('bom_id', '=', False)], context=context), + 'mo_count': Production.search_count(cr,uid, [('product_id', '=', product_id)], context=context), + 'bom_strct': Bom.search_count(cr, uid, [('product_id', '=', product_id), ('bom_id', '=', False)], context=context), + } + for product_id in ids + } _columns = { 'bom_ids': fields.one2many('mrp.bom', 'product_id', 'Bill of Materials'), + 'bom_count': fields.function(_bom_orders_count, string='# Bill of Material', type='integer', multi="_bom_order_count"), + 'bom_strct': fields.function(_bom_orders_count, string='# Bill of Material Structure', type='integer', multi="_bom_order_count"), + 'mo_count': fields.function(_bom_orders_count, string='# Manufacturing Orders', type='integer', multi="_bom_order_count"), } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/mrp/mrp_view.xml b/addons/mrp/mrp_view.xml index 72b5fc845c6..aaffc6f440c 100644 --- a/addons/mrp/mrp_view.xml +++ b/addons/mrp/mrp_view.xml @@ -1052,9 +1052,18 @@ - + + diff --git a/addons/multi_company/multi_company_demo.xml b/addons/multi_company/multi_company_demo.xml index aa9d414020f..3dad9fcaaf6 100644 --- a/addons/multi_company/multi_company_demo.xml +++ b/addons/multi_company/multi_company_demo.xml @@ -59,7 +59,7 @@ - + OpenERP US @@ -399,7 +399,7 @@ - + diff --git a/addons/point_of_sale/controllers/main.py b/addons/point_of_sale/controllers/main.py index 376ab4478b2..3cd10993d07 100644 --- a/addons/point_of_sale/controllers/main.py +++ b/addons/point_of_sale/controllers/main.py @@ -8,7 +8,7 @@ import random from openerp import http from openerp.http import request -from openerp.addons.web.controllers.main import manifest_list, module_boot, html_template, login_redirect +from openerp.addons.web.controllers.main import module_boot, login_redirect _logger = logging.getLogger(__name__) diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py index f6d40a81449..98cde818341 100644 --- a/addons/point_of_sale/point_of_sale.py +++ b/addons/point_of_sale/point_of_sale.py @@ -1198,8 +1198,8 @@ class pos_order(osv.osv): return self.write(cr, uid, ids, {'state': 'payment'}, context=context) def action_paid(self, cr, uid, ids, context=None): - self.create_picking(cr, uid, ids, context=context) self.write(cr, uid, ids, {'state': 'paid'}, context=context) + self.create_picking(cr, uid, ids, context=context) return True def action_cancel(self, cr, uid, ids, context=None): diff --git a/addons/point_of_sale/point_of_sale_view.xml b/addons/point_of_sale/point_of_sale_view.xml index 0adb86ed31a..dc8a5850e65 100644 --- a/addons/point_of_sale/point_of_sale_view.xml +++ b/addons/point_of_sale/point_of_sale_view.xml @@ -715,8 +715,14 @@
- +

Session: diff --git a/addons/project/i18n/pt.po b/addons/project/i18n/pt.po index 4327f319170..cf2fe8ac199 100644 --- a/addons/project/i18n/pt.po +++ b/addons/project/i18n/pt.po @@ -7,14 +7,14 @@ msgstr "" "Project-Id-Version: OpenERP Server 6.0dev\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2012-12-21 17:04+0000\n" -"PO-Revision-Date: 2012-11-26 10:00+0000\n" +"PO-Revision-Date: 2014-05-06 16:37+0000\n" "Last-Translator: Daniel Reis \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-04-22 05:54+0000\n" -"X-Generator: Launchpad (build 16985)\n" +"X-Launchpad-Export-Date: 2014-05-07 06:26+0000\n" +"X-Generator: Launchpad (build 16996)\n" #. module: project #: view:project.project:0 @@ -53,17 +53,17 @@ msgstr "Tarefas do Projeto" #. module: project #: field:project.task.type,name:0 msgid "Stage Name" -msgstr "Nome estágio" +msgstr "Nome da Etapa" #. module: project #: model:process.transition.action,name:project.process_transition_action_openpendingtask0 msgid "Set pending" -msgstr "Definir como pendente" +msgstr "Marcar como pendente" #. module: project #: view:project.project:0 msgid "New Project Based on Template" -msgstr "Novo Projeto Baseado num Template" +msgstr "Novo Projeto baseado num Template" #. module: project #: view:report.project.task.user:0 @@ -741,7 +741,7 @@ msgstr "Diversos" #: field:project.task.history,type_id:0 #: field:project.task.history.cumulative,type_id:0 msgid "Stage" -msgstr "Fase" +msgstr "Etapa" #. module: project #: model:process.transition,name:project.process_transition_draftopentask0 @@ -766,7 +766,7 @@ msgstr "O meu Painel" #. module: project #: model:ir.actions.act_window,name:project.open_task_type_form msgid "Stages" -msgstr "Fases" +msgstr "Etapas" #. module: project #: view:project.project:0 @@ -967,7 +967,7 @@ msgstr "Utilizadores" #. module: project #: model:mail.message.subtype,name:project.mt_task_stage msgid "Stage Changed" -msgstr "" +msgstr "Etapa mudou" #. module: project #: view:project.project:0 @@ -999,7 +999,7 @@ msgstr "Reavaliar a tarefa" #: model:ir.model,name:project.model_project_task_type #: view:project.task.type:0 msgid "Task Stage" -msgstr "Fase Tarefas" +msgstr "Etapa da Tarefa" #. module: project #: view:project.task.type:0 @@ -1089,7 +1089,7 @@ msgstr "Abrir tarefa" #. module: project #: view:project.task.type:0 msgid "Stages common to all projects" -msgstr "Fases comuns a todos os projetos" +msgstr "Etapas comuns a todos os projetos" #. module: project #: model:process.node,name:project.process_node_drafttask0 @@ -1141,6 +1141,9 @@ msgid "" "stage. For example, if a stage is related to the status 'Close', when your " "document reaches this stage, it is automatically closed." msgstr "" +"O Estado do seu documento é automaticamente atualizado de acordo com a sua " +"Etapa. Por exemplo, se à Etapa corresponder o Estado 'Fechado', quando o seu " +"documento chegar a essa etapa ele é automaticamente fechado." #. module: project #: view:project.task:0 @@ -1213,7 +1216,7 @@ msgstr "%s (cópia)" #. module: project #: model:mail.message.subtype,name:project.mt_project_task_stage msgid "Task Stage Changed" -msgstr "" +msgstr "Etapa da tarefa mudou" #. module: project #: view:project.task:0 @@ -1463,7 +1466,7 @@ msgstr "Horas Restantes" #. module: project #: model:mail.message.subtype,description:project.mt_task_stage msgid "Stage changed" -msgstr "" +msgstr "Etapa mudou" #. module: project #: constraint:project.task:0 @@ -1589,6 +1592,8 @@ msgid "" "This stage is not visible, for example in status bar or kanban view, when " "there are no records in that stage to display." msgstr "" +"Esta Etapa não é visível, por exemplo na barra de estado ou na vista kanban, " +"quando não existirem registos a exibir nessa Etapa." #. module: project #: view:project.task:0 @@ -2021,7 +2026,7 @@ msgstr "Projetos em que eu sou gestor" #: selection:project.task.history,kanban_state:0 #: selection:project.task.history.cumulative,kanban_state:0 msgid "Ready for next stage" -msgstr "" +msgstr "Pronto para avançar" #. module: project #: field:project.task.type,case_default:0 @@ -2046,8 +2051,8 @@ msgid "" "If you check this field, this stage will be proposed by default on each new " "project. It will not assign this stage to existing projects." msgstr "" -"Se verificar neste campo, esta fase será proposta por omissão em cada " -"projeto novo. Não vai atribuir nesta fase, os projetos existentes." +"Se marcar este campo, esta Etapa fará parte das predefinidas em novos " +"projetos. Não irá afetar as Etapas dos projetos já existentes." #. module: project #: field:project.task,partner_id:0 @@ -2143,7 +2148,7 @@ msgstr "Ano" #: field:project.project,type_ids:0 #: view:project.task.type:0 msgid "Tasks Stages" -msgstr "Estágios da tarefa" +msgstr "Etapas das Tarefas" #~ msgid "Close Task" #~ msgstr "Fechar a Tarefa" diff --git a/addons/project/project.py b/addons/project/project.py index 5c6143148d4..e074d241cef 100644 --- a/addons/project/project.py +++ b/addons/project/project.py @@ -186,20 +186,11 @@ class project(osv.osv): task_attachments = attachment.search(cr, uid, [('res_model', '=', 'project.task'), ('res_id', 'in', task_ids)], context=context, count=True) res[id] = (project_attachments or 0) + (task_attachments or 0) return res - def _task_count(self, cr, uid, ids, field_name, arg, context=None): - """ :deprecated: this method will be removed with OpenERP v8. Use task_ids - fields instead. """ - if context is None: - context = {} - res = dict.fromkeys(ids, 0) - ctx = context.copy() - ctx['active_test'] = False - task_ids = self.pool.get('project.task').search(cr, uid, [('project_id', 'in', ids)], context=ctx) - for task in self.pool.get('project.task').browse(cr, uid, task_ids, context): - res[task.project_id.id] += 1 + res={} + for tasks in self.browse(cr, uid, ids, context): + res[tasks.id] = len(tasks.task_ids) return res - def _get_alias_models(self, cr, uid, context=None): """ Overriden in project_issue to offer more options """ return [('project.task', "Tasks")] @@ -265,8 +256,7 @@ class project(osv.osv): }), 'resource_calendar_id': fields.many2one('resource.calendar', 'Working Time', help="Timetable working hours to adjust the gantt diagram report", states={'close':[('readonly',True)]} ), 'type_ids': fields.many2many('project.task.type', 'project_task_type_rel', 'project_id', 'type_id', 'Tasks Stages', states={'close':[('readonly',True)], 'cancelled':[('readonly',True)]}), - 'task_count': fields.function(_task_count, type='integer', string="Open Tasks", - deprecated="This field will be removed in OpenERP v8. Use task_ids one2many field instead."), + 'task_count': fields.function(_task_count, type='integer', string="Tasks",), 'task_ids': fields.one2many('project.task', 'project_id', domain=[('stage_id.fold', '=', False)]), 'color': fields.integer('Color Index'), diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml index 3ee673a4d2f..5bd669cb14f 100644 --- a/addons/project/project_view.xml +++ b/addons/project/project_view.xml @@ -93,21 +93,26 @@
- - +
- + + - +

To invoice or setup invoicing and renewal options, go to the related contract: .

-
- + @@ -498,7 +499,10 @@ - diff --git a/addons/sale_crm/i18n/pt.po b/addons/sale_crm/i18n/pt.po index 3722f919c1f..9b512317f31 100644 --- a/addons/sale_crm/i18n/pt.po +++ b/addons/sale_crm/i18n/pt.po @@ -7,14 +7,14 @@ msgstr "" "Project-Id-Version: OpenERP Server 6.0dev\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2012-12-21 17:06+0000\n" -"PO-Revision-Date: 2010-12-04 10:03+0000\n" -"Last-Translator: OpenERP Administrators \n" +"PO-Revision-Date: 2014-05-06 16:19+0000\n" +"Last-Translator: Daniel Reis \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-04-22 06:25+0000\n" -"X-Generator: Launchpad (build 16985)\n" +"X-Launchpad-Export-Date: 2014-05-07 06:26+0000\n" +"X-Generator: Launchpad (build 16996)\n" #. module: sale_crm #: code:addons/sale_crm/wizard/crm_make_sale.py:92 @@ -41,7 +41,7 @@ msgstr "Marcar como ganha" #. module: sale_crm #: field:res.users,default_section_id:0 msgid "Default Sales Team" -msgstr "Equipa de Vendas por Omissão" +msgstr "Equipa de Vendas predefinida" #. module: sale_crm #: view:sale.order:0 @@ -95,7 +95,7 @@ msgstr "Vendas feitas" #. module: sale_crm #: model:ir.model,name:sale_crm.model_account_invoice msgid "Invoice" -msgstr "Factura" +msgstr "Fatura" #. module: sale_crm #: code:addons/sale_crm/wizard/crm_make_sale.py:95 diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 754188ed5ad..36f34c3ec72 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -3996,14 +3996,14 @@ class stock_warehouse_orderpoint(osv.osv): ] def default_get(self, cr, uid, fields, context=None): + warehouse_obj = self.pool.get('stock.warehouse') res = super(stock_warehouse_orderpoint, self).default_get(cr, uid, fields, context) # default 'warehouse_id' and 'location_id' if 'warehouse_id' not in res: - warehouse = self.pool.get('ir.model.data').get_object(cr, uid, 'stock', 'warehouse0', context) - res['warehouse_id'] = warehouse.id + warehouse_ids = res.get('company_id') and warehouse_obj.search(cr, uid, [('company_id', '=', res['company_id'])], limit=1, context=context) or [] + res['warehouse_id'] = warehouse_ids and warehouse_ids[0] or False if 'location_id' not in res: - warehouse = self.pool.get('stock.warehouse').browse(cr, uid, res['warehouse_id'], context) - res['location_id'] = warehouse.lot_stock_id.id + res['location_id'] = res.get('warehouse_id') and warehouse_obj.browse(cr, uid, res['warehouse_id'], context).lot_stock_id.id or False return res def onchange_warehouse_id(self, cr, uid, ids, warehouse_id, context=None): diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml index 21c91742f12..46da83a89de 100644 --- a/addons/stock/stock_view.xml +++ b/addons/stock/stock_view.xml @@ -195,7 +195,7 @@
-