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/159] [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/159] [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/159] [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 3ab23147cb2bcf3540c81facfc9996386e3b9fd7 Mon Sep 17 00:00:00 2001 From: gpa Date: Mon, 10 May 2010 15:30:52 +0530 Subject: [PATCH 004/159] [FIX](5.0 to 6.0) account_payment: Remove the duplicated 'bank_id' field in the payment.line tree view bzr revid: gpa@tinyerp.com-20100510100052-e6d908ojubtyjqma --- addons/account_payment/payment_view.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/account_payment/payment_view.xml b/addons/account_payment/payment_view.xml index c5c335c4f5f..82c0cfbcc08 100644 --- a/addons/account_payment/payment_view.xml +++ b/addons/account_payment/payment_view.xml @@ -280,7 +280,6 @@ - From 0402dda2419c53f7bcd6401604e15584de3d5568 Mon Sep 17 00:00:00 2001 From: gpa Date: Mon, 10 May 2010 15:32:34 +0530 Subject: [PATCH 005/159] [IMP] (5.0 to 6.0) Account_followup : Domian improved for an act_window from Partner bzr revid: gpa@tinyerp.com-20100510100234-z3cqi9xhec2njoae --- addons/account_followup/followup_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account_followup/followup_view.xml b/addons/account_followup/followup_view.xml index 4b5e77beb87..057e761cbca 100644 --- a/addons/account_followup/followup_view.xml +++ b/addons/account_followup/followup_view.xml @@ -124,7 +124,7 @@ - + From 99d8cd6e3cf40d4aa3daacffdfd574f1c9cf5590 Mon Sep 17 00:00:00 2001 From: "Jay(Open ERP)" <> Date: Mon, 10 May 2010 15:35:50 +0530 Subject: [PATCH 006/159] [FIX] (5.0 to 6.0)Account : Added centralization check on write() of move line bzr revid: vra@tinyerp.com-20100510100550-4wk259iksi9f0aer --- addons/account/account_move_line.py | 40 +++++++++++++++++++++++------ 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index b9aa089942e..4afb6c3e85e 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -774,6 +774,17 @@ class account_move_line(osv.osv): result['fields'] = self.fields_get(cr, uid, fields, context) return result + def _check_moves(self, cr, uid, context): + # use the first move ever created for this journal and period + cr.execute('select id, state, name from account_move where journal_id=%s and period_id=%s order by id limit 1', (context['journal_id'],context['period_id'])) + res = cr.fetchone() + if res: + if res[1] != 'draft': + raise osv.except_osv(_('UserError'), + _('The account move (%s) for centralisation ' \ + 'has been confirmed!') % res[2]) + return res + def unlink(self, cr, uid, ids, context={}, check=True): self._update_check(cr, uid, ids, context) result = False @@ -786,7 +797,7 @@ class account_move_line(osv.osv): return result def write(self, cr, uid, ids, vals, context=None, check=True, update_check=True): - if not context: + if context is None: context={} if vals.get('account_tax_id', False): raise osv.except_osv(_('Unable to change tax !'), _('You can not change the tax, you should remove and recreate lines !')) @@ -802,6 +813,24 @@ class account_move_line(osv.osv): if vals.get('date', False): todo_date = vals['date'] del vals['date'] + + for line in self.browse(cr, uid, ids,context=context): + ctx = context.copy() + if ('journal_id' not in ctx): + if line.move_id: + ctx['journal_id'] = line.move_id.journal_id.id + else: + ctx['journal_id'] = line.journal_id.id + if ('period_id' not in ctx): + if line.move_id: + ctx['period_id'] = line.move_id.period_id.id + else: + ctx['period_id'] = line.period_id.id + #Check for centralisation + journal = self.pool.get('account.journal').browse(cr, uid, ctx['journal_id'], context=ctx) + if journal.centralisation: + self._check_moves(cr, uid, context=ctx) + result = super(account_move_line, self).write(cr, uid, ids, vals, context) if check: @@ -867,14 +896,9 @@ class account_move_line(osv.osv): is_new_move = False if not move_id: if journal.centralisation: - # use the first move ever created for this journal and period - cr.execute('select id, state, name from account_move where journal_id=%s and period_id=%s order by id limit 1', (context['journal_id'],context['period_id'])) - res = cr.fetchone() + #Check for centralisation + res = self._check_moves(cr, uid, context) if res: - if res[1] != 'draft': - raise osv.except_osv(_('UserError'), - _('The Ledger Posting (%s) for centralisation ' \ - 'has been confirmed!') % res[2]) vals['move_id'] = res[0] if not vals.get('move_id', False): From 8f83fa784934f08cf123c5383338466793d05ae9 Mon Sep 17 00:00:00 2001 From: "JMA (OpenERP)" Date: Mon, 10 May 2010 15:36:52 +0530 Subject: [PATCH 007/159] [FIX] Account_payment : Date will be asked to user while importing payment order into bank statement bzr revid: jma@tinyerp.com-20100510100652-pvarypai13dfki2w --- .../wizard/wizard_populate_statement.py | 29 ++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/addons/account_payment/wizard/wizard_populate_statement.py b/addons/account_payment/wizard/wizard_populate_statement.py index f58407ad4b2..7ec3952bb5b 100644 --- a/addons/account_payment/wizard/wizard_populate_statement.py +++ b/addons/account_payment/wizard/wizard_populate_statement.py @@ -22,12 +22,22 @@ import wizard import pooler from tools.misc import UpdateableStr +import time FORM = UpdateableStr() FIELDS = { 'lines': {'string': 'Payment Lines', 'type': 'many2many', 'relation': 'payment.line'}, + 'date_select': { + 'string': 'Select Date', + 'type': 'selection', + 'selection': [('date_payment','Payment Order Date'),('date_current','Current Date'),('date_maturity','Maturity Date'),('date_other','Fixed Date')], + 'required': True, + 'default': lambda *a:'date_other', + 'help': 'The selected date will be used for statement lines' + }, + 'd_date': {'string': 'Date', 'type': 'date',}, } def _search_entries(obj, cursor, user, data, context): @@ -46,6 +56,12 @@ def _search_entries(obj, cursor, user, data, context): FORM.string = '''
+ + + + + + ''' % (','.join([str(x) for x in line_ids])) @@ -65,9 +81,18 @@ def _populate_statement(obj, cursor, user, data, context): statement = statement_obj.browse(cursor, user, data['id'], context=context) + if data['form']['date_select'] == 'date_current': + date_line = time.strftime('%Y-%m-%d') + elif data['form']['date_select'] == 'date_payment': + date_line = statement.date + else: + date_line = data['form']['d_date'] + for line in line_obj.browse(cursor, user, line_ids, context=context): ctx = context.copy() - ctx['date'] = line.ml_maturity_date # was value_date earlier,but this field exists no more now + if data['form']['date_select'] == 'date_maturity': + date_line = line.ml_maturity_date + ctx['date'] = date_line amount = currency_obj.compute(cursor, user, line.currency.id, statement.currency.id, line.amount_currency, context=ctx) @@ -75,7 +100,9 @@ def _populate_statement(obj, cursor, user, data, context): reconcile_id = statement_reconcile_obj.create(cursor, user, { 'line_ids': [(6, 0, [line.move_line_id.id])] }, context=context) + statement_line_obj.create(cursor, user, { + 'date': date_line, 'name': line.order_id.reference or '?', 'amount': - amount, 'type': 'supplier', From 17abd658c3a6f13ed53ca55b579fff08dd0b0c02 Mon Sep 17 00:00:00 2001 From: "Jay(Open ERP)" <> Date: Mon, 10 May 2010 15:44:08 +0530 Subject: [PATCH 008/159] [FIX] Account : Journal's name_search() did not use context well bzr revid: gpa@tinyerp.com-20100510101408-ak1a5dppq86hnikg --- addons/account/account.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index eca8bf9b397..f39c0518f57 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -538,13 +538,13 @@ class account_journal(osv.osv): def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=100): if not args: args=[] - if not context: + if context is None: context={} ids = [] if name: - ids = self.search(cr, user, [('code','ilike',name)]+ args, limit=limit) + ids = self.search(cr, user, [('code','ilike',name)]+ args, limit=limit, context=context) if not ids: - ids = self.search(cr, user, [('name',operator,name)]+ args, limit=limit) + ids = self.search(cr, user, [('name',operator,name)]+ args, limit=limit, context=context) return self.name_get(cr, user, ids, context=context) account_journal() From ee48c965e50a90706d37f3ee951dffcaa7e7cb73 Mon Sep 17 00:00:00 2001 From: "Jay(Open ERP)" <> Date: Mon, 10 May 2010 15:55:37 +0530 Subject: [PATCH 009/159] [FIX] (5.0 - 6.0)Account : Manual reconcilation should work with the option of Skip Draft Entries of Journal bzr revid: vra@tinyerp.com-20100510102537-wunu090pw1ycpbub --- addons/account/account_move_line.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index 4afb6c3e85e..30d4dea9300 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -1031,7 +1031,7 @@ class account_move_line(osv.osv): # if context and ('__last_update' in context): # del context['__last_update'] # self.pool.get('account.move').write(cr, uid, [move_id], {'date':vals['date']}, context=context) - if check and not context.get('no_store_function'): + if check and ((not context.get('no_store_function')) or journal.entry_posted): tmp = self.pool.get('account.move').validate(cr, uid, [vals['move_id']], context) if journal.entry_posted and tmp: self.pool.get('account.move').button_validate(cr,uid, [vals['move_id']],context) From a5cb75b4238c630833f94678cd482e999e88306d Mon Sep 17 00:00:00 2001 From: "JMA (OpenERP)" Date: Mon, 10 May 2010 16:11:03 +0530 Subject: [PATCH 010/159] [FIX] Account: Group1 = ['payable', 'receivable', 'other'] Group2 = ['consolidation','view'] The change in type of Account should not be allowed in the following conditions: 1. If the account with its children(if any) have any entries and old type is in Group1, goes to new type in Group2. 2. If the account with its children(if any) have any entries and old type is in Group2, goes to new type in Group1. 3. If the account with its children(if any) have any entries and old type is Closed and new type is other than 'Closed'. bzr revid: jma@tinyerp.com-20100510104103-gnxsitsw0q6mvwzb --- addons/account/account.py | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/addons/account/account.py b/addons/account/account.py index f39c0518f57..607716761dd 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -438,11 +438,30 @@ class account_account(osv.osv): raise osv.except_osv(_('Error !'), _('You cannot remove an account which has account entries!. ')) return True + def _check_allow_type_change(self, cr, uid, ids, new_type, context): + group1 = ['payable', 'receivable', 'other'] + group2 = ['consolidation','view'] + line_obj = self.pool.get('account.move.line') + for account in self.browse(cr, uid, ids, context=context): + old_type = account.type + account_ids = self.search(cr, uid, [('id', 'child_of', [account.id])]) + if line_obj.search(cr, uid, [('account_id', 'in', account_ids)]): + #Check for 'Closed' type + if old_type == 'closed' and new_type !='closed': + raise osv.except_osv(_('Warning !'), _("You cannot change the type of account from 'Closed' to any other type which contains account entries!")) + #Check for change From group1 to group2 and vice versa + if (old_type in group1 and new_type in group2) or (old_type in group2 and new_type in group1): + print " fdsfdsgdsfgdfgdfg " + raise osv.except_osv(_('Warning !'), _("You cannot change the type of account from '%s' to '%s' type as it contains account entries!") % (old_type,new_type,)) + return True + def write(self, cr, uid, ids, vals, context=None): - if not context: + if context is None: context = {} if 'active' in vals and not vals['active']: self._check_moves(cr, uid, ids, "write", context) + if 'type' in vals.keys(): + self._check_allow_type_change(cr, uid, ids, vals['type'], context=context) return super(account_account, self).write(cr, uid, ids, vals, context=context) def unlink(self, cr, uid, ids, context={}): From 7a2cc710fef49fdec6ec3a9f0a896f563619db8f Mon Sep 17 00:00:00 2001 From: "JMA (OpenERP)" Date: Mon, 10 May 2010 16:30:27 +0530 Subject: [PATCH 011/159] [FIX] Sale : progressbar for picking should be set when SO is picked 100%(including its procurement is done) bzr revid: jma@tinyerp.com-20100510110027-8brfub6n5s9arhx0 --- addons/sale/sale.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 718f29f12d7..021381f3461 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -106,17 +106,19 @@ class sale_order(osv.osv): for id in ids: res[id] = [0.0, 0.0] cr.execute('''SELECT - p.sale_id,sum(m.product_qty), m.state + p.sale_id,sum(m.product_qty), mp.state as mp_state FROM stock_move m LEFT JOIN stock_picking p on (p.id=m.picking_id) + LEFT JOIN + mrp_procurement mp on (mp.move_id=m.id) WHERE - p.sale_id = ANY(%s) GROUP BY m.state, p.sale_id''',(ids,)) - for oid, nbr, state in cr.fetchall(): - if state == 'cancel': + p.sale_id = ANY(%s) GROUP BY mp.state, p.sale_id''') + for oid, nbr, mp_state in cr.fetchall(): + if mp_state == 'cancel': continue - if state == 'done': + if mp_state == 'done': res[oid][0] += nbr or 0.0 res[oid][1] += nbr or 0.0 else: From b98827bb140df79b47070e2be2b2d4db059f050d Mon Sep 17 00:00:00 2001 From: "JMA (OpenERP)" Date: Mon, 10 May 2010 16:42:52 +0530 Subject: [PATCH 012/159] [FIX] Account_Voucher : Correction in creating account.move from voucher bzr revid: jma@tinyerp.com-20100510111252-gwsyp8o6wldxje5w --- addons/account_voucher/voucher.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account_voucher/voucher.py b/addons/account_voucher/voucher.py index 66b701fb97a..101d5386ccf 100644 --- a/addons/account_voucher/voucher.py +++ b/addons/account_voucher/voucher.py @@ -302,9 +302,9 @@ class account_voucher(osv.osv): name = self.pool.get('ir.sequence').get_id(cr, uid, journal.sequence_id.id) move = { - 'name': name, + 'name' : name, 'journal_id': journal_id, - 'voucher_type':inv.type, + 'type' : inv.type, 'narration' : inv.narration } if inv.period_id: From 1b8ee7b87a50f1b052e6dd312dfdd2f49e342449 Mon Sep 17 00:00:00 2001 From: gpa Date: Mon, 10 May 2010 17:06:34 +0530 Subject: [PATCH 013/159] [FIX] account_payment: added journal_id field in account.move.line.tree view bzr revid: gpa@tinyerp.com-20100510113634-0og9z5zevn8ghebi --- addons/account_payment/payment_view.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/account_payment/payment_view.xml b/addons/account_payment/payment_view.xml index 82c0cfbcc08..a61c0183cc5 100644 --- a/addons/account_payment/payment_view.xml +++ b/addons/account_payment/payment_view.xml @@ -26,6 +26,7 @@ + From 82b9a805682b10afb214beabbf84c678e3176b3d Mon Sep 17 00:00:00 2001 From: Olivier Dony <> Date: Mon, 10 May 2010 17:57:32 +0530 Subject: [PATCH 014/159] [FIX] (5.0 - 6.0) account: finish fix of generation of account.move.lines from invoice by providing extension hook bzr revid: vra@tinyerp.com-20100510122732-qq2rgljxockwm48p --- addons/account/invoice.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/addons/account/invoice.py b/addons/account/invoice.py index 14cd952aa69..f919f99cee7 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -649,6 +649,16 @@ class account_invoice(osv.osv): if res and res['value']: self.write(cr, uid, [inv.id], res['value']) return True + + def finalize_invoice_move_lines(self, cr, uid, invoice_browse, move_lines): + """finalize_invoice_move_lines(cr, uid, invoice, move_lines) -> move_lines + Hook method to be overridden in additional modules to verify and possibly alter the + move lines to be created by an invoice, for special cases. + :param invoice_browse: browsable record of the invoice that is generating the move lines + :param move_lines: list of dictionaries with the account.move.lines (as for create()) + :return: the (possibly updated) final move_lines to create for this invoice + """ + return move_lines def check_tax_lines(self, cr, uid, inv, compute_taxes, ait_obj): if not inv.tax_line: From 1ebe1de3d903142627968d094f431158a5fca1a5 Mon Sep 17 00:00:00 2001 From: "Jay(Open ERP)" <> Date: Mon, 10 May 2010 18:05:10 +0530 Subject: [PATCH 015/159] [FIX] (5.0 - 6.0)Account : Overdue report corrected bzr revid: vra@tinyerp.com-20100510123510-eebf7x7hqae1ftf4 --- addons/account/report/overdue.rml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/addons/account/report/overdue.rml b/addons/account/report/overdue.rml index 2713b665d06..e8e1a7dc84c 100644 --- a/addons/account/report/overdue.rml +++ b/addons/account/report/overdue.rml @@ -84,8 +84,8 @@ + - [[ repeatIn(objects,'o') ]] [[ setLang(o.lang) ]] @@ -177,16 +177,16 @@ [[ line['ref'] ]] - [[ line['date_maturity'] ]] + [[ line['date_maturity'] and formatLang(line['date_maturity'],date=True) or '' ]] - [[ formatLang(line['debit']) and formatLang(line['debit'] * (line['account_id']['type'] == 'payable' and -1 or 1)) ]] + [[ (line['account_id']['type'] == 'receivable' and formatLang(line['debit']) or 0) or (line['account_id']['type'] == 'payable' and formatLang(line['credit'] * -1) or ' ') ]] - [[ formatLang(line['credit']) and formatLang(line['credit'] * (line['account_id']['type'] == 'payable' and -1 or 1)) ]] + [[ (line['account_id']['type'] == 'receivable' and formatLang(line['credit']) or 0) or (line['account_id']['type'] == 'payable' and formatLang(line['debit'] * -1) or 0) ]] - [[ formatLang((line['date_maturity'] < time.strftime('%Y-%m-%d')) and ((line['debit'] - line['credit']) * (line['account_id']['type'] == 'payable' and -1 or 1))) ]] + [[ formatLang((line['date_maturity'] < time.strftime('%Y-%m-%d'))) and (line['debit'] - line['credit']) ]] [[ line['blocked'] and 'X' or '' ]] @@ -205,13 +205,13 @@ Sub-Total : - [[ formatLang((reduce(lambda x, y: x + (y['debit'] * (y['account_id']['type'] == 'payable' and -1 or 1)), getLines(o), 0))) ]] + [[ formatLang((reduce(lambda x, y: x + ((y['account_id']['type'] == 'receivable' and y['debit'] or 0) or (y['account_id']['type'] == 'payable' and y['credit'] * -1 or 0)), getLines(o), 0))) ]] - [[ formatLang((reduce(lambda x ,y: x + (y['credit'] * (y['account_id']['type'] == 'payable' and -1 or 1)), getLines(o), 0))) ]] + [[ formatLang((reduce(lambda x, y: x + ((y['account_id']['type'] == 'receivable' and y['credit'] or 0) or (y['account_id']['type'] == 'payable' and y['debit'] * -1 or 0)), getLines(o), 0))) ]] - [[ formatLang((reduce(lambda x, y: x + ((y['debit'] - y['credit']) * (y['account_id']['type'] == 'payable' and -1 or 1)), filter(lambda x: x['date_maturity'] < time.strftime('%Y-%m-%d'), getLines(o)), 0))) ]] + [[ formatLang((reduce(lambda x, y: x + (y['debit'] - y['credit']), filter(lambda x: x['date_maturity'] < time.strftime('%Y-%m-%d'), getLines(o)), 0))) ]] @@ -229,7 +229,7 @@ Balance : - [[ formatLang((reduce(lambda x, y: x +((y['debit'] - y['credit']) * (y['account_id']['type'] == 'payable' and -1 or 1)), getLines(o), 0))) ]] + [[ formatLang((reduce(lambda x, y: x +(y['debit'] - y['credit']), getLines(o), 0))) ]] @@ -248,9 +248,9 @@ - Total amount due: [[ formatLang((reduce(lambda x, y: x + ((y['debit'] - y['credit']) * (y['account_id']['type'] == 'payable' and -1 or 1)), getLines(o), 0))) ]] [[ company.currency_id.name ]]. + Total amount due: [[ formatLang((reduce(lambda x, y: x + (y['debit'] - y['credit']), getLines(o), 0))) ]] [[ company.currency_id.name ]]. - + \ No newline at end of file From b046ff45e6b68ae9947ae7831c0119688fb5ed48 Mon Sep 17 00:00:00 2001 From: "Jay(Open ERP)" <> Date: Mon, 10 May 2010 18:26:32 +0530 Subject: [PATCH 016/159] =?UTF-8?q?[REF/FIX]=C2=A0(5.0=20-=206.0)Hr=5FCont?= =?UTF-8?q?ract=C2=A0:=C2=A0Removed=C2=A0undefined=C2=A0object's=C2=A0view?= =?UTF-8?q?s=C2=A0from=C2=A0xml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit bzr revid: vra@tinyerp.com-20100510125632-aoz0t7zf4eoji26l --- addons/hr_contract/hr_contract_view.xml | 29 ++++++------------------- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/addons/hr_contract/hr_contract_view.xml b/addons/hr_contract/hr_contract_view.xml index 7578d66e98b..4a20025fb1d 100644 --- a/addons/hr_contract/hr_contract_view.xml +++ b/addons/hr_contract/hr_contract_view.xml @@ -132,18 +132,14 @@ - - - hr.contract.type.view.form - hr.contract.type - form - -
- - -
+ + Marital Status + hr.employee.marital.status + form + tree,form - + + hr.contract.view.form hr.contract @@ -180,17 +176,6 @@
- - hr.contract.type.view.tree - hr.contract.type - tree - - - - - - - hr.contract.view.tree hr.contract From 3d3cb4476d83c12fef4cf31b32a82e7ea9751d0f Mon Sep 17 00:00:00 2001 From: gpa Date: Mon, 10 May 2010 18:31:22 +0530 Subject: [PATCH 017/159] [FIX] Sale : Fiscal position value has to be passed when Invoice is created from SO bzr revid: gpa@tinyerp.com-20100510130122-ssy3j8t5j472vlmx --- addons/sale/sale.py | 2 +- addons/sale/stock.py | 4 ++++ addons/sale/wizard/sale_line_invoice.py | 2 +- addons/sale/wizard/sale_make_invoice_advance.py | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 021381f3461..26f99fc2f96 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -436,7 +436,7 @@ class sale_order(osv.osv): 'currency_id': order.pricelist_id.currency_id.id, 'comment': order.note, 'payment_term': pay_term, - 'fiscal_position': order.partner_id.property_account_position.id, + 'fiscal_position': order.partner_id.property_account_position.id or order.fiscal_position.id, 'date_invoice' : context.get('date_invoice',False), 'company_id' : order.company_id.id, } diff --git a/addons/sale/stock.py b/addons/sale/stock.py index e2f632bf711..f86dcfdd58e 100644 --- a/addons/sale/stock.py +++ b/addons/sale/stock.py @@ -139,6 +139,10 @@ class stock_picking(osv.osv): sale_lines = picking.sale_id.order_line invoice_created = invoices[result[picking.id]] + for inv in invoice_obj.browse(cursor, user, [invoice_created.id], context=context): + if not inv.fiscal_position: + invoice_obj.write(cursor, user, [inv.id], {'fiscal_position': picking.sale_id.fiscal_position.id}, context=context) + if picking.sale_id.client_order_ref: inv_name = picking.sale_id.client_order_ref + " : " + invoice_created.name invoice_obj.write(cursor, user, [invoice_created.id], {'name': inv_name}, context=context) diff --git a/addons/sale/wizard/sale_line_invoice.py b/addons/sale/wizard/sale_line_invoice.py index 4bf3074db54..bb22000f8e1 100644 --- a/addons/sale/wizard/sale_line_invoice.py +++ b/addons/sale/wizard/sale_line_invoice.py @@ -82,7 +82,7 @@ class sale_order_line_make_invoice(osv.osv_memory): 'currency_id' : order.pricelist_id.currency_id.id, 'comment': order.note, 'payment_term': pay_term, - 'fiscal_position': order.partner_id.property_account_position.id + 'fiscal_position': order.partner_id.property_account_position.id or order.fiscal_position.id } inv_id = self.pool.get('account.invoice').create(cr, uid, inv) return inv_id diff --git a/addons/sale/wizard/sale_make_invoice_advance.py b/addons/sale/wizard/sale_make_invoice_advance.py index 6c9ca17b836..a78f548617b 100644 --- a/addons/sale/wizard/sale_make_invoice_advance.py +++ b/addons/sale/wizard/sale_make_invoice_advance.py @@ -95,7 +95,7 @@ class sale_advance_payment_inv(osv.osv_memory): 'currency_id' :sale.pricelist_id.currency_id.id, 'comment': '', 'payment_term':sale.payment_term.id, - 'fiscal_position': sale.partner_id.property_account_position.id + 'fiscal_position': sale.partner_id.property_account_position.id or sale.fiscal_position.id } inv_id = inv_obj.create(cr, uid, inv) From f2b2ef9c3ad15dadc4c393a59076c0b73d3d6fd2 Mon Sep 17 00:00:00 2001 From: "Jay(Open ERP)" <> Date: Mon, 10 May 2010 18:58:46 +0530 Subject: [PATCH 018/159] [FIX] (5.0 - 6.0)Account_analytic_default : Invoice creation from SO corected bzr revid: vra@tinyerp.com-20100510132846-2najk2vfxuhxhykc --- addons/account_analytic_default/account_analytic_default.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/account_analytic_default/account_analytic_default.py b/addons/account_analytic_default/account_analytic_default.py index ab81e7d88fc..6ee1a1ce68c 100644 --- a/addons/account_analytic_default/account_analytic_default.py +++ b/addons/account_analytic_default/account_analytic_default.py @@ -103,6 +103,8 @@ class sale_order_line(osv.osv): # Method overridden to set the analytic account by default on criterion match def invoice_line_create(self, cr, uid, ids, context={}): create_ids = super(sale_order_line,self).invoice_line_create(cr, uid, ids, context) + if not ids: + return create_ids sale_line_obj = self.browse(cr, uid, ids[0], context) pool_inv_line = self.pool.get('account.invoice.line') From 0a2641b0df245ce8ce72113af93f760d7234526b Mon Sep 17 00:00:00 2001 From: "JMA (OpenERP)" Date: Mon, 10 May 2010 19:06:34 +0530 Subject: [PATCH 019/159] [FIX] Sale : progressbar for picking should be set when SO is picked 100%(including its procurement is done) bzr revid: jma@tinyerp.com-20100510133634-5djal5mm7lpcukx1 --- addons/sale/sale.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 26f99fc2f96..5a981e24bdc 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -114,7 +114,7 @@ class sale_order(osv.osv): LEFT JOIN mrp_procurement mp on (mp.move_id=m.id) WHERE - p.sale_id = ANY(%s) GROUP BY mp.state, p.sale_id''') + p.sale_id = ANY(%s) GROUP BY mp.state, p.sale_id''',(ids,)) for oid, nbr, mp_state in cr.fetchall(): if mp_state == 'cancel': continue From fdd2745662b88c331dd042708e0cfa196d5da26e Mon Sep 17 00:00:00 2001 From: "Jay(Open ERP)" <> Date: Mon, 10 May 2010 19:17:40 +0530 Subject: [PATCH 020/159] [FIX] (5.0 - 6.0)Account : __compute() optimized a little bzr revid: vra@tinyerp.com-20100510134740-nrjju8va6xbdzaua --- addons/account/account.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/account/account.py b/addons/account/account.py index 607716761dd..c99233c81cd 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -232,6 +232,7 @@ class account_account(osv.osv): # consolidate accounts with direct children + ids2.reverse() brs = list(self.browse(cr, uid, ids2, context=context)) sums = {} while brs: From a6c05c04f86b181c21a7a392250db6a30e4340a6 Mon Sep 17 00:00:00 2001 From: vra Date: Mon, 10 May 2010 19:24:26 +0530 Subject: [PATCH 021/159] =?UTF-8?q?[FIX]=C2=A0(5.0=20-6.0)Locations=C2=A0w?= =?UTF-8?q?hen=C2=A0M2O,should=C2=A0not=C2=A0be=C2=A0among=C2=A0view=C2=A0?= =?UTF-8?q?type--author=3DGPA(OpenEPP)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit bzr revid: vra@tinyerp.com-20100510135426-efb9wllvligbtkr4 --- addons/purchase/purchase.py | 2 +- addons/stock/stock.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index 2bcc62c06ac..2097902b203 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -161,7 +161,7 @@ class purchase_order(osv.osv): "In this case, it will remove the warehouse link and set the customer location." ), 'warehouse_id': fields.many2one('stock.warehouse', 'Warehouse', states={'posted':[('readonly',True)]}), - 'location_id': fields.many2one('stock.location', 'Destination', required=True), + 'location_id': fields.many2one('stock.location', 'Destination', required=True, domain=[('usage','<>','view')]), 'pricelist_id':fields.many2one('product.pricelist', 'Pricelist', required=True, states={'confirmed':[('readonly',True)], 'approved':[('readonly',True)],'done':[('readonly',True)]}, help="The pricelist sets the currency used for this purchase order. It also computes the supplier price for the selected products/quantities."), 'state': fields.selection([('draft', 'Request for Quotation'), ('wait', 'Waiting'), ('confirmed', 'Waiting Supplier Ack'), ('approved', 'Approved'),('except_picking', 'Shipping Exception'), ('except_invoice', 'Invoice Exception'), ('done', 'Done'), ('cancel', 'Cancelled')], 'State', readonly=True, help="The state of the purchase order or the quotation request. A quotation is a purchase order in a 'Draft' state. Then the order has to be confirmed by the user, the state switch to 'Confirmed'. Then the supplier must confirm the order to change the state to 'Approved'. When the purchase order is paid and received, the state becomes 'Done'. If a cancel action occurs in the invoice or in the reception of goods, the state becomes in exception.", select=True), 'order_line': fields.one2many('purchase.order.line', 'order_id', 'Order Lines', states={'approved':[('readonly',True)],'done':[('readonly',True)]}), diff --git a/addons/stock/stock.py b/addons/stock/stock.py index d28effc83c0..54d2035b860 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -2051,9 +2051,9 @@ class stock_warehouse(osv.osv): # 'partner_id': fields.many2one('res.partner', 'Owner'), 'company_id': fields.many2one('res.company','Company',required=True,select=1), 'partner_address_id': fields.many2one('res.partner.address', 'Owner Address'), - 'lot_input_id': fields.many2one('stock.location', 'Location Input', required=True), - 'lot_stock_id': fields.many2one('stock.location', 'Location Stock', required=True), - 'lot_output_id': fields.many2one('stock.location', 'Location Output', required=True), + 'lot_input_id': fields.many2one('stock.location', 'Location Input', required=True, domain=[('usage','<>','view')]), + 'lot_stock_id': fields.many2one('stock.location', 'Location Stock', required=True, domain=[('usage','<>','view')]), + 'lot_output_id': fields.many2one('stock.location', 'Location Output', required=True, domain=[('usage','<>','view')]), } _defaults = { 'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'stock.inventory', context=c), From f2d4f864a27333254bd2847214aa359943e20ece Mon Sep 17 00:00:00 2001 From: "Jay(Open ERP)" <> Date: Mon, 10 May 2010 19:31:11 +0530 Subject: [PATCH 022/159] =?UTF-8?q?[FIX]=C2=A0(5.0=20-=206.0)Account=5Fpay?= =?UTF-8?q?ment=C2=A0:=C2=A0Import=C2=A0of=C2=A0move=C2=A0line=C2=A0should?= =?UTF-8?q?=C2=A0include=C2=A0the=C2=A0date=C2=A0of=C2=A0search=C2=A0due?= =?UTF-8?q?=C2=A0date?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit bzr revid: vra@tinyerp.com-20100510140111-b13w5shtxhp5wcnl --- addons/account_payment/wizard/account_payment_order.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account_payment/wizard/account_payment_order.py b/addons/account_payment/wizard/account_payment_order.py index 001804c9e8a..266dcb535d8 100644 --- a/addons/account_payment/wizard/account_payment_order.py +++ b/addons/account_payment/wizard/account_payment_order.py @@ -104,7 +104,7 @@ class payment_order_create(osv.osv_memory): # Search for move line to pay: domain = [('reconcile_id', '=', False),('account_id.type', '=', 'payable'),('amount_to_pay', '>', 0)] - domain = domain + ['|',('date_maturity','<',search_due_date),('date_maturity','=',False)] + domain = domain + ['|',('date_maturity','<=',search_due_date),('date_maturity','=',False)] line_ids = line_obj.search(cr, uid, domain, context=context) context.update({'line_ids': line_ids}) model_data_ids = mod_obj.search(cr, uid,[('model','=','ir.ui.view'),('name','=','view_create_payment_order_lines')], context=context) From 0398d67493ad4d8dd4f6e0123963e9a32ff7574d Mon Sep 17 00:00:00 2001 From: "Jay(Open ERP)" <> Date: Mon, 10 May 2010 19:38:28 +0530 Subject: [PATCH 023/159] =?UTF-8?q?[FIX](5.0=20-=206.0)=C2=A0Account=C2=A0?= =?UTF-8?q?:=C2=A0code=C2=A0improved=C2=A0for=C2=A0move=C2=A0line=C2=A0cre?= =?UTF-8?q?ation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit bzr revid: vra@tinyerp.com-20100510140828-o5w5yyd4wegw4uc2 --- addons/account/account_move_line.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index 30d4dea9300..6b88b0e7862 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -941,7 +941,7 @@ class account_move_line(osv.osv): if not ok: raise osv.except_osv(_('Bad account !'), _('You can not use this general account in this journal !')) - if 'analytic_account_id' in vals and vals['analytic_account_id']: + if vals.get('analytic_account_id',False): if journal.analytic_journal_id: vals['analytic_lines'] = [(0,0, { 'name': vals['name'], From cea2b3cf11bfcda8e505ab1b13ac2cce4fa08b33 Mon Sep 17 00:00:00 2001 From: "GPA(OpenEPR)" <> Date: Tue, 11 May 2010 11:05:06 +0530 Subject: [PATCH 024/159] [FIX] (5.0 - 6.0)mrp_subproduct : Corrected action_confirm method bzr revid: vra@tinyerp.com-20100511053506-emfbi93ndt1hoxlf --- addons/mrp_subproduct/mrp_subproduct.py | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/addons/mrp_subproduct/mrp_subproduct.py b/addons/mrp_subproduct/mrp_subproduct.py index 22ae9c44bec..3549398c4f3 100644 --- a/addons/mrp_subproduct/mrp_subproduct.py +++ b/addons/mrp_subproduct/mrp_subproduct.py @@ -59,18 +59,20 @@ class mrp_production(osv.osv): _inherit= 'mrp.production' def action_confirm(self, cr, uid, ids): - picking_id=super(mrp_production,self).action_confirm(cr, uid, ids) - for production in self.browse(cr, uid, ids): - source = production.product_id.product_tmpl_id.property_stock_production.id - for sub_product in production.bom_id.sub_products: - qty1 = sub_product.product_qty - qty2 = production.product_uos and production.product_uos_qty or False - if sub_product.subproduct_type=='variable': + picking_id=super(mrp_production,self).action_confirm(cr, uid, ids) + for production in self.browse(cr, uid, ids): + source = production.product_id.product_tmpl_id.property_stock_production.id + if not production.bom_id: + continue + for sub_product in production.bom_id.sub_products: + qty1 = sub_product.product_qty + qty2 = production.product_uos and production.product_uos_qty or False + if sub_product.subproduct_type=='variable': if production.product_qty: qty1 *= production.product_qty / (production.bom_id.product_qty or 1.0) if production.product_uos_qty: qty2 *= production.product_uos_qty / (production.bom_id.product_uos_qty or 1.0) - data = { + data = { 'name':'PROD:'+production.name, 'date_planned': production.date_planned, 'product_id': sub_product.product_id.id, @@ -83,9 +85,9 @@ class mrp_production(osv.osv): 'move_dest_id': production.move_prod_id.id, 'state': 'waiting', 'production_id':production.id - } - sub_prod_ids=self.pool.get('stock.move').create(cr, uid,data) - return picking_id + } + sub_prod_ids=self.pool.get('stock.move').create(cr, uid,data) + return picking_id mrp_production() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: From a238492db88724bbe6317ea3b6de0fe98f82d51b Mon Sep 17 00:00:00 2001 From: gpa Date: Tue, 11 May 2010 11:19:08 +0530 Subject: [PATCH 025/159] [IMP] Account : Fiscalyear and Period now have name_search bzr revid: gpa@tinyerp.com-20100511054908-ot3sbwbyzpjd8s48 --- addons/account/account.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/addons/account/account.py b/addons/account/account.py index c99233c81cd..da82baec541 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -631,6 +631,19 @@ class account_fiscalyear(osv.osv): else: return False return ids[0] + + def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=80): + if args is None: + args = [] + if context is None: + context = {} + ids = [] + if name: + ids = self.search(cr, user, [('code','ilike',name)]+ args, limit=limit) + if not ids: + ids = self.search(cr, user, [('name',operator,name)]+ args, limit=limit) + return self.name_get(cr, user, ids, context=context) + account_fiscalyear() class account_period(osv.osv): @@ -706,6 +719,18 @@ class account_period(osv.osv): cr.execute('update account_journal_period set state=%s where period_id=%s', (mode, id)) cr.execute('update account_period set state=%s where id=%s', (mode, id)) return True + + def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=80): + if args is None: + args = [] + if context is None: + context = {} + ids = [] + if name: + ids = self.search(cr, user, [('code','ilike',name)]+ args, limit=limit) + if not ids: + ids = self.search(cr, user, [('name',operator,name)]+ args, limit=limit) + return self.name_get(cr, user, ids, context=context) account_period() From d40110a40fccf2f82c69cd2444aabd7927c46a68 Mon Sep 17 00:00:00 2001 From: "Jay(Open ERP)" <> Date: Tue, 11 May 2010 11:24:09 +0530 Subject: [PATCH 026/159] [FIX] (5.0 - 6.0)Purchase : Merge PO should consider fiscal position bzr revid: vra@tinyerp.com-20100511055409-ayg9yaxl25yz15st --- addons/purchase/purchase.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index 2097902b203..05cf316f9ad 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -515,6 +515,7 @@ class purchase_order(osv.osv): 'state': 'draft', 'order_line': {}, 'notes': '%s' % (porder.notes or '',), + 'fiscal_position': porder.fiscal_position and porder.fiscal_position.id or False, }) else: #order_infos['name'] += ', %s' % porder.name From f3b050a4a7b03d5b210f1902787a0d6dc6a85fd3 Mon Sep 17 00:00:00 2001 From: gpa Date: Tue, 11 May 2010 11:25:58 +0530 Subject: [PATCH 027/159] [FIX] Account : Only those accounts are eligible to be Parents which have type=View bzr revid: gpa@tinyerp.com-20100511055558-31b0nt9c7bmh47ye --- addons/account/account.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/account.py b/addons/account/account.py index da82baec541..17e753b4352 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -295,7 +295,7 @@ class account_account(osv.osv): 'user_type': fields.many2one('account.account.type', 'Account Type', required=True, help="These types are defined according to your country. The type contains more information "\ "about the account and its specificities."), - 'parent_id': fields.many2one('account.account', 'Parent', ondelete='cascade'), + 'parent_id': fields.many2one('account.account', 'Parent', ondelete='cascade', domain=[('type','=','view')]), 'child_parent_ids': fields.one2many('account.account','parent_id','Children'), 'child_consol_ids': fields.many2many('account.account', 'account_account_consol_rel', 'child_id', 'parent_id', 'Consolidated Children'), 'child_id': fields.function(_get_child_ids, method=True, type='many2many', relation="account.account", string="Child Accounts"), From 3063846d3e4913aa51d84908799796ad2c1ff816 Mon Sep 17 00:00:00 2001 From: gpa Date: Tue, 11 May 2010 11:59:04 +0530 Subject: [PATCH 028/159] [FIX] sale: move the product_uos_qty and product_uos fields to the main tab to avoid the issue with the group_extended on the "Extra Info" tab ( thanks to Numerigraphe bzr revid: gpa@tinyerp.com-20100511062904-icpboguat26dwr9a --- addons/sale/sale_view.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/sale/sale_view.xml b/addons/sale/sale_view.xml index 0c5a1252d59..dec4ae315dc 100644 --- a/addons/sale/sale_view.xml +++ b/addons/sale/sale_view.xml @@ -131,6 +131,8 @@ select="1"/> + + - - From 68737dfd09b87ea94d055a339c143fe7ebf68f4a Mon Sep 17 00:00:00 2001 From: gpa Date: Tue, 11 May 2010 12:31:38 +0530 Subject: [PATCH 029/159] [FIX] Document : It should be allowed to browse through FTP,disregard to --no-databse-list option bzr revid: gpa@tinyerp.com-20100511070138-xy7s91dyvamlx0m0 --- addons/document_ftp/ftpserver/abstracted_fs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/document_ftp/ftpserver/abstracted_fs.py b/addons/document_ftp/ftpserver/abstracted_fs.py index 0ffa8eb80f2..59f11eb20d5 100644 --- a/addons/document_ftp/ftpserver/abstracted_fs.py +++ b/addons/document_ftp/ftpserver/abstracted_fs.py @@ -123,7 +123,7 @@ class abstracted_fs: def db_list(self): #return pooler.pool_dic.keys() s = netsvc.ExportService.getService('db') - result = s.exp_list() + result = s.exp_list(document=True) self.db_name_list = [] for db_name in result: db, cr = None, None From e70dd4a5a43cb9ef4822f8f07fe967fafd058823 Mon Sep 17 00:00:00 2001 From: gpa Date: Tue, 11 May 2010 12:45:29 +0530 Subject: [PATCH 030/159] [FIX] hr_timesheet_sheet: Add a default value for the context keyword bzr revid: gpa@tinyerp.com-20100511071529-78miiuyibt8gyvvm --- addons/hr_timesheet_sheet/hr_timesheet_sheet.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py index b7d395ac2e0..b6078648147 100644 --- a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py +++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py @@ -364,7 +364,7 @@ class hr_timesheet_line(osv.osv): res[line_id] = False return res - def _sheet_search(self, cursor, user, obj, name, args, context): + def _sheet_search(self, cursor, user, obj, name, args, context=None): if not len(args): return [] sheet_obj = self.pool.get('hr_timesheet_sheet.sheet') @@ -482,7 +482,7 @@ class hr_attendance(osv.osv): res[line_id] = False return res - def _sheet_search(self, cursor, user, obj, name, args, context={}): + def _sheet_search(self, cursor, user, obj, name, args, context=None): if not len(args): return [] sheet_obj = self.pool.get('hr_timesheet_sheet.sheet') From 57d761fc650c8dc624c57913befbb530c4c6e848 Mon Sep 17 00:00:00 2001 From: "JMA (OpenERP)" Date: Tue, 11 May 2010 12:56:42 +0530 Subject: [PATCH 031/159] [FIX] Account : Account should not be removed/deactivated if it is linked to any property/partner bzr revid: jma@tinyerp.com-20100511072642-lbai9yw8tnn1kg6z --- addons/account/account.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/addons/account/account.py b/addons/account/account.py index 17e753b4352..2c29d202b3a 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -432,11 +432,17 @@ class account_account(osv.osv): def _check_moves(self, cr, uid, ids, method, context): line_obj = self.pool.get('account.move.line') account_ids = self.search(cr, uid, [('id', 'child_of', ids)]) + if line_obj.search(cr, uid, [('account_id', 'in', account_ids)]): if method == 'write': raise osv.except_osv(_('Error !'), _('You cannot deactivate an account that contains account moves.')) elif method == 'unlink': raise osv.except_osv(_('Error !'), _('You cannot remove an account which has account entries!. ')) + #Checking whether the account is set as a property to any Partner or not + value = 'account.account,' + str(ids[0]) + partner_prop_acc = self.pool.get('ir.property').search(cr, uid, [('value_reference','=',value)], context=context) + if partner_prop_acc: + raise osv.except_osv(_('Warning !'), _('You cannot remove/deactivate an account which is set as a property to any Partner.')) return True def _check_allow_type_change(self, cr, uid, ids, new_type, context): From 5a558b6b1034593b8c71deeda96db7e8dd5329c3 Mon Sep 17 00:00:00 2001 From: "Anup (OpenERP)" Date: Tue, 11 May 2010 13:08:57 +0530 Subject: [PATCH 032/159] [FIX] smtp-client : if no email-from specified in the Server it must take the one in the config file or given from the server terminal bzr revid: ach@tinyerp.com-20100511073857-6vjxmknnq0l13nhu --- addons/smtpclient/smtpclient.py | 202 +++++++++++++++++--------------- 1 file changed, 107 insertions(+), 95 deletions(-) diff --git a/addons/smtpclient/smtpclient.py b/addons/smtpclient/smtpclient.py index 6b0a2393cd1..e9c6d801279 100644 --- a/addons/smtpclient/smtpclient.py +++ b/addons/smtpclient/smtpclient.py @@ -1,5 +1,5 @@ ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (). # @@ -14,7 +14,7 @@ # 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 . +# along with this program. If not, see . # ############################################################################## @@ -64,7 +64,7 @@ class smtpclient(osv.osv): _name = 'email.smtpclient' _description = 'Email Client' - + _columns = { 'name' : fields.char('Server Name', size=256, required=True), 'from_email' : fields.char('Email From', size=256), @@ -109,10 +109,10 @@ class smtpclient(osv.osv): ],'Server Statue', select=True, readonly=True), 'delete_queue_period': fields.integer('Delete after', help="delete emails/contents from email queue after specified no of days"), } - + def _get_users(self, cr, uid, context={}): return self.pool.get('res.users').search(cr, uid, []) - + _defaults = { 'date_create': lambda *a: time.strftime('%Y-%m-%d'), 'state': lambda *a: 'new', @@ -127,17 +127,17 @@ class smtpclient(osv.osv): 'users_id': _get_users, 'verify_email': lambda *a: _("Verification Message. This is the code\n\n__code__\n\nyou must copy in the OpenERP Email Server (Verify Server wizard).\n\nCreated by user __user__"), } - + server = {} smtpServer = {} - + def create(self, cr, user, vals, context={}): if vals.get('password', False) != False: vals['password'] = base64.b64encode(vals.get('password')) - + res_id = super(smtpclient, self).create(cr, user, vals, context) return res_id - + def write(self, cr, user, ids, vals, context=None): flag = False if vals.get('password', False) != False: @@ -146,14 +146,14 @@ class smtpclient(osv.osv): flag= True break - if flag: + if flag: vals['password'] = base64.b64encode(vals.get('password')) else: - del vals['password'] - + del vals['password'] + res = super(smtpclient, self).write(cr, user, ids, vals, context) return res - + def read(self,cr, uid, ids, fields=None, context=None, load='_classic_read'): def override_password(o): if len(o) > 0: @@ -165,7 +165,7 @@ class smtpclient(osv.osv): result = super(smtpclient, self).read(cr, uid, ids, fields, context, load) result = override_password(result) return result - + def change_servertype(self, cr, uid, ids, server): if server == 'gmail': return {'value':{'server':'smtp.gmail.com', 'port':'25', 'ssl':True, 'auth':True}} @@ -173,7 +173,7 @@ class smtpclient(osv.osv): return {'value':{'server':'smtp.mail.yahoo.co.in', 'ssl':False, 'port':'587', 'auth':True}} else: return {'value':{'server':'localhost', 'port':'25', 'ssl':False, 'auth':False}} - + def change_email(self, cr, uid, ids, email): email_from = self.pool.get('res.users').browse(cr, uid, uid).name if len(email) > 0 and email.find('@') > -1 and email.index('@') > 0: @@ -206,22 +206,22 @@ class smtpclient(osv.osv): key = ''.join(new_key) return key - + def _set_error(self, cr, uid, server_id, context={}): server_obj = self.browse(cr, uid, server_id) if not server_obj.active: return 'not_active' if server_obj.pstate == 'stop' : - return 'server_stop' + return 'server_stop' if server_obj.state != 'confirm': return 'server_not_confirm' return True def test_verify_email(self, cr, uid, ids, toemail, test=False, code=False): - + serverid = ids[0] self.open_connection(cr, uid, ids, serverid) - + key = False if test and self.server[serverid]['state'] == 'confirm': body = self.server[serverid]['test_email'] or '' @@ -230,33 +230,38 @@ class smtpclient(osv.osv): #ignore the code key = self.gen_private_key(cr, uid, ids) #md5(time.strftime('%Y-%m-%d %H:%M:%S') + toemail).hexdigest(); - + body = body.replace("__code__", key) - + user = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, [uid])[0] body = body.replace("__user__", user.name) - + if len(body.strip()) <= 0: raise osv.except_osv(_('Message Error!'), _('Please configure Email Server Messages [Verification / Test]')) - + try: msg = MIMEText(body.encode('utf8') or '',_subtype='plain',_charset='utf-8') except: msg = MIMEText(body or '',_subtype='plain',_charset='utf-8') - + if not test and not self.server[serverid]['state'] == 'confirm': msg['Subject'] = _('OpenERP SMTP server Email Registration Code!') else: msg['Subject'] = _('OpenERP Test Email!') - + msg['To'] = toemail - msg['From'] = tools.ustr(self.server[serverid]['from_email']) - + if context.get('email_from', self.server[serverid]['from_email']): + msg['From'] = context.get('email_from', self.server[serverid]['from_email']) + elif tools.config['email_from']: + msg['From'] = tools.config['email_from'] + else: + raise osv.except_osv(_('Error'), _("Please specify server option --email-from !")) + message = msg.as_string() - + if self.server[serverid]['disclaimers']: body = body + "\n" + self.server[serverid]['disclaimers'] - + queue = pooler.get_pool(cr.dbname).get('email.smtpclient.queue') queue.create(cr, uid, { 'to':toemail, @@ -267,12 +272,12 @@ class smtpclient(osv.osv): 'priority':1, 'type':'system' }) - + if self.server[serverid]['state'] != 'confirm': self.write(cr, uid, ids, {'state':'waiting', 'code':key}) - + return True - + def getpassword(self, cr, uid, ids): data = {} cr.execute("select * from email_smtpclient where id = %s" , (str(ids[0]),)) @@ -284,40 +289,40 @@ class smtpclient(osv.osv): self.server[serverid] = self.getpassword(cr, uid, [serverid])[0] else: raise osv.except_osv(_('Read Error!'), _('Unable to read Server Settings')) - + if permission: if not self.check_permissions(cr, uid, [serverid]): raise osv.except_osv(_('Permission Error!'), _('You have no permission to access SMTP Server : %s ') % (self.server[serverid]['name'],) ) - + if self.server[serverid]: try: self.smtpServer[serverid] = smtplib.SMTP() self.smtpServer[serverid].debuglevel = 0 self.smtpServer[serverid].connect(str(self.server[serverid]['server']),str(self.server[serverid]['port'])) - + if self.server[serverid]['ssl']: self.smtpServer[serverid].ehlo() self.smtpServer[serverid].starttls() self.smtpServer[serverid].ehlo() - + if self.server[serverid]['auth']: password = self.server[serverid]['password'] try: password = base64.b64decode(password) except: - pass + pass self.smtpServer[serverid].login(str(self.server[serverid]['user']), password) except Exception, e: logger.notifyChannel('imap', netsvc.LOG_WARNING, e) - + return True - + def selectAddress(self, cr, uid, partner=None, contact=None, ): email = 'none@none.com' if partner is None and contact is None: return 'none@none.com' - + if partner is not None and contact is None: pool = self.pool.get('res.partner') data = pool.read(cr, uid, [partner])[0] @@ -328,26 +333,26 @@ class smtpclient(osv.osv): pool = self.pool.get('res.partner.address') data = pool.read(cr, uid, contact)[0] email = data['email'] - + return email - + def select(self, cr, uid, type): pool = self.pool.get('email.smtpclient') ids = pool.search(cr, uid, [('type','=',type)], context=False) if not ids: ids = pool.search(cr, uid, [('type','=','default')], context=False) - + if not ids: return False - + return ids[0] - + # Reports is a list of tuples,where first arguement of tuple is the name of the report,second is the list of ids of the object def send_email(self, cr, uid, server_id, emailto, subject, body='', attachments=[], reports=[], ir_attach=[], charset='utf-8', headers={}, context={}): - + if not emailto: raise osv.except_osv(_('SMTP Data Error !'), _('Email TO Address not Defined !')) - + def createReport(cr, uid, report, ids, name=False): files = [] for id in ids: @@ -358,26 +363,26 @@ class smtpclient(osv.osv): report_file = '/tmp/reports'+ str(id) + '.pdf' else: report_file = name - + fp = open(report_file,'wb+') fp.write(result); fp.close(); - files += [report_file] + files += [report_file] except Exception,e: - continue + continue return files - + smtp_server = self.browse(cr, uid, server_id) if smtp_server.state != 'confirm': raise osv.except_osv(_('SMTP Server Error !'), _('Server is not Verified, Please Verify the Server !')) - + if not subject: subject = "OpenERP Email: [Unknown Subject]" - + try: subject = subject.encode(charset) except: - subject = subject.decode() + subject = subject.decode() #attachment from Reports for rpt in reports: @@ -386,7 +391,7 @@ class smtpclient(osv.osv): elif len(rpt) == 2: rpt_file = createReport(cr, uid, rpt[0], rpt[1]) attachments += rpt_file - + if isinstance(emailto, str) or isinstance(emailto, unicode): emailto = [emailto] @@ -394,44 +399,51 @@ class smtpclient(osv.osv): for to in emailto: msg = MIMEMultipart() - msg['Subject'] = tools.ustr(subject) + msg['Subject'] = tools.ustr(subject) msg['To'] = to - msg['From'] = context.get('email_from', smtp_server.from_email) - + print "::context.get('email_from', smtp_server.from_email):::",context.get('email_from', smtp_server.from_email) + print "::TOOOLL::",tools.config['email_from'] + if context.get('email_from', smtp_server.from_email): + msg['From'] = context.get('email_from', smtp_server.from_email) + elif tools.config['email_from']: + msg['From'] = tools.config['email_from'] + else: + raise osv.except_osv(_('Error'), _("Please specify server option --email-from !")) + print ":: 1: message = "sending %s emails from message queuq !" % (len(ids)) logger.notifyChannel('smtp', netsvc.LOG_INFO, message) - + result = self. _send_emails(cr, uid, sids, {}) return result - + def set_to_draft(self, cr, uid, ids, context={}): self.stop_process(cr, uid, ids, context) self.write(cr, uid, ids, {'state':'new', 'code':False}) return True - + def create_process(self, cr, uid, ids, context={}): svr = self.browse(cr, uid, ids[0]) if not svr.process_id: res = { 'name':'Process : ' + svr.name, 'model':'email.smtpclient', - 'args': repr([ids]), + 'args': repr([ids]), 'function':'_check_queue', 'priority':5, 'interval_number':1, @@ -572,9 +584,9 @@ class smtpclient(osv.osv): } id = self.pool.get('ir.cron').create(cr, uid, res) self.write(cr, uid, ids, {'process_id':id}) - + return True - + def start_process(self, cr, uid, ids, context={}): process = self.browse(cr, uid, ids[0], context) if not process.process_id or process.state != 'confirm': @@ -584,7 +596,7 @@ class smtpclient(osv.osv): self.pool.get('ir.cron').write(cr, uid, [pid], {'active':True}) self.write(cr, uid, ids, {'pstate':'running'}) return True - + def stop_process(self, cr, uid, ids, context={}): pid = self.browse(cr, uid, ids[0], context).process_id.id self.pool.get('ir.cron').write(cr, uid, [pid], {'active':False}) @@ -617,12 +629,12 @@ class email_history(osv.osv): 'resource_id':fields.integer('Resource ID', readonly=True), 'email':fields.char('Email',size=64,readonly=True), } - + _defaults = { 'date_create': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'), 'user_id': lambda obj, cr, uid, context: uid, } - + def create(self, cr, uid, vals, context=None): super(email_history,self).create(cr, uid, vals, context) cr.commit() @@ -678,7 +690,7 @@ class report_smtp_server(osv.osv): select min(h.id) as id, c.id as server_id, h.name as history, h.name as name, count(h.name) as no from email_smtpclient c inner join email_smtpclient_history h on c.id=h.server_id group by h.name, c.id ) """) - + report_smtp_server() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: From 609058edda3ef483b46de9f5cb61bb3c1485b4b9 Mon Sep 17 00:00:00 2001 From: "JMA (OpenERP)" Date: Tue, 11 May 2010 13:19:16 +0530 Subject: [PATCH 033/159] [FIX] Stock : drop view check added for stock_report_prodlots bzr revid: jma@tinyerp.com-20100511074916-hnyftvq9cho4wq1f --- addons/stock/report/report_stock.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/addons/stock/report/report_stock.py b/addons/stock/report/report_stock.py index da1dd27ff14..3e7fe147c73 100644 --- a/addons/stock/report/report_stock.py +++ b/addons/stock/report/report_stock.py @@ -22,6 +22,7 @@ from osv import osv, fields from tools.translate import _ import tools +from tools.sql import drop_view_if_exists # # Check if it works with UoM ??? @@ -38,7 +39,7 @@ class stock_report_prodlots(osv.osv): } def init(self, cr): - tools.drop_view_if_exists(cr, 'stock_report_prodlots') + drop_view_if_exists(cr, 'stock_report_prodlots') cr.execute(""" create or replace view stock_report_prodlots as ( select max(id) as id, @@ -94,7 +95,7 @@ class stock_report_tracklots(osv.osv): } def init(self, cr): - tools.drop_view_if_exists(cr, 'stock_report_tracklots') + drop_view_if_exists(cr, 'stock_report_prodlots') cr.execute(""" create or replace view stock_report_tracklots as ( @@ -149,7 +150,7 @@ class report_stock_lines_date(osv.osv): 'date': fields.datetime('Latest Inventory Date'), } def init(self, cr): - tools.drop_view_if_exists(cr, 'report_stock_lines_date') + drop_view_if_exists(cr, 'stock_report_prodlots') cr.execute(""" create or replace view report_stock_lines_date as ( select From 9a8d8ef7caae2bb2013538e05770f2a6433360e1 Mon Sep 17 00:00:00 2001 From: gpa Date: Tue, 11 May 2010 13:58:56 +0530 Subject: [PATCH 034/159] [MERGE] merge donkirkby's patch to re-enable purchase module smoke test bzr revid: gpa@tinyerp.com-20100511082856-fa5dgasx3xou1lg6 --- addons/purchase/__openerp__.py | 2 +- addons/purchase/purchase_unit_test.xml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/purchase/__openerp__.py b/addons/purchase/__openerp__.py index 6687b330b2c..af16b3776ca 100644 --- a/addons/purchase/__openerp__.py +++ b/addons/purchase/__openerp__.py @@ -50,7 +50,7 @@ 'process/purchase_process.xml', 'report/purchase_report_view.xml', ], - 'demo_xml': ['purchase_demo.xml'], + 'demo_xml': ['purchase_demo.xml','purchase_unit_test.xml'], 'installable': True, 'active': False, 'certificate': '0057234283549', diff --git a/addons/purchase/purchase_unit_test.xml b/addons/purchase/purchase_unit_test.xml index 890062a66b9..00678589999 100644 --- a/addons/purchase/purchase_unit_test.xml +++ b/addons/purchase/purchase_unit_test.xml @@ -8,7 +8,7 @@ - + @@ -63,10 +63,10 @@ - + - + From df052074ea409a0307619cb476a88facaf69c3b4 Mon Sep 17 00:00:00 2001 From: "JMA (OpenERP)" Date: Tue, 11 May 2010 14:04:48 +0530 Subject: [PATCH 035/159] [FIX] Base_contact : search() of job improved bzr revid: jma@tinyerp.com-20100511083448-t66yybkz4iqixvaq --- addons/base_contact/base_contact.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/base_contact/base_contact.py b/addons/base_contact/base_contact.py index 9b4cc656acc..187d2d47863 100644 --- a/addons/base_contact/base_contact.py +++ b/addons/base_contact/base_contact.py @@ -208,6 +208,8 @@ class res_partner_job(osv.osv): if arg[2] and not count: search_arg = ['|', ('first_name', 'ilike', arg[2]), ('name', 'ilike', arg[2])] contact_ids = contact_obj.search(cr, user, search_arg, offset=offset, limit=limit, order=order, context=context, count=count) + if not contact_ids: + continue contacts = contact_obj.browse(cr, user, contact_ids, context=context) for contact in contacts: job_ids.extend([item.id for item in contact.job_ids]) From 1c9807f70b4e2f321ef5562b53e31aef0f0b6aee Mon Sep 17 00:00:00 2001 From: Stephane Wirtel <> Date: Tue, 11 May 2010 14:21:06 +0530 Subject: [PATCH 036/159] [MERGE] (5.0 - 6.0)lp:~qdp/openobject-addons/5.0-l10nbe-intervat5.1.0-compliancy:2695 bzr revid: vra@tinyerp.com-20100511085106-w4yt3hhnkzfbdyuc --- addons/account/account_bank_statement.py | 45 +++++++++++++----------- 1 file changed, 25 insertions(+), 20 deletions(-) diff --git a/addons/account/account_bank_statement.py b/addons/account/account_bank_statement.py index deb010c7cd0..65c08565bd5 100644 --- a/addons/account/account_bank_statement.py +++ b/addons/account/account_bank_statement.py @@ -558,35 +558,40 @@ class account_bank_statement_line(osv.osv): def onchange_partner_id(self, cursor, user, line_id, partner_id, type, currency_id, context={}): + res = {'value': {}} if not partner_id: - return {} - res_currency_obj = self.pool.get('res.currency') - res_users_obj = self.pool.get('res.users') - - company_currency_id = res_users_obj.browse(cursor, user, user, - context=context).company_id.currency_id.id - - if not currency_id: - currency_id = company_currency_id - - part = self.pool.get('res.partner').browse(cursor, user, partner_id, + return res + line = self.browse(cursor, user, line_id) + + if not line or (line and not line[0].account_id): + part = self.pool.get('res.partner').browse(cursor, user, partner_id, context=context) - if type == 'supplier': - account_id = part.property_account_payable.id - else: - account_id = part.property_account_receivable.id + if type == 'supplier': + account_id = part.property_account_payable.id + else: + account_id = part.property_account_receivable.id + res['value']['account_id'] = account_id - cursor.execute('SELECT sum(debit-credit) \ + if not line or (line and not line[0].amount): + res_users_obj = self.pool.get('res.users') + res_currency_obj = self.pool.get('res.currency') + company_currency_id = res_users_obj.browse(cursor, user, user, + context=context).company_id.currency_id.id + if not currency_id: + currency_id = company_currency_id + + cursor.execute('SELECT sum(debit-credit) \ FROM account_move_line \ WHERE (reconcile_id is null) \ AND partner_id = %s \ AND account_id=%s', (partner_id, account_id)) - res = cursor.fetchone() - balance = res and res[0] or 0.0 + pgres = cursor.fetchone() + balance = pgres and pgres[0] or 0.0 - balance = res_currency_obj.compute(cursor, user, company_currency_id, + balance = res_currency_obj.compute(cursor, user, company_currency_id, currency_id, balance, context=context) - return {'value': {'amount': balance, 'account_id': account_id}} + res['value']['amount'] = balance + return res def _reconcile_amount(self, cursor, user, ids, name, args, context=None): if not ids: From 7590cf21ec2d744c2a26c94835820b943d6337fa Mon Sep 17 00:00:00 2001 From: "JMA (OpenERP)" Date: Tue, 11 May 2010 14:27:20 +0530 Subject: [PATCH 037/159] [FIX] Sale_crm : proper options set on wizard makesale bzr revid: jma@tinyerp.com-20100511085720-6zpcvisdo9z1knjy --- addons/sale_crm/wizard/makesale.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sale_crm/wizard/makesale.py b/addons/sale_crm/wizard/makesale.py index c6dc12abf11..a31d987e4b5 100644 --- a/addons/sale_crm/wizard/makesale.py +++ b/addons/sale_crm/wizard/makesale.py @@ -44,7 +44,7 @@ sale_fields = { 'relation': 'res.partner', 'help': 'Use this partner if there is no partner on the case'}, 'picking_policy': {'string': 'Picking Policy', 'type': 'selection', - 'selection': [('direct','Direct Delivery'),('one','All at once')]}, + 'selection': [('direct', 'Partial Delivery'), ('one', 'Complete Delivery')]}, 'products': {'string': 'Products', 'type': 'many2many', 'relation': 'product.product'}, 'analytic_account': {'string': 'Analytic Account', 'type': 'many2one', From 123cb46c6c36bc22eea1bbce33dc5fdf41dfa579 Mon Sep 17 00:00:00 2001 From: "Jay (OpenERP)" <> Date: Tue, 11 May 2010 14:45:36 +0530 Subject: [PATCH 038/159] =?UTF-8?q?[FIX]=C2=A0(5.0=20-=206.0)Mrp=5Frepair?= =?UTF-8?q?=C2=A0:=C2=A0Corrected=C2=A0make=C2=A0invoice=C2=A0process?= =?UTF-8?q?=C2=A0and=C2=A0Quotation=C2=A0report?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit bzr revid: vra@tinyerp.com-20100511091536-vroh7w7yr2cmo33s --- addons/mrp_repair/mrp_repair.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/addons/mrp_repair/mrp_repair.py b/addons/mrp_repair/mrp_repair.py index f59da6a751c..3cff3741c7d 100644 --- a/addons/mrp_repair/mrp_repair.py +++ b/addons/mrp_repair/mrp_repair.py @@ -346,12 +346,14 @@ class mrp_repair(osv.osv): } invoice_obj.write(cr, uid, [inv_id], invoice_vals, context=context) else: - a = repair.partner_id.property_account_receivable.id + if not repair.partner_id.property_account_receivable: + raise osv.except_osv(_('Error !'), _('No account defined for partner "%s".') % repair.partner_id.name ) + account_id = repair.partner_id.property_account_receivable.id inv = { 'name': repair.name, 'origin':repair.name, 'type': 'out_invoice', - 'account_id': a, + 'account_id': account_id, 'partner_id': repair.partner_id.id, 'address_invoice_id': repair.address_id.id, 'currency_id': repair.pricelist_id.currency_id.id, @@ -368,11 +370,19 @@ class mrp_repair(osv.osv): name = repair.name + '-' + operation.name else: name = operation.name + + if operation.product_id.property_account_income: + account_id = operation.product_id.property_account_income + elif operation.product_id.categ_id.property_account_income_categ: + account_id = operation.product_id.categ_id.property_account_income_categ.id + else: + raise osv.except_osv(_('Error !'), _('No account defined for product "%s".') % operation.product_id.name ) + invoice_line_id = inv_line_obj.create(cr, uid, { 'invoice_id': inv_id, 'name': name, 'origin': repair.name, - 'account_id': operation.product_id and operation.product_id.property_account_income and operation.product_id.property_account_income.id, + 'account_id': account_id, 'quantity': operation.product_uom_qty, 'invoice_line_tax_id': [(6,0,[x.id for x in operation.tax_id])], 'uos_id': operation.product_uom.id, From 9f31cb419c4813367d2423edb42cd29e36c49cbc Mon Sep 17 00:00:00 2001 From: gpa Date: Tue, 11 May 2010 14:47:05 +0530 Subject: [PATCH 039/159] [FIX] Stock :Picking removal should remove moves too bzr revid: gpa@tinyerp.com-20100511091705-7uqknh1fkk12w5uz --- addons/stock/stock.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 54d2035b860..d96ce2da63d 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -859,15 +859,23 @@ class stock_picking(osv.osv): return True def unlink(self, cr, uid, ids, context=None): + move_obj = self.pool.get('stock.move') + if not context: + context = {} + for pick in self.browse(cr, uid, ids, context=context): if pick.state in ['done','cancel']: raise osv.except_osv(_('Error'), _('You cannot remove the picking which is in %s state !')%(pick.state,)) - elif pick.state in ['confirmed','assigned']: + elif pick.state in ['confirmed','assigned', 'draft']: ids2 = [move.id for move in pick.move_lines] - context.update({'call_unlink':True}) - self.pool.get('stock.move').action_cancel(cr, uid, ids2, context) - else: - continue + ctx = context.copy() + ctx.update({'call_unlink':True}) + if pick.state != 'draft': + #Cancelling the move in order to affect Virtual stock of product + move_obj.action_cancel(cr, uid, ids2, ctx) + #Removing the move + move_obj.unlink(cr, uid, ids2, ctx) + return super(stock_picking, self).unlink(cr, uid, ids, context=context) def do_partial(self, cr, uid, ids, partial_datas, context={}): From f2630754c0e1fc0b61e2a3f7dca72ddf9608c8c6 Mon Sep 17 00:00:00 2001 From: "GPA(OpenERP)" <> Date: Tue, 11 May 2010 15:06:38 +0530 Subject: [PATCH 040/159] =?UTF-8?q?[FIX]=C2=A0(5.0=20-=206.0)Membership?= =?UTF-8?q?=C2=A0:=C2=A0Copy()=C2=A0overridden=C2=A0for=C2=A0setting=C2=A0?= =?UTF-8?q?membership=C2=A0lines=C2=A0blank?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit bzr revid: vra@tinyerp.com-20100511093638-55kukxvwmhvulhqw --- addons/membership/membership.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/addons/membership/membership.py b/addons/membership/membership.py index 8c15c652335..2a7c998b86b 100644 --- a/addons/membership/membership.py +++ b/addons/membership/membership.py @@ -412,7 +412,16 @@ class Partner(osv.osv): _constraints = [ (_check_recursion, 'Error ! You can not create recursive associated members.', ['associate_member']) ] - + + def copy(self, cr, uid, id, default=None, context=None): + if default is None: + default = {} + if context is None: + context = {} + default = default.copy() + default['member_lines'] = [] + return super(Partner, self).copy(cr, uid, id, default, context) + Partner() class product_template(osv.osv): From 86f0a1863d06a0ec913f88b084d2bb60f947f327 Mon Sep 17 00:00:00 2001 From: gpa Date: Tue, 11 May 2010 15:11:11 +0530 Subject: [PATCH 041/159] [FIX] MRP : stock.warehouse.orderpoint for qty_multiple check of 0 bzr revid: gpa@tinyerp.com-20100511094111-0yqcc8bahc51gcef --- addons/mrp/stock.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/mrp/stock.py b/addons/mrp/stock.py index 4a35d6003cf..00c6abe9264 100644 --- a/addons/mrp/stock.py +++ b/addons/mrp/stock.py @@ -62,6 +62,9 @@ class stock_warehouse_orderpoint(osv.osv): 'product_uom': lambda sel, cr, uid, context: context.get('product_uom', False), 'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'stock.warehouse.orderpoint', context=c) } + _sql_constraints = [ + ('qty_multiple_check', 'CHECK( qty_multiple > 0 )', _('Qty Multiple must be greater than zero.')), + ] def onchange_warehouse_id(self, cr, uid, ids, warehouse_id, context={}): """ Finds location id for changed warehouse. From f2ee21bc8725b1d69b176d44233f6629ac8894b1 Mon Sep 17 00:00:00 2001 From: "Jay(Open ERP)" <> Date: Tue, 11 May 2010 15:19:15 +0530 Subject: [PATCH 042/159] [FIX] (5.0 - 6.0)account_analytic_plans : Minor correction on a method to unlink entries bzr revid: vra@tinyerp.com-20100511094915-8awe8olv0odbnqor --- addons/account_analytic_plans/account_analytic_plans.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/addons/account_analytic_plans/account_analytic_plans.py b/addons/account_analytic_plans/account_analytic_plans.py index 57acdb6dee5..828d1b1e847 100644 --- a/addons/account_analytic_plans/account_analytic_plans.py +++ b/addons/account_analytic_plans/account_analytic_plans.py @@ -297,14 +297,15 @@ class account_move_line(osv.osv): def create_analytic_lines(self, cr, uid, ids, context={}): super(account_move_line, self).create_analytic_lines(cr, uid, ids, context) + analytic_line_obj = self.pool.get('account.analytic.line') for line in self.browse(cr, uid, ids, context): if line.analytics_id: if not line.journal_id.analytic_journal_id: raise osv.except_osv(_('No Analytic Journal !'),_("You have to define an analytic journal on the '%s' journal!") % (line.journal_id.name,)) - toremove = self.pool.get('account.analytic.line').search(cr, uid, [('move_id','=',line.id)], context=context) + toremove = analytic_line_obj.search(cr, uid, [('move_id','=',line.id)], context=context) if toremove: - line.unlink(cr, uid, toremove, context=context) + analytic_line_obj.unlink(cr, uid, toremove, context=context) for line2 in line.analytics_id.account_ids: val = (line.credit or 0.0) - (line.debit or 0.0) amt=val * (line2.rate/100) @@ -321,7 +322,7 @@ class account_move_line(osv.osv): 'journal_id': line.journal_id.analytic_journal_id.id, 'ref': line.ref, } - ali_id=self.pool.get('account.analytic.line').create(cr,uid,al_vals) + ali_id=analytic_line_obj.create(cr, uid, al_vals, context=context) return True account_move_line() From 1f24b30ececeac30ac858f2cb78e7372455b1d28 Mon Sep 17 00:00:00 2001 From: "Jay(Open ERP)" <> Date: Tue, 11 May 2010 15:29:51 +0530 Subject: [PATCH 043/159] [FIX] (5.0 - 6.0)Account : Raising an exception when journal_id is missing bzr revid: vra@tinyerp.com-20100511095951-ki2on0rrjfsmcg3j --- addons/account/invoice.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/account/invoice.py b/addons/account/invoice.py index f919f99cee7..514f9b2aceb 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -25,6 +25,7 @@ import decimal_precision as dp import netsvc from osv import fields, osv import ir +from osv.orm import except_orm import pooler from tools import config from tools.translate import _ From 81f1f33e1f38f811b0c90ae913ab6cad0091a7e1 Mon Sep 17 00:00:00 2001 From: gpa Date: Tue, 11 May 2010 15:35:20 +0530 Subject: [PATCH 044/159] [FIX] delivery: replace 'id' with active_id in passing context of order(takes built in function id in webclient). bzr revid: gpa@tinyerp.com-20100511100520-g4d2mh09qqx6q82c --- addons/delivery/delivery_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/delivery/delivery_view.xml b/addons/delivery/delivery_view.xml index 16f4a61ed1e..b2da47d1556 100644 --- a/addons/delivery/delivery_view.xml +++ b/addons/delivery/delivery_view.xml @@ -126,7 +126,7 @@ - + From 93f0dc45f242c01d3a8892dacc8e43acb048f2d6 Mon Sep 17 00:00:00 2001 From: gpa Date: Tue, 11 May 2010 15:59:32 +0530 Subject: [PATCH 045/159] [IMP] Account : Better view of Reconciled and Partially Reconciled entried with Entry Lines bzr revid: gpa@tinyerp.com-20100511102932-b67juadgzaespp5c --- addons/account/account_view.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index 9ace27294fa..af9e013cbc9 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -519,7 +519,10 @@ + + + From f495432c7f7629ebc36337557faa7b5fb9ccc964 Mon Sep 17 00:00:00 2001 From: "JMA (OpenERP)" Date: Tue, 11 May 2010 16:02:48 +0530 Subject: [PATCH 046/159] [FIX] Hr_holidays : Constraint corrected for Holidays request(start date cannot be greater than end date) bzr revid: jma@tinyerp.com-20100511103248-g1s0vdpkh30w1v99 --- addons/hr_holidays/hr_holidays.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/addons/hr_holidays/hr_holidays.py b/addons/hr_holidays/hr_holidays.py index cd0d86457d9..1c8b5de2b39 100644 --- a/addons/hr_holidays/hr_holidays.py +++ b/addons/hr_holidays/hr_holidays.py @@ -163,14 +163,16 @@ class hr_holidays(osv.osv): self.unlink(cr,uid,list_ids) def _check_date(self, cr, uid, ids): - if ids: - cr.execute('select number_of_days_temp from hr_holidays where id in ('+','.join(map(str, ids))+')') - res = cr.fetchall() - if res and res[0][0] < 0: + for rec in self.read(cr, uid, ids, ['number_of_days','date_from','date_to']): + if rec['number_of_days'] < 0: + return False + date_from = time.strptime(rec['date_from'], '%Y-%m-%d %H:%M:%S') + date_to = time.strptime(rec['date_to'], '%Y-%m-%d %H:%M:%S') + if date_from > date_to: return False return True - - _constraints = [(_check_date, 'Start date should not be larger than end date! ', ['number_of_days'])] + + _constraints = [(_check_date, 'Start date should not be larger than end date!\nNumber of Days should be greater than 1!', ['number_of_days'])] def unlink(self, cr, uid, ids, context={}): From 3c41b7fa74b97ebe4bfbe76568d785e0d4760c8c Mon Sep 17 00:00:00 2001 From: gpa Date: Tue, 11 May 2010 16:04:53 +0530 Subject: [PATCH 047/159] Tax code tree view should have company. bzr revid: gpa@tinyerp.com-20100511103453-ukagl0qbtxaydjdl --- addons/account/account_view.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index af9e013cbc9..776afab0642 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -542,6 +542,7 @@ + @@ -553,7 +554,7 @@
- + From 14dc743c61a062ccafc0055bd8233a84a3fc7bc5 Mon Sep 17 00:00:00 2001 From: gpa Date: Tue, 11 May 2010 16:14:03 +0530 Subject: [PATCH 048/159] [FIX] MRP : Ondelete=cascade applied to important fields of stock.warehouse.orderpoint bzr revid: gpa@tinyerp.com-20100511104403-bgvhfqtjufcqtw71 --- addons/mrp/stock.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/mrp/stock.py b/addons/mrp/stock.py index 00c6abe9264..8a07990c48c 100644 --- a/addons/mrp/stock.py +++ b/addons/mrp/stock.py @@ -39,8 +39,8 @@ class stock_warehouse_orderpoint(osv.osv): 'name': fields.char('Name', size=32, required=True), 'active': fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the orderpoint without removing it."), 'logic': fields.selection([('max','Order to Max'),('price','Best price (not yet active!)')], 'Reordering Mode', required=True), - 'warehouse_id': fields.many2one('stock.warehouse', 'Warehouse', required=True), - 'location_id': fields.many2one('stock.location', 'Location', required=True), + 'warehouse_id': fields.many2one('stock.warehouse', 'Warehouse', required=True, ondelete="cascade"), + 'location_id': fields.many2one('stock.location', 'Location', required=True, ondelete="cascade"), 'product_id': fields.many2one('product.product', 'Product', required=True, ondelete='cascade', domain=[('type','=','product')]), 'product_uom': fields.many2one('product.uom', 'Product UOM', required=True ), 'product_min_qty': fields.float('Min Quantity', required=True, From 06d2f4d107669396fbeb360194fd24f4ad3f41ac Mon Sep 17 00:00:00 2001 From: gpa Date: Tue, 11 May 2010 16:42:40 +0530 Subject: [PATCH 049/159] [FIX] Sale : account_invoice_end() corrected/optimized so that it does not create any regression of duplicated pickings for SO bzr revid: gpa@tinyerp.com-20100511111240-a0ajvroqcazkzc8u --- addons/sale/sale.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 5a981e24bdc..19094050b96 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -510,18 +510,14 @@ class sale_order(osv.osv): def action_invoice_end(self, cr, uid, ids, context=None): if context is None: context = {} + for order in self.browse(cr, uid, ids, context=context): - val = {'invoiced': True} - if order.state == 'invoice_except': - val['state'] = 'progress' - for line in order.order_line: - towrite = [] if line.state == 'exception': - towrite.append(line.id) - if towrite: - self.pool.get('sale.order.line').write(cr, uid, towrite, {'state': 'confirmed'}, context=context) - self.write(cr, uid, [order.id], val) + self.pool.get('sale.order.line').write(cr, uid, [line.id], {'state': 'confirmed'}, context=context) + + if order.state == 'invoice_except': + self.write(cr, uid, [order.id], {'state' : 'progress'}, context=context) return True From 56a11a58e219b82c2bcf799a49229fce5860e10a Mon Sep 17 00:00:00 2001 From: "JMA (OpenERP)" Date: Tue, 11 May 2010 16:45:34 +0530 Subject: [PATCH 050/159] [IMP] Stock :Layout for Moves under Picking Improved bzr revid: jma@tinyerp.com-20100511111534-5zxb62m9zue8gy7c --- addons/stock/stock_view.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml index ee0dfa9cd13..2bc1fa3b4da 100644 --- a/addons/stock/stock_view.xml +++ b/addons/stock/stock_view.xml @@ -654,7 +654,7 @@