From 0d836ea56e5a5530ad558ac634da4b4240de0aeb Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Tue, 16 Feb 2010 13:21:43 +0530 Subject: [PATCH 001/233] [FIX] Fixed error notification on parent_store=true with a column without ondelete=cascade lp bug: https://launchpad.net/bugs/522227 fixed bzr revid: jvo@tinyerp.com-20100216075143-f0e3axlg1m2eskmq --- bin/osv/orm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/osv/orm.py b/bin/osv/orm.py index 3e8f869e4ea..fd67b593405 100644 --- a/bin/osv/orm.py +++ b/bin/osv/orm.py @@ -1745,7 +1745,7 @@ class orm(orm_template): if 'parent_right' not in self._columns: logger.notifyChannel('orm', netsvc.LOG_ERROR, 'create a column parent_right on object %s: fields.integer(\'Right Parent\', select=1)' % (self._table, )) if self._columns[self._parent_name].ondelete<>'cascade': - logger.notifyChannel('orm', netsvc.LOG_ERROR, "the columns %s on object must be set as ondelete='cascasde'" % (self._name, self._parent_name)) + logger.notifyChannel('orm', netsvc.LOG_ERROR, "The column %s on object %s must be set as ondelete='cascade'" % (self._parent_name, self._name)) cr.execute('ALTER TABLE "%s" ADD COLUMN "parent_left" INTEGER' % (self._table,)) cr.execute('ALTER TABLE "%s" ADD COLUMN "parent_right" INTEGER' % (self._table,)) cr.commit() From c7e1318927f514711d614176eec2813034162477 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Tue, 16 Feb 2010 14:24:53 +0530 Subject: [PATCH 002/233] [IMP] Account/base_iban : bank and iban displayed on list view of O2M to partner lp bug: https://launchpad.net/bugs/519225 fixed bzr revid: jvo@tinyerp.com-20100216085453-xgt3s52brv1ei04y --- addons/account/partner_view.xml | 1 + addons/base_iban/base_iban_view.xml | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/addons/account/partner_view.xml b/addons/account/partner_view.xml index d93349d9f62..9402f0ff2e5 100644 --- a/addons/account/partner_view.xml +++ b/addons/account/partner_view.xml @@ -113,6 +113,7 @@ + diff --git a/addons/base_iban/base_iban_view.xml b/addons/base_iban/base_iban_view.xml index d93e9ffb086..00203665c50 100644 --- a/addons/base_iban/base_iban_view.xml +++ b/addons/base_iban/base_iban_view.xml @@ -42,6 +42,17 @@ + + res.partner.form.iban.inherit.list + res.partner + + form + + + + + + From 5fd39ca156ef78796aa6675041903858a1982189 Mon Sep 17 00:00:00 2001 From: "Rvo (Open ERP)" Date: Wed, 21 Apr 2010 16:44:35 +0530 Subject: [PATCH 003/233] [ADD]: access rights for osv_memory and osv_osv objects bzr revid: rvo@tinyerp.co.in-20100421111435-v4u8cemnfir19kh0 --- addons/account/security/ir.model.access.csv | 10 ++++++++++ addons/auction/security/ir.model.access.csv | 2 ++ addons/delivery/security/ir.model.access.csv | 2 ++ addons/event/security/ir.model.access.csv | 5 +++++ addons/fetchmail/__openerp__.py | 3 ++- addons/fetchmail/security/ir.model.access.csv | 4 ++++ addons/hr_evaluation/security/ir.model.access.csv | 2 ++ addons/hr_expense/security/ir.model.access.csv | 1 + addons/hr_recruitment/security/ir.model.access.csv | 1 + addons/html_view/security/ir.model.access.csv | 2 ++ addons/l10n_be/security/ir.model.access.csv | 4 ++++ addons/membership/security/ir.model.access.csv | 2 ++ addons/mrp/security/ir.model.access.csv | 1 + addons/point_of_sale/security/ir.model.access.csv | 3 ++- addons/product_margin/security/ir.model.access.csv | 2 ++ .../profile_manufacturing/security/ir.model.access.csv | 2 +- addons/profile_tools/security/ir.model.access.csv | 2 ++ addons/project/security/ir.model.access.csv | 1 + addons/project_messages/security/ir.model.access.csv | 2 ++ addons/project_timesheet/security/ir.model.access.csv | 1 - addons/purchase/security/ir.model.access.csv | 1 + addons/smtpclient/security/ir.model.access.csv | 2 ++ addons/stock/security/ir.model.access.csv | 8 +++++--- 23 files changed, 56 insertions(+), 7 deletions(-) create mode 100644 addons/fetchmail/security/ir.model.access.csv create mode 100644 addons/html_view/security/ir.model.access.csv create mode 100644 addons/product_margin/security/ir.model.access.csv create mode 100644 addons/profile_tools/security/ir.model.access.csv create mode 100644 addons/project_messages/security/ir.model.access.csv diff --git a/addons/account/security/ir.model.access.csv b/addons/account/security/ir.model.access.csv index 656e05e2a9b..68292cca244 100644 --- a/addons/account/security/ir.model.access.csv +++ b/addons/account/security/ir.model.access.csv @@ -95,3 +95,13 @@ "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_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 +"access_account_invoice_refund","account.invoice.refund","model_account_invoice_refund","account.group_account_manager",1,1,1,1 +"access_account_move_journal","account.move.journal","model_account_move_journal","account.group_account_manager",1,1,1,1 +"access_account_move_bank_reconcile","account.move.bank.reconcile","model_account_move_bank_reconcile","account.group_account_manager",1,1,1,1 +"access_account_subscription_generate","account.subscription.generate","model_account_subscription_generate","account.group_account_manager",1,1,1,1 +"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 diff --git a/addons/auction/security/ir.model.access.csv b/addons/auction/security/ir.model.access.csv index 1c1df0828ca..cc3a2e304f7 100644 --- a/addons/auction/security/ir.model.access.csv +++ b/addons/auction/security/ir.model.access.csv @@ -32,3 +32,5 @@ "acess_auction_payer","auction.payer","model_auction_payer","base.group_user",1,0,0,0 "access_auction_pay_sel","auction.pay.sel","model_auction_payer_sel","base.group_user",1,0,0,0 "acess_auction_taken","auction.taken","model_auction_taken","base.group_user",1,0,0,0 +"access_auction_catalog_flagey","auction.catalog.flagey","model_auction_catalog_flagey","base.group_user",1,0,0,0 +"access_auction_lots_buyer_map_user","auction_lots_buyer_map_user","model_auction_lots_buyer_map","base.group_user",1,0,0,0 diff --git a/addons/delivery/security/ir.model.access.csv b/addons/delivery/security/ir.model.access.csv index 948a85c35c7..e459c423b59 100644 --- a/addons/delivery/security/ir.model.access.csv +++ b/addons/delivery/security/ir.model.access.csv @@ -7,3 +7,5 @@ "access_delivery_grid_line_manager","delivery.grid.line","model_delivery_grid_line","sale.group_sale_manager",1,1,1,1 "access_delivery_carrier_partner_manager","delivery.carrier partner_manager","model_delivery_carrier","base.group_partner_manager",1,0,0,0 "access_delivery_carrier_stock_worker","delivery.carrier stock_worker","model_delivery_carrier","stock.group_stock_user",1,0,0,0 +"access_delivery_sale_order_manager","delivery.sale.order","model_delivery_sale_order","sale.group_sale_manager",1,1,1,1 +"access_delivery_sale_order","delivery.sale.order","model_delivery_sale_order","sale.group_sale_user",1,0,0,0 diff --git a/addons/event/security/ir.model.access.csv b/addons/event/security/ir.model.access.csv index 98b262ea5f3..9eccb065448 100644 --- a/addons/event/security/ir.model.access.csv +++ b/addons/event/security/ir.model.access.csv @@ -5,3 +5,8 @@ "access_event_registration","event.registration","model_event_registration","crm.group_crm_user",1,1,1,1 "access_report_event_registration","report.event.registration","model_report_event_registration","crm.group_crm_user",1,0,0,0 "access_report_event_type_registration","report.event.type.registration","model_report_event_type_registration","crm.group_crm_user",1,0,0,0 +"access_event_confirm_registration","event.confirm.registration","model_event_confirm_registration","crm.group_crm_user",1,0,0,0 +"access_event_confirm_registration_manager","event.confirm.registration manager","model_event_confirm_registration","crm.group_crm_manager",1,1,1,1 +"access_event_make_invoice","event.make.invoice","model_event_make_invoice","crm.group_crm_user",1,1,1,1 +"access_event_partners_list","event.partners.list","model_event_partners_list","crm.group_crm_user",1,0,0,0 +"access_event_registration_list","event.registration.list","model_event_registration_list","crm.group_crm_user",1,0,0,0 diff --git a/addons/fetchmail/__openerp__.py b/addons/fetchmail/__openerp__.py index fc2b245f11f..fe0608005e3 100644 --- a/addons/fetchmail/__openerp__.py +++ b/addons/fetchmail/__openerp__.py @@ -38,7 +38,8 @@ 'init_xml': [], 'update_xml': [ "fetchmail_view.xml", - "fetchmail_data.xml" + "fetchmail_data.xml", + 'security/ir.model.access.csv', ], 'demo_xml': [ diff --git a/addons/fetchmail/security/ir.model.access.csv b/addons/fetchmail/security/ir.model.access.csv new file mode 100644 index 00000000000..907aa187913 --- /dev/null +++ b/addons/fetchmail/security/ir.model.access.csv @@ -0,0 +1,4 @@ +"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" +"access_email_server","email.server","model_email_server",,1,1,1,1 +"access_mail_server_history","mail.server.history","model_mail_server_history",,1,1,1,1 +"access_email_server_tools","email.server.tools","model_email_server_tools",,1,1,1,1 diff --git a/addons/hr_evaluation/security/ir.model.access.csv b/addons/hr_evaluation/security/ir.model.access.csv index 3f3948c00db..e43c73ed108 100644 --- a/addons/hr_evaluation/security/ir.model.access.csv +++ b/addons/hr_evaluation/security/ir.model.access.csv @@ -8,3 +8,5 @@ "access_hr_evaluation_interview","hr.evaluation.interview","model_hr_evaluation_interview","hr.group_hr_user",1,0,0,0 "access_hr_evaluation_interview_manager","hr.evaluation.interview","model_hr_evaluation_interview","hr.group_hr_manager",1,1,1,1 "access_hr_evaluation_report","hr.evaluation.report","model_hr_evaluation_report",,1,0,0,0 +"access_hr_evaluation_reminder_manager","hr.evaluation.reminder","model_hr_evaluation_reminder","hr.group_hr_manager",1,1,1,1 +"access_hr_evaluation_reminder","hr.evaluation.reminder","model_hr_evaluation_reminder","hr.group_hr_user",1,0,0,0 diff --git a/addons/hr_expense/security/ir.model.access.csv b/addons/hr_expense/security/ir.model.access.csv index aa00dab4fa1..43ae736b9ff 100644 --- a/addons/hr_expense/security/ir.model.access.csv +++ b/addons/hr_expense/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_hr_expense_expense","hr.expense.expense","model_hr_expense_expense","hr.group_hr_user",1,1,1,1 "access_hr_expense_line","hr.expense.line","model_hr_expense_line","hr.group_hr_user",1,1,1,1 +"access_hr_expense_report","hr.expense.report","model_hr_expense_report","hr.group_hr_user",1,0,0,0 diff --git a/addons/hr_recruitment/security/ir.model.access.csv b/addons/hr_recruitment/security/ir.model.access.csv index 3e611ae02e8..f8898499c4d 100644 --- a/addons/hr_recruitment/security/ir.model.access.csv +++ b/addons/hr_recruitment/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_hr_applicant","hr.applicant","model_hr_applicant","hr.group_hr_manager",1,1,1,1 +"access_hr_recruitment_report","hr.recruitment.report","model_hr_recruitment_report",,1,0,0,0 diff --git a/addons/html_view/security/ir.model.access.csv b/addons/html_view/security/ir.model.access.csv new file mode 100644 index 00000000000..0b1057cfd1e --- /dev/null +++ b/addons/html_view/security/ir.model.access.csv @@ -0,0 +1,2 @@ +"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" +"access_html_view","html.view","model_html_view",,1,0,0,0 diff --git a/addons/l10n_be/security/ir.model.access.csv b/addons/l10n_be/security/ir.model.access.csv index daadf3d4b22..fbb5c74c18c 100644 --- a/addons/l10n_be/security/ir.model.access.csv +++ b/addons/l10n_be/security/ir.model.access.csv @@ -1,2 +1,6 @@ "id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" "access_vat_listing_clients","vat.listing.clients","model_vat_listing_clients",,1,1,1,1 +"access_partner_vat_intra","partner.vat.intra","model_partner_vat_intra",,1,1,1,1 +"access_partner_vat","partner.vat","model_partner_vat",,1,1,1,1 +"access_partner_vat_list","partner.vat.list","model_partner_vat_list",,1,1,1,1 +"access_l1on_be_vat_declaration","l1on_be.vat.declaration","model_l1on_be_vat_declaration",,1,1,1,1 diff --git a/addons/membership/security/ir.model.access.csv b/addons/membership/security/ir.model.access.csv index de35a7c8adc..cb722db567a 100644 --- a/addons/membership/security/ir.model.access.csv +++ b/addons/membership/security/ir.model.access.csv @@ -3,3 +3,5 @@ "access_membership_membership_line","membership.membership_line","model_membership_membership_line",,1,0,0,0 "access_report_partner_member_year","report.partner_member.year","model_report_partner_member_year","base.group_partner_manager",1,0,0,0 "access_report_partner_member_year_new","report.partner_member.year_new","model_report_partner_member_year_new","base.group_partner_manager",1,0,0,0 +"access_membership_invoice","membership.invoice","model_membership_invoice",,1,1,1,1 +"access_membership_unpaid_invoice","membership.unpaid.invoice","model_membership_unpaid_invoice",,1,0,0,0 diff --git a/addons/mrp/security/ir.model.access.csv b/addons/mrp/security/ir.model.access.csv index 48f27679435..b90c2bae7db 100644 --- a/addons/mrp/security/ir.model.access.csv +++ b/addons/mrp/security/ir.model.access.csv @@ -41,3 +41,4 @@ "access_report_mrp_inout","report.mrp.inout","model_report_mrp_inout","mrp.group_mrp_manager",1,0,0,0 "access_mrp_product_price","mrp.product_price","model_mrp_product_price","mrp.group_mrp_manager",1,0,0,0 "access_mrp_workcenter_load","mrp.workcenter.load","model_mrp_workcenter_load","mrp.group_mrp_manager",1,0,0,0 +"access_mrp_procurement_compute","mrp.procurement.compute","model_mrp_procurement_compute","mrp.group_mrp_user",1,0,0,0 diff --git a/addons/point_of_sale/security/ir.model.access.csv b/addons/point_of_sale/security/ir.model.access.csv index 0cfc0fae9b7..a6ec1fa0507 100644 --- a/addons/point_of_sale/security/ir.model.access.csv +++ b/addons/point_of_sale/security/ir.model.access.csv @@ -29,7 +29,7 @@ "access_pos_box_out","pos.box.out","model_pos_box_out","point_of_sale.group_pos_user",1,0,0,0 "access_pos_details ","pos.details ","model_pos_details","point_of_sale.group_pos_user",1,0,0,0 "access_pos_sale_user","pos.sale.user","model_pos_sale_user","point_of_sale.group_pos_user",1,0,0,0 -"access_pos_sale_user","pos.sales.user.today","model_pos_sales_user_today","point_of_sale.group_pos_user",1,0,0,0 +"access_pos_sale_user_today","pos.sales.user.today","model_pos_sales_user_today","point_of_sale.group_pos_user",1,0,0,0 "access_pos_sales_user_today_current_user","pos.sales.user.today.current_user","model_pos_sales_user_today_current_user","point_of_sale.group_pos_user",1,0,0,0 "access_all_closed_cashbox_of_the_day","all.closed.cashbox.of.the.day","model_all_closed_cashbox_of_the_day","point_of_sale.group_pos_user",1,0,0,0 "access_pos_receipt","pos.receipt ","model_pos_receipt","point_of_sale.group_pos_user",1,0,0,0 @@ -37,3 +37,4 @@ "access_pos_payment_report_date ","pos.payment.report.date ","model_pos_payment_report_date","point_of_sale.group_pos_user",1,0,0,0 "access_pos_make_payment","pos.make.payment","model_pos_make_payment","point_of_sale.group_pos_user",1,0,0,0 "access_pos_scan_product","pos.scan.product","model_pos_scan_product","point_of_sale.group_pos_user",1,0,0,0 +"access_pos_payment_report","pos.payment.report","model_pos_payment_report","point_of_sale.group_pos_user",1,0,0,0 diff --git a/addons/product_margin/security/ir.model.access.csv b/addons/product_margin/security/ir.model.access.csv new file mode 100644 index 00000000000..51d88da9d81 --- /dev/null +++ b/addons/product_margin/security/ir.model.access.csv @@ -0,0 +1,2 @@ +"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" +"access_product_margin","product.margin","model_product_margin",,1,0,0,0 diff --git a/addons/profile_manufacturing/security/ir.model.access.csv b/addons/profile_manufacturing/security/ir.model.access.csv index dc32d522e81..892aa4bce00 100644 --- a/addons/profile_manufacturing/security/ir.model.access.csv +++ b/addons/profile_manufacturing/security/ir.model.access.csv @@ -1,2 +1,2 @@ "id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" -"access_profile_manufacturing_wizard_install","profile manufacturing wizard install","model_profile_manufacturing_config_install_modules_wizard","base.group_system",1,1,1,1 +"access_profile_manufacturing_config_install_modules_wizard_all","profile_manufacturing_config_install_modules_wizard_all","model_profile_manufacturing_config_install_modules_wizard","base.group_system",1,1,1,1 diff --git a/addons/profile_tools/security/ir.model.access.csv b/addons/profile_tools/security/ir.model.access.csv new file mode 100644 index 00000000000..dbe55929ecc --- /dev/null +++ b/addons/profile_tools/security/ir.model.access.csv @@ -0,0 +1,2 @@ +"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" +"access_misc_tools_installer","misc_tools.installer","model_misc_tools_installer",,1,1,1,1 diff --git a/addons/project/security/ir.model.access.csv b/addons/project/security/ir.model.access.csv index abedc99cfd6..77f1c066517 100644 --- a/addons/project/security/ir.model.access.csv +++ b/addons/project/security/ir.model.access.csv @@ -14,3 +14,4 @@ "access_project_message","project.message","model_project_message","project.group_project_user",1,0,0,0 "access_project_installer","project.installer","model_project_installer","project.group_project_user",1,0,0,0 "access_report_project_task_user","report.project.task.user","model_report_project_task_user","project.group_project_manager",1,0,0,0 +"access_close_task","close.task","model_close_task","project.group_project_manager",1,1,1,1 diff --git a/addons/project_messages/security/ir.model.access.csv b/addons/project_messages/security/ir.model.access.csv new file mode 100644 index 00000000000..96782d5fc82 --- /dev/null +++ b/addons/project_messages/security/ir.model.access.csv @@ -0,0 +1,2 @@ +"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" +"access_project_messages","project.messages","model_project_messages",,1,1,1,1 diff --git a/addons/project_timesheet/security/ir.model.access.csv b/addons/project_timesheet/security/ir.model.access.csv index 42c3ea0d15c..69075f64e05 100644 --- a/addons/project_timesheet/security/ir.model.access.csv +++ b/addons/project_timesheet/security/ir.model.access.csv @@ -1,3 +1,2 @@ "id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" -"access_task_report","report.task.report","model_task_report","project.group_project_manager",1,0,0,0 "access_report_timesheet_task_user","report.timesheet.task.user","model_report_timesheet_task_user","project.group_project_manager",1,0,0,0 diff --git a/addons/purchase/security/ir.model.access.csv b/addons/purchase/security/ir.model.access.csv index e1eb2cdf199..ea35d9d7258 100644 --- a/addons/purchase/security/ir.model.access.csv +++ b/addons/purchase/security/ir.model.access.csv @@ -9,3 +9,4 @@ "access_purchase_order_line_stock_worker","purchase.order.line stock_worker","model_purchase_order_line","stock.group_stock_user",1,0,0,0 "access_account_tax_purchase_user","account.tax purchase_user","account.model_account_tax","purchase.group_purchase_user",1,0,0,0 "access_report_purchase_order","report.purchase.order","model_report_purchase_order","purchase.group_purchase_manager",1,0,0,0 +"access_purchase_order_group","purchase.order.group","model_purchase_order_group","purchase.group_purchase_user",1,1,1,1 diff --git a/addons/smtpclient/security/ir.model.access.csv b/addons/smtpclient/security/ir.model.access.csv index 6b5df447317..afa2720852e 100644 --- a/addons/smtpclient/security/ir.model.access.csv +++ b/addons/smtpclient/security/ir.model.access.csv @@ -9,3 +9,5 @@ "access_res_company_address_erpmanager","res.company.address","model_res_company_address","base.group_erp_manager",1,1,1,1 "access_email_smtpclient_queue","Smtpclient_queue all","model_email_smtpclient_queue",,1,1,1,0 "access_email_smtpclient_queue_erpmanager","Smtpclient_queue erp_manager","model_email_smtpclient_queue","base.group_erp_manager",1,1,1,1 +"access_email_headers_group_erpmanager","email.headers erp_manager","model_email_headers","base.group_erp_manager",1,1,1,1 +"access_email_headers_all","email.headers all","model_email_headers",,1,0,0,0 diff --git a/addons/stock/security/ir.model.access.csv b/addons/stock/security/ir.model.access.csv index 5622557e834..90d0178ba5a 100644 --- a/addons/stock/security/ir.model.access.csv +++ b/addons/stock/security/ir.model.access.csv @@ -40,8 +40,10 @@ "access_stock_traceability_downstream","stock.traceability.downstream","model_stock_traceability_downstream","stock.group_stock_user",1,0,0,0 "access_stock_traceability_lot_upstream","stock.traceability.lot.upstream","model_stock_traceability_lot_upstream","stock.group_stock_user",1,0,0,0 "access_stock_traceability_lot_downstream","stock.traceability.lot.downstream","model_stock_traceability_lot_downstream","stock.group_stock_user",1,0,0,0 -"access_stock_partial_picking",stock.partial.picking","model_stock_partial_picking","stock.group_stock_user",1,0,0,0 -"access_stock_partial_move","stock.partial.move","model_stock_partial_move","stock.group_stock_user",1,0,0,0 -"access_stock_picking_make","stock.picking.make","model_stock_picking_make","stock.group_stock_user",1,0,0,0 +"access_stock_return_picking","stock.return.picking","model_stock_return_picking","stock.group_stock_user",1,0,0,0 +"access_stock_partial_picking","stock.partial.picking","model_stock_partial_picking","stock.group_stock_user",1,0,0,0 +"acces_stock_partial_move","stock.partial.move","model_stock_partial_move","stock.group_stock_user",1,0,0,0 "access_stock_inventory_merge","stock.inventory.merge","model_stock_inventory_merge","stock.group_stock_user",1,0,0,0 +"access_action_traceability","action.traceability","model_action_traceability","stock.group_stock_user",1,0,0,0 "access_stock_change_standard_price","stock.change.standard.price","model_stock_change_standard_price","stock.group_stock_user",1,0,0,0 +"access_stock_picking_make","stock.picking.make","model_stock_picking_make","stock.group_stock_user",1,0,0,0 From 31e9ce9fe4ddcfd6fc56615a975a949314daa3a9 Mon Sep 17 00:00:00 2001 From: "Vir (Open ERP)" Date: Mon, 3 May 2010 12:23:45 +0530 Subject: [PATCH 004/233] [ADD,MOD] account_report : indicator with pdf wizard converted to osv memory wizard bzr revid: vir@tinyerp.com-20100503065345-av92d15yn9r4s25u --- addons/account_report/__openerp__.py | 1 + addons/account_report/account_wizard.xml | 2 +- addons/account_report/wizard/__init__.py | 2 +- ...ccount_report_print_indicators_with_pdf.py | 107 +++++++++++++++++ ..._report_print_indicators_with_pdf_view.xml | 45 ++++++++ .../wizard_print_indicators_with_pdf.py | 109 ------------------ 6 files changed, 155 insertions(+), 111 deletions(-) create mode 100644 addons/account_report/wizard/account_report_print_indicators_with_pdf.py create mode 100644 addons/account_report/wizard/account_report_print_indicators_with_pdf_view.xml delete mode 100644 addons/account_report/wizard/wizard_print_indicators_with_pdf.py diff --git a/addons/account_report/__openerp__.py b/addons/account_report/__openerp__.py index d71d75f0bb3..3f0739bdb91 100644 --- a/addons/account_report/__openerp__.py +++ b/addons/account_report/__openerp__.py @@ -38,6 +38,7 @@ 'account_report.xml', 'account_wizard.xml', 'wizard/account_report_print_indicators_view.xml', + 'wizard/account_report_print_indicators_with_pdf_view.xml', ], 'demo_xml': [], 'installable': True, diff --git a/addons/account_report/account_wizard.xml b/addons/account_report/account_wizard.xml index d56b6c9d565..1e07a8fc248 100644 --- a/addons/account_report/account_wizard.xml +++ b/addons/account_report/account_wizard.xml @@ -4,7 +4,7 @@ - + \ No newline at end of file diff --git a/addons/account_report/wizard/__init__.py b/addons/account_report/wizard/__init__.py index 2658c47cf17..cae88f16a32 100644 --- a/addons/account_report/wizard/__init__.py +++ b/addons/account_report/wizard/__init__.py @@ -20,6 +20,6 @@ ############################################################################## import account_report_print_indicators -import wizard_print_indicators_with_pdf +import account_report_print_indicators_with_pdf # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_report/wizard/account_report_print_indicators_with_pdf.py b/addons/account_report/wizard/account_report_print_indicators_with_pdf.py new file mode 100644 index 00000000000..8d0dbf6232d --- /dev/null +++ b/addons/account_report/wizard/account_report_print_indicators_with_pdf.py @@ -0,0 +1,107 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## +import time +from mx.DateTime import * +import os +import base64 +import StringIO + +from osv import fields, osv +import tools +import pooler +from report.render import render +from report.interface import report_int + +class account_report_print_indicators_with_pdf(osv.osv_memory): + _name = "account.report.print.indicators.with.pdf" + _description = "Print Indicators" + _columns = { + 'file': fields.binary('Select a PDF File', filters='*.pdf', required=True), + } + + def check_report(self, cr, uid, ids, context=None): + datas = {} + if context is None: + context = {} + data = self.read(cr, uid, ids)[0] + datas = { + 'ids': context.get('active_ids',[]), + 'model': 'account.report.report', + 'form': data + } + + return { + 'type': 'ir.actions.report.xml', + 'report_name': 'print.indicator.pdf', + 'datas': datas, + } + + +account_report_print_indicators_with_pdf() + +class external_pdf(render): + def __init__(self, pdf): + render.__init__(self) + self.pdf = pdf + self.output_type='pdf' + def _render(self): + return self.pdf + +class report_custom(report_int): + def create(self, cr, uid, ids, data, context={}): + pool = pooler.get_pool(cr.dbname) + obj_indicator = pool.get('account.report.report') + code_ids = obj_indicator.browse(cr,uid,context['active_id']) + + self.list={} + + def find_child(obj): + self.list[obj.code]=str(obj.amount) + if obj.child_ids: + for child in obj.child_ids: + find_child(child) + return True + + find_child(code_ids) + + file_contents=base64.decodestring(data['form']['file']) + fp = StringIO.StringIO(file_contents) + + infile = open(tools.config['addons_path']+"/test.pdf", 'wb') + infile.write(fp.read()) + infile.close() + + obj_user=pool.get('res.users').browse(cr,uid,uid) + self.list['printing_user']=str(obj_user.name) + self.list['company_name']=(obj_user.company_id.name) + self.list['company_country']=obj_user.company_id.partner_id.country + self.list['company_vat']=obj_user.company_id.partner_id.vat + self.list['printing_time']=time.strftime('%H:%M:%S') + self.list['printing_date']=time.strftime('%D') + + tools.pdf_utils.fill_pdf(tools.config['addons_path']+"/test.pdf",'/tmp/output.pdf',self.list) + self.obj = external_pdf(file('/tmp/output.pdf').read()) + self.obj.render() + return (self.obj.pdf, 'pdf') + +report_custom('report.print.indicator.pdf') + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/account_report/wizard/account_report_print_indicators_with_pdf_view.xml b/addons/account_report/wizard/account_report_print_indicators_with_pdf_view.xml new file mode 100644 index 00000000000..07e1ef0b4d9 --- /dev/null +++ b/addons/account_report/wizard/account_report_print_indicators_with_pdf_view.xml @@ -0,0 +1,45 @@ + + + + + + account.report.print.indicators.with.pdf.form + account.report.print.indicators.with.pdf + form + +
+