From 9c5ed7e65193c1559afcb571a8c5537e284afe59 Mon Sep 17 00:00:00 2001 From: "psi (Open ERP)" Date: Tue, 22 Jun 2010 17:32:39 +0530 Subject: [PATCH 1/4] [IMP] account_*: Add access rules for objects bzr revid: psi@tinyerp.co.in-20100622120239-47am8qutea8fuxxi --- addons/account_analytic_plans/security/ir.model.access.csv | 4 ++++ addons/account_budget/security/ir.model.access.csv | 5 +++++ addons/account_followup/security/ir.model.access.csv | 4 ++++ addons/account_invoice_layout/security/ir.model.access.csv | 5 +++-- addons/account_payment/security/ir.model.access.csv | 3 +++ addons/account_report/security/ir.model.access.csv | 2 ++ addons/account_reporting/security/ir.model.access.csv | 7 ++++--- addons/account_voucher/security/ir.model.access.csv | 3 ++- 8 files changed, 27 insertions(+), 6 deletions(-) diff --git a/addons/account_analytic_plans/security/ir.model.access.csv b/addons/account_analytic_plans/security/ir.model.access.csv index f7f141ac15a..b6772ff5989 100644 --- a/addons/account_analytic_plans/security/ir.model.access.csv +++ b/addons/account_analytic_plans/security/ir.model.access.csv @@ -4,5 +4,9 @@ "access_account_analytic_plan_instance","account.analytic.plan.instance","model_account_analytic_plan_instance","account.group_account_user",1,1,1,1 "access_account_analytic_plan_instance_line","account.analytic.plan.instance.line","model_account_analytic_plan_instance_line","account.group_account_user",1,1,1,1 "access_account_analytic_plan_line_invoice","account.analytic.plan.line.invoice","model_account_analytic_plan_line","account.group_account_user",1,1,1,1 +"access_account_analytic_plan_create_model","access.account.analytic.plan.create.model","model_analytic_plan_create_model","account.group_account_user",1,1,1,1 +"access_account_crossovered_analytic","access.account.crossovered.analytic","model_account_crossovered_analytic","account.group_account_user",1,1,1,1 "access_account_analytic_plan_instance_manager","account.analytic.plan.instance manager","model_account_analytic_plan_instance","account.group_account_manager",1,1,1,1 "access_account_analytic_plan_instance_line_manager","account.analytic.plan.instance.line manager","model_account_analytic_plan_instance_line","account.group_account_manager",1,1,1,1 +"access_account_analytic_plan_create_model_manager","access.account.analytic.plan.create.mode.manager","model_analytic_plan_create_model","account.group_account_manager",1,1,1,1 +"access_account_crossovered_analytic_manager","access.account.crossovered.analytic.manageraccess.account.crossovered.analytic.manager","model_account_crossovered_analytic","account.group_account_manager",1,1,1,1 diff --git a/addons/account_budget/security/ir.model.access.csv b/addons/account_budget/security/ir.model.access.csv index 682a2ea3783..3676b45c973 100644 --- a/addons/account_budget/security/ir.model.access.csv +++ b/addons/account_budget/security/ir.model.access.csv @@ -3,3 +3,8 @@ "access_crossovered_budget_lines","crossovered.budget.lines","model_crossovered_budget_lines","account.group_account_manager",1,1,1,1 "access_account_budget_post","account.budget.post","model_account_budget_post","account.group_account_manager",1,1,1,1 "access_account_budget_post_dotation","account.budget.post.dotation","model_account_budget_post_dotation","account.group_account_manager",1,1,1,1 +"access_account_budget_crossvered_report","account.budget.crossvered.report","model_account_budget_crossvered_report","account.group_account_manager",1,1,1,1 +"access_account_budget_analytic","account.budget.analytic","model_account_budget_analytic","account.group_account_manager",1,1,1,1 +"access_account_budget_crossvered_summary_report","account.budget.crossvered.summary.report","model_account_budget_crossvered_summary_report","account.group_account_manager",1,1,1,1 +"access_account_budget_spread","account.budget.spread","model_account_budget_spread","account.group_account_manager",1,1,1,1 +"access_account_budget_report","account.budget.report","model_account_budget_report","account.group_account_manager",1,1,1,1 diff --git a/addons/account_followup/security/ir.model.access.csv b/addons/account_followup/security/ir.model.access.csv index 85a5f888c5a..71279b72cd7 100644 --- a/addons/account_followup/security/ir.model.access.csv +++ b/addons/account_followup/security/ir.model.access.csv @@ -2,6 +2,10 @@ "access_account_followup_stat","account_followup.stat","model_account_followup_stat","account.group_account_user",1,0,0,0 "access_account_followup_followup","account_followup.followup","model_account_followup_followup","account.group_account_user",1,0,0,0 "access_account_followup_followup_line","account_followup.followup.line","model_account_followup_followup_line","account.group_account_user",1,0,0,0 +"access_account_followup_print","account_followup.print","model_account_followup_print","account.group_account_user",1,0,0,0 +"access_account_followup_print_all","account_followup.print.all","model_account_followup_print_all","account.group_account_user",1,0,0,0 "access_account_followup_stat_manager","account_followup.stat.manager","model_account_followup_stat","account.group_account_manager",1,1,1,1 "access_account_followup_followup_manager","account_followup.followup.manager","model_account_followup_followup","account.group_account_manager",1,1,1,1 "access_account_followup_followup_line_manager","account_followup.followup.line.manager","model_account_followup_followup_line","account.group_account_manager",1,1,1,1 +"access_account_followup_print_manager","account_followup.print.manager","model_account_followup_print","account.group_account_manager",1,1,1,1 +"access_account_followup_print_all_manager","account_followup.print.all.manager","model_account_followup_print_all","account.group_account_manager",1,1,1,1 diff --git a/addons/account_invoice_layout/security/ir.model.access.csv b/addons/account_invoice_layout/security/ir.model.access.csv index c838392e6eb..d4399e9ec55 100644 --- a/addons/account_invoice_layout/security/ir.model.access.csv +++ b/addons/account_invoice_layout/security/ir.model.access.csv @@ -1,2 +1,3 @@ -id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink -access_notify_message,notify.message,model_notify_message,account.group_account_invoice,1,1,1,1 +"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" +"access_notify_message","notify.message","model_notify_message","account.group_account_invoice",1,1,1,1 +"access_account_invoice_special_msg","account.invoice.special.msg","model_account_invoice_special_msg","account.group_account_invoice",1,1,1,1 diff --git a/addons/account_payment/security/ir.model.access.csv b/addons/account_payment/security/ir.model.access.csv index 09ee2170239..c463ddbf054 100644 --- a/addons/account_payment/security/ir.model.access.csv +++ b/addons/account_payment/security/ir.model.access.csv @@ -6,3 +6,6 @@ "access_account_journal_payement","account.journal payment","account.model_account_journal","group_account_payment",1,0,0,0 "access_account_invoice_payment","account.invoice payment","account.model_account_invoice","group_account_payment",1,0,0,0 "access_account_move_line_payment","account.move.line payment","account.model_account_move_line","group_account_payment",1,0,0,0 +"access_payment_order_create","payment.order.create","model_payment_order_create","group_account_payment",1,1,1,1 +"access_account_payment_populate_statement","account.payment.populate.statement","model_account_payment_populate_statement","group_account_payment",1,1,1,1 +"access_account_payment_make_payment","account.payment.make.payment","model_account_payment_make_payment","group_account_payment",1,1,1,1 diff --git a/addons/account_report/security/ir.model.access.csv b/addons/account_report/security/ir.model.access.csv index ace4bc06db0..a89764ee223 100644 --- a/addons/account_report/security/ir.model.access.csv +++ b/addons/account_report/security/ir.model.access.csv @@ -1,3 +1,5 @@ "id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" "access_account_report_report","account.report.report","model_account_report_report","account.group_account_manager",1,0,0,0 "access_account_report_history","account.report.history","model_account_report_history","account.group_account_manager",1,0,0,0 +"access_account_report_print_indicators","account.report.print.indicators","model_account_report_print_indicators","account.group_account_manager",1,0,0,0 +"access_account_report_print_indicators_with_pdf","account.report.print.indicators.with.pdf","model_account_report_print_indicators_with_pdf","account.group_account_manager",1,0,0,0 diff --git a/addons/account_reporting/security/ir.model.access.csv b/addons/account_reporting/security/ir.model.access.csv index 78dfe260864..56f5165921e 100644 --- a/addons/account_reporting/security/ir.model.access.csv +++ b/addons/account_reporting/security/ir.model.access.csv @@ -1,3 +1,4 @@ -id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink -access_color_rml,color.rml,model_color_rml,account.group_account_manager,1,1,1,1 -access_account_report_bs,account.report.bs,model_account_report_bs,account.group_account_manager,1,1,1,1 +"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" +"access_color_rml","color.rml","model_color_rml","account.group_account_manager",1,1,1,1 +"access_account_report_bs","account.report.bs","model_account_report_bs","account.group_account_manager",1,1,1,1 +"access_account_reporting_balance_report","account.reporting.balance.report","model_account_reporting_balance_report","account.group_account_manager",1,1,1,1 diff --git a/addons/account_voucher/security/ir.model.access.csv b/addons/account_voucher/security/ir.model.access.csv index b4203be5416..1291eeb4092 100644 --- a/addons/account_voucher/security/ir.model.access.csv +++ b/addons/account_voucher/security/ir.model.access.csv @@ -1,6 +1,7 @@ "id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" "access_account_voucher_user","account.voucher","model_account_voucher","account.group_account_user",1,0,0,0 "access_account_voucher_line_user","account.voucher.line","model_account_voucher_line","account.group_account_user",1,0,0,0 +"access_account_open_voucher_user","account.open.voucher","model_account_open_voucher","account.group_account_user",1,0,0,0 "access_account_voucher_manager","account.voucher","model_account_voucher","account.group_account_manager",1,1,1,1 "access_account_voucher_line_manager","account.voucher.line","model_account_voucher_line","account.group_account_manager",1,1,1,1 - +"access_account_open_voucher_manager","account.open.voucher","model_account_open_voucher","account.group_account_manager",1,1,1,1 From 9359124805bdf0fcc385b8891f56e13e18235ef4 Mon Sep 17 00:00:00 2001 From: "psi (Open ERP)" Date: Wed, 23 Jun 2010 12:33:42 +0530 Subject: [PATCH 2/4] [IMP] account: Add Access rules for objects bzr revid: psi@tinyerp.co.in-20100623070342-k4hmpxn26k1x84k4 --- addons/account/security/ir.model.access.csv | 42 +++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/addons/account/security/ir.model.access.csv b/addons/account/security/ir.model.access.csv index 826e2076033..82c7dd0185d 100644 --- a/addons/account/security/ir.model.access.csv +++ b/addons/account/security/ir.model.access.csv @@ -93,6 +93,10 @@ "access_report_account_type_sales","report.account_type.sales","model_report_account_type_sales","account.group_account_manager",1,0,0,0 "access_report_account_sales","report.account.sales","model_report_account_sales","account.group_account_manager",1,0,0,0 "access_account_invoice_report","account.invoice.report","model_account_invoice_report","account.group_account_manager",1,0,0,0 +"access_analytic_report_manager","analytic.report","model_analytic_report","account.group_account_manager",1,0,0,0 +"access_account_account_report_manager","account.account.report","model_account_account_report","account.group_account_manager",1,0,0,0 +"access_account_entries_report_manager","account.entries.report","model_account_entries_report","account.group_account_manager",1,0,0,0 +"access_analytic_entries_report_manager","analytic.entries.report","model_analytic_entries_report","account.group_account_manager",1,0,0,0 "access_project_account_analytic_line","project.account.analytic.line","model_project_account_analytic_line","account.group_account_manager",1,1,1,1 "access_account_move_line_reconcile_select","account.move.line.reconcile.select","model_account_move_line_reconcile_select","account.group_account_manager",1,1,1,1 "access_account_move_line_unreconcile_select","account.move.line.unreconcile.select","model_account_move_line_unreconcile_select","account.group_account_manager",1,1,1,1 @@ -103,3 +107,41 @@ "access_account_period_close","account.period.close","model_account_period_close","account.group_account_manager",1,1,1,1 "access_account_fiscalyear_close_state","account.fiscalyear.close.state","model_account_fiscalyear_close_state","account.group_account_manager",1,1,1,1 "access_account_chart","account.chart","model_account_chart","account.group_account_manager",1,1,1,1 +"access_account_analytic_Journal_report_manager","account.analytic.Journal.report","model_account_analytic_Journal_report","account.group_account_manager",1,1,1,1 +"access_account_analytic_balance_manager","account.analytic.balance","model_account_analytic_balance","account.group_account_manager",1,1,1,1 +"access_account_analytic_inverted_balance_manager","account.analytic.inverted.balance","model_account_analytic_inverted_balance","account.group_account_manager",1,1,1,1 +"access_account_analytic_cost_ledger_manager","account.analytic.cost.ledger","model_account_analytic_cost_ledger","account.group_account_manager",1,1,1,1 +"access_account_analytic_cost_ledger_journal_report_manager","account.analytic.cost.ledger.journal.report","model_account_analytic_cost_ledger_journal_report","account.group_account_manager",1,1,1,1 +"access_account_analytic_check_manager","account.analytic.check","model_account_analytic_check","account.group_account_manager",1,1,1,1 +"access_account_analytic_chart_manager","account.analytic.chart","model_account_analytic_chart","account.group_account_manager",1,1,1,1 +"access_account_automatic_reconcile_manager","account.automatic.reconcile","model_account_automatic_reconcile","account.group_account_manager",1,1,1,1 +"access_account_partner_reconcile_process_manager","account.partner.reconcile.process","model_account_partner_reconcile_process","account.group_account_manager",1,1,1,1 +"access_account_move_line_reconcile_manager","account.move.line.reconcile","model_account_move_line_reconcile","account.group_account_manager",1,1,1,1 +"access_account_move_line_reconcile_writeoff_manager","account.move.line.reconcile.writeoff","model_account_move_line_reconcile_writeoff","account.group_account_manager",1,1,1,1 +"access_account_unreconcile_manager","account.unreconcile","model_account_unreconcile","account.group_account_manager",1,1,1,1 +"access_account_unreconcile_reconcile_manager","account.unreconcile.reconcile","model_account_unreconcile_reconcile","account.group_account_manager",1,1,1,1 +"access_account_invoice_pay_writeoff_manager","account.invoice.pay.writeoff","model_account_invoice_pay_writeoff","account.group_account_manager",1,1,1,1 +"access_account_invoice_pay_manager","account.invoice.pay","model_account_invoice_pay","account.group_account_manager",1,1,1,1 +"access_account_journal_select_manager","account.journal.select","model_account_journal_select","account.group_account_manager",1,1,1,1 +"access_account_aged_trial_balance_manager","account.aged.trial.balance","model_account_aged_trial_balance","account.group_account_manager",1,1,1,1 +"access_account_general_ledger_report_manager","account.general.ledger.report","model_account_general_ledger_report","account.group_account_manager",1,1,1,1 +"access_account_partner_ledger_manager","account.partner.ledger","model_account_partner_ledger","account.group_account_manager",1,1,1,1 +"access_account_partner_balance_manager","account.partner.balance","model_account_partner_balance","account.group_account_manager",1,1,1,1 +"access_account_balance_report_manager","account.balance.report","model_account_balance_report","account.group_account_manager",1,1,1,1 +"access_account_fiscalyear_close_manager","account.fiscalyear.close","model_account_fiscalyear_close","account.group_account_manager",1,1,1,1 +"access_account_vat_declaration_manager","account.vat.declaration","model_account_vat_declaration","account.group_account_manager",1,1,1,1 +"access_account_open_closed_fiscalyear_manager","account.open.closed.fiscalyear","model_account_open_closed_fiscalyear","account.group_account_manager",1,1,1,1 +"access_account_compare_account_balance_report_manager","account.compare.account.balance.report","model_account_compare_account_balance_report","account.group_account_manager",1,1,1,1 +"access_account_invoice_confirm_manager","account.invoice.confirm","model_account_invoice_confirm","account.group_account_manager",1,1,1,1 +"access_account_invoice_cancel_manager","account.invoice.cancel","model_account_invoice_cancel","account.group_account_manager",1,1,1,1 +"access_account_move_line_select_manager","account.move.line.select","model_account_move_line_select","account.group_account_manager",1,1,1,1 +"access_validate_account_move_manager","validate.account.move","model_validate_account_move","account.group_account_manager",1,1,1,1 +"access_validate_account_move_lines_manager","validate.account.move.lines","model_validate_account_move_lines","account.group_account_manager",1,1,1,1 +"access_account_use_model_manager","account.use.model","model_account_use_model","account.group_account_manager",1,1,1,1 +"access_account_state_open_manager","account.state.open","model_account_state_open","account.group_account_manager",1,1,1,1 +"access_account_statement_from_invoice_lines_manager","account.statement.from.invoice.lines","model_account_statement_from_invoice_lines","account.group_account_manager",1,1,1,1 +"access_account_statement_from_invoice_manager","account.statement.from.invoice","model_account_statement_from_invoice","account.group_account_manager",1,1,1,1 +"access_account_print_journal_manager","account.print.journal","model_account_print_journal","account.group_account_manager",1,1,1,1 +"access_account_central_journal_manager","account.central.journal","model_account_central_journal","account.group_account_manager",1,1,1,1 +"access_account_general_journal_manager","account.general.journal","model_account_general_journal","account.group_account_manager",1,1,1,1 +"access_account_change_currency_manager","account.change.currency","model_account_change_currency","account.group_account_manager",1,1,1,1 From 3986152f96b41b7506363872c661fa852f40fec8 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Wed, 23 Jun 2010 09:10:27 +0200 Subject: [PATCH 3/4] [FIX] fixes just introduced in account module bzr revid: fp@tinyerp.com-20100623071027-3ot1sk839frbwlzz --- addons/account/account_view.xml | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index 6526befb3d5..dd0fa276c41 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -695,21 +695,6 @@ - - Journal Entries - account.move - form - tree,form - - - - - @@ -914,7 +899,6 @@ - account.move.form account.move @@ -1970,5 +1954,22 @@ id="menu_action_account_fiscal_position_form_template" parent="account_template_folder" sequence="20"/> + + Journal Entries + account.move + form + tree,form + + + + + + + From db18b214bee1a9fc7643413ece517ecc93e23bbc Mon Sep 17 00:00:00 2001 From: Mustufa Rangwala Date: Wed, 23 Jun 2010 12:53:38 +0530 Subject: [PATCH 4/4] [REF] purchase bzr revid: mra@mra-laptop-20100623072338-1vtj84fa21qdsefd --- addons/purchase/purchase.py | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index cd07e82ce80..535c8dffe83 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -20,18 +20,16 @@ ############################################################################## from mx import DateTime -from osv import fields -from osv import osv import time -import netsvc - -import ir from datetime import datetime from dateutil.relativedelta import relativedelta + +from osv import osv, fields +import netsvc +import ir import pooler from tools import config from tools.translate import _ - import decimal_precision as dp from osv.orm import browse_record, browse_null @@ -67,7 +65,7 @@ class purchase_order(osv.osv): res[order.id]['amount_total']=res[order.id]['amount_untaxed'] + res[order.id]['amount_tax'] return res - def _set_minimum_planned_date(self, cr, uid, ids, name, value, arg, context): + def _set_minimum_planned_date(self, cr, uid, ids, name, value, arg, context=None): if not value: return False if type(ids)!=type([]): ids=[ids] @@ -79,7 +77,7 @@ class purchase_order(osv.osv): (date_planned=%s or date_planned<%s)""", (value,po.id,po.minimum_planned_date,value)) return True - def _minimum_planned_date(self, cr, uid, ids, field_name, arg, context): + def _minimum_planned_date(self, cr, uid, ids, field_name, arg, context=None): res={} purchase_obj=self.browse(cr, uid, ids, context=context) for purchase in purchase_obj: @@ -132,7 +130,7 @@ class purchase_order(osv.osv): res[r] = 100.0 * res[r][0] / res[r][1] return res - def _get_order(self, cr, uid, ids, context={}): + def _get_order(self, cr, uid, ids, context=None): result = {} for line in self.pool.get('purchase.order.line').browse(cr, uid, ids, context=context): result[line.order_id.id] = True @@ -201,12 +199,12 @@ class purchase_order(osv.osv): 'company_id': fields.many2one('res.company','Company',required=True,select=1), } _defaults = { - 'date_order': lambda *a: time.strftime('%Y-%m-%d'), - 'state': lambda *a: 'draft', + 'date_order': time.strftime('%Y-%m-%d'), + 'state': 'draft', 'name': lambda obj, cr, uid, context: obj.pool.get('ir.sequence').get(cr, uid, 'purchase.order'), - 'shipped': lambda *a: 0, - 'invoice_method': lambda *a: 'order', - 'invoiced': lambda *a: 0, + 'shipped': 0, + 'invoice_method': 'order', + 'invoiced': 0, 'partner_address_id': lambda self, cr, uid, context: context.get('partner_id', False) and self.pool.get('res.partner').address_get(cr, uid, [context['partner_id']], ['default'])['default'], 'pricelist_id': lambda self, cr, uid, context: context.get('partner_id', False) and self.pool.get('res.partner').browse(cr, uid, context['partner_id']).property_product_pricelist_purchase.id, 'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'purchase.order', context=c), @@ -629,6 +627,7 @@ class purchase_order_line(osv.osv): _table = 'purchase_order_line' _name = 'purchase.order.line' _description = 'Purchase Order Line' + def copy_data(self, cr, uid, id, default=None,context={}): if not default: default = {} @@ -708,12 +707,14 @@ class purchase_order_line(osv.osv): if not uom: res['value']['price_unit'] = 0.0 return res + def action_confirm(self, cr, uid, ids, context={}): self.write(cr, uid, ids, {'state': 'confirmed'}, context) for (id,name) in self.name_get(cr, uid, ids): message = _('Purchase order line') + " '" + name + "' "+ _("is confirmed") self.log(cr, uid, id, message) return True + purchase_order_line() class procurement_order(osv.osv): @@ -796,7 +797,7 @@ class procurement_order(osv.osv): res[procurement.id] = purchase_id self.write(cr, uid, [procurement.id], {'state': 'running', 'purchase_id': purchase_id}) return res + procurement_order() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file