From 5101771cd9ea7218695d31ce7c7bf2b12a1d417f Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Fri, 13 Jul 2012 19:08:38 +0200 Subject: [PATCH 001/165] Harmonize the noupdate flag on security XML files : - ir.rule objects are noupdate="1" - all other objects are noupdate="0" bzr revid: alexis@via.ecp.fr-20120713170838-pjsysliyt6twazrc --- addons/account/security/account_security.xml | 9 ++++++-- .../account_analytic_default_security.xml | 2 +- .../security/account_asset_security.xml | 2 +- .../security/account_budget_security.xml | 2 +- .../security/account_security.xml | 6 ++++-- .../security/account_followup_security.xml | 2 +- .../security/account_payment_security.xml | 5 ++++- .../security/account_voucher_security.xml | 2 +- .../analytic/security/analytic_security.xml | 12 ++++++++--- addons/crm/security/crm_security.xml | 21 +++++++++++-------- .../document/security/document_security.xml | 2 ++ addons/event/security/event_security.xml | 2 ++ addons/hr/security/hr_security.xml | 10 ++++++--- addons/hr_attendance/security/ir_rule.xml | 2 +- .../security/hr_evaluation_security.xml | 18 +++++++++------- .../security/hr_timesheet_security.xml | 2 +- .../security/hr_timesheet_sheet_security.xml | 2 +- addons/l10n_ma/security/compta_security.xml | 4 +++- addons/mail/security/mail_security.xml | 5 ++++- addons/mrp/security/mrp_security.xml | 2 ++ .../security/point_of_sale_security.xml | 2 +- .../portal_event/security/portal_security.xml | 2 +- .../security/procurement_security.xml | 2 +- addons/product/security/product_security.xml | 19 ++++++++++------- addons/project/security/project_security.xml | 5 ++++- .../purchase/security/purchase_security.xml | 5 ++++- .../security/purchase_tender.xml | 7 +++++-- addons/sale/security/sale_security.xml | 2 ++ addons/share/security/share_security.xml | 2 +- addons/stock/security/stock_security.xml | 2 ++ .../security/stock_location_security.xml | 2 +- .../security/stock_planning_security.xml | 2 +- 32 files changed, 109 insertions(+), 55 deletions(-) diff --git a/addons/account/security/account_security.xml b/addons/account/security/account_security.xml index e1a29a6edfb..55e9d4cfe85 100644 --- a/addons/account/security/account_security.xml +++ b/addons/account/security/account_security.xml @@ -1,5 +1,6 @@ - + + Invoicing & Payments @@ -22,6 +23,9 @@ + + + Account Entry @@ -142,4 +146,5 @@ ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])] - + + diff --git a/addons/account_analytic_default/security/account_analytic_default_security.xml b/addons/account_analytic_default/security/account_analytic_default_security.xml index 7ff68c7d849..63c6e30eb22 100644 --- a/addons/account_analytic_default/security/account_analytic_default_security.xml +++ b/addons/account_analytic_default/security/account_analytic_default_security.xml @@ -1,6 +1,6 @@ - + Analytic Default multi company rule diff --git a/addons/account_asset/security/account_asset_security.xml b/addons/account_asset/security/account_asset_security.xml index d6b9840ceb0..77f218d13b9 100644 --- a/addons/account_asset/security/account_asset_security.xml +++ b/addons/account_asset/security/account_asset_security.xml @@ -1,6 +1,6 @@ - + Account Asset Category multi-company diff --git a/addons/account_budget/security/account_budget_security.xml b/addons/account_budget/security/account_budget_security.xml index 1fbcd82e86c..d184ac4b944 100644 --- a/addons/account_budget/security/account_budget_security.xml +++ b/addons/account_budget/security/account_budget_security.xml @@ -1,6 +1,6 @@ - + Budget post multi-company diff --git a/addons/account_coda/security/account_security.xml b/addons/account_coda/security/account_security.xml index b8fdd32ebe6..8ec71cc8762 100644 --- a/addons/account_coda/security/account_security.xml +++ b/addons/account_coda/security/account_security.xml @@ -1,5 +1,6 @@ - + + Account Coda model company rule @@ -8,4 +9,5 @@ ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])] - + + diff --git a/addons/account_followup/security/account_followup_security.xml b/addons/account_followup/security/account_followup_security.xml index fd90e16fec8..1586403d701 100644 --- a/addons/account_followup/security/account_followup_security.xml +++ b/addons/account_followup/security/account_followup_security.xml @@ -1,6 +1,6 @@ - + Account Follow-up multi company rule diff --git a/addons/account_payment/security/account_payment_security.xml b/addons/account_payment/security/account_payment_security.xml index 135059c79d5..4bca00eaa6d 100644 --- a/addons/account_payment/security/account_payment_security.xml +++ b/addons/account_payment/security/account_payment_security.xml @@ -1,6 +1,6 @@ - + Accounting / Payments @@ -10,6 +10,9 @@ + + + Payment Mode company rule diff --git a/addons/account_voucher/security/account_voucher_security.xml b/addons/account_voucher/security/account_voucher_security.xml index df4e58484b5..04540fd8aa0 100644 --- a/addons/account_voucher/security/account_voucher_security.xml +++ b/addons/account_voucher/security/account_voucher_security.xml @@ -1,6 +1,6 @@ - + Voucher multi-company diff --git a/addons/analytic/security/analytic_security.xml b/addons/analytic/security/analytic_security.xml index a8c43b0bbb7..70688275de2 100644 --- a/addons/analytic/security/analytic_security.xml +++ b/addons/analytic/security/analytic_security.xml @@ -1,5 +1,6 @@ - + + Analytic multi company rule @@ -14,9 +15,14 @@ ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])] - + + + + Analytic Accounting - + + + diff --git a/addons/crm/security/crm_security.xml b/addons/crm/security/crm_security.xml index 949cd5d4e73..92da0fe964b 100644 --- a/addons/crm/security/crm_security.xml +++ b/addons/crm/security/crm_security.xml @@ -24,6 +24,17 @@ + + + + + + + + + + + Personal Leads @@ -37,14 +48,6 @@ - - - - - - - - Hide Private Meetings @@ -52,5 +55,5 @@ ['|',('user_id','=',user.id),('show_as','=','busy')] - + diff --git a/addons/document/security/document_security.xml b/addons/document/security/document_security.xml index cacde50c36e..a7ec76eafac 100644 --- a/addons/document/security/document_security.xml +++ b/addons/document/security/document_security.xml @@ -11,6 +11,8 @@ + + diff --git a/addons/event/security/event_security.xml b/addons/event/security/event_security.xml index e0d17c3bacb..cf37e7ddba7 100644 --- a/addons/event/security/event_security.xml +++ b/addons/event/security/event_security.xml @@ -20,6 +20,8 @@ + + diff --git a/addons/hr/security/hr_security.xml b/addons/hr/security/hr_security.xml index 5e4c3052858..eaab00497d3 100644 --- a/addons/hr/security/hr_security.xml +++ b/addons/hr/security/hr_security.xml @@ -1,6 +1,6 @@ - + Officer @@ -13,6 +13,10 @@ + + + + Department multi company rule @@ -25,6 +29,6 @@ ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])] - - + + diff --git a/addons/hr_attendance/security/ir_rule.xml b/addons/hr_attendance/security/ir_rule.xml index b934dc16f5a..59fa1c103f7 100644 --- a/addons/hr_attendance/security/ir_rule.xml +++ b/addons/hr_attendance/security/ir_rule.xml @@ -1,6 +1,6 @@ - + Manager Attendance diff --git a/addons/hr_evaluation/security/hr_evaluation_security.xml b/addons/hr_evaluation/security/hr_evaluation_security.xml index 232f83fd963..7c7d6f43ee3 100644 --- a/addons/hr_evaluation/security/hr_evaluation_security.xml +++ b/addons/hr_evaluation/security/hr_evaluation_security.xml @@ -1,6 +1,12 @@ - + + + + + + + @@ -19,7 +25,10 @@ - + + + + Evaluation Plan multi company rule @@ -50,10 +59,5 @@ - - - - - diff --git a/addons/hr_timesheet/security/hr_timesheet_security.xml b/addons/hr_timesheet/security/hr_timesheet_security.xml index 9c78204016b..d7cf34fa1fd 100644 --- a/addons/hr_timesheet/security/hr_timesheet_security.xml +++ b/addons/hr_timesheet/security/hr_timesheet_security.xml @@ -1,6 +1,6 @@ - + Manager HR Analytic Timesheet diff --git a/addons/hr_timesheet_sheet/security/hr_timesheet_sheet_security.xml b/addons/hr_timesheet_sheet/security/hr_timesheet_sheet_security.xml index ff387a898ca..9ef8689f436 100644 --- a/addons/hr_timesheet_sheet/security/hr_timesheet_sheet_security.xml +++ b/addons/hr_timesheet_sheet/security/hr_timesheet_sheet_security.xml @@ -1,6 +1,6 @@ - + Timesheet multi-company diff --git a/addons/l10n_ma/security/compta_security.xml b/addons/l10n_ma/security/compta_security.xml index 8d511ae7154..b053d44a402 100644 --- a/addons/l10n_ma/security/compta_security.xml +++ b/addons/l10n_ma/security/compta_security.xml @@ -1,4 +1,6 @@ - + + + Finance / Expert Comptable diff --git a/addons/mail/security/mail_security.xml b/addons/mail/security/mail_security.xml index 34fcbac3088..b67ce29a8b6 100644 --- a/addons/mail/security/mail_security.xml +++ b/addons/mail/security/mail_security.xml @@ -1,6 +1,6 @@ - + @@ -16,6 +16,9 @@ + + + Mail.group: access only public and joined groups diff --git a/addons/mrp/security/mrp_security.xml b/addons/mrp/security/mrp_security.xml index f1f26aae1f2..35aae42b53d 100644 --- a/addons/mrp/security/mrp_security.xml +++ b/addons/mrp/security/mrp_security.xml @@ -23,6 +23,8 @@ + + mrp_production multi-company diff --git a/addons/point_of_sale/security/point_of_sale_security.xml b/addons/point_of_sale/security/point_of_sale_security.xml index 7f2e91f1b48..1f2dd5bd8c6 100644 --- a/addons/point_of_sale/security/point_of_sale_security.xml +++ b/addons/point_of_sale/security/point_of_sale_security.xml @@ -1,6 +1,6 @@ - + User diff --git a/addons/portal_event/security/portal_security.xml b/addons/portal_event/security/portal_security.xml index 82044fb8b11..c9aec1edd4b 100644 --- a/addons/portal_event/security/portal_security.xml +++ b/addons/portal_event/security/portal_security.xml @@ -1,6 +1,6 @@ - + Personal Events diff --git a/addons/procurement/security/procurement_security.xml b/addons/procurement/security/procurement_security.xml index b6b15d565c6..2362db4c355 100644 --- a/addons/procurement/security/procurement_security.xml +++ b/addons/procurement/security/procurement_security.xml @@ -1,6 +1,6 @@ - + procurement multi-company diff --git a/addons/product/security/product_security.xml b/addons/product/security/product_security.xml index 1d2c795083a..1d57a63e287 100644 --- a/addons/product/security/product_security.xml +++ b/addons/product/security/product_security.xml @@ -1,13 +1,6 @@ - - - - Product multi-company - - - ['|','|',('company_id.child_ids','child_of',[user.company_id.id]),('company_id','child_of',[user.company_id.id]),('company_id','=',False)] - + Product Variant @@ -44,6 +37,16 @@ + + + + + Product multi-company + + + ['|','|',('company_id.child_ids','child_of',[user.company_id.id]),('company_id','child_of',[user.company_id.id]),('company_id','=',False)] + + product pricelist company rule diff --git a/addons/project/security/project_security.xml b/addons/project/security/project_security.xml index f867285138a..a7ae16427ee 100644 --- a/addons/project/security/project_security.xml +++ b/addons/project/security/project_security.xml @@ -1,6 +1,6 @@ - + User @@ -34,6 +34,9 @@ + + + Project multi-company diff --git a/addons/purchase/security/purchase_security.xml b/addons/purchase/security/purchase_security.xml index 26a4aa14f1c..08c6dfb0782 100644 --- a/addons/purchase/security/purchase_security.xml +++ b/addons/purchase/security/purchase_security.xml @@ -1,6 +1,6 @@ - + User @@ -25,6 +25,9 @@ + + + Purchase Order multi-company diff --git a/addons/purchase_requisition/security/purchase_tender.xml b/addons/purchase_requisition/security/purchase_tender.xml index 12f9a9e56b8..e60665e202b 100644 --- a/addons/purchase_requisition/security/purchase_tender.xml +++ b/addons/purchase_requisition/security/purchase_tender.xml @@ -1,6 +1,6 @@ - + Purchase Requisition @@ -19,7 +19,10 @@ - + + + + Purchase Requisition multi-company diff --git a/addons/sale/security/sale_security.xml b/addons/sale/security/sale_security.xml index 0cb55fb0d30..86bf899820d 100644 --- a/addons/sale/security/sale_security.xml +++ b/addons/sale/security/sale_security.xml @@ -56,6 +56,8 @@ + + diff --git a/addons/share/security/share_security.xml b/addons/share/security/share_security.xml index 29971077a2c..2c68cc69937 100644 --- a/addons/share/security/share_security.xml +++ b/addons/share/security/share_security.xml @@ -1,6 +1,6 @@ - + Sharing diff --git a/addons/stock/security/stock_security.xml b/addons/stock/security/stock_security.xml index c9f8a03a378..37f6f80eacf 100644 --- a/addons/stock/security/stock_security.xml +++ b/addons/stock/security/stock_security.xml @@ -33,6 +33,8 @@ + + diff --git a/addons/stock_location/security/stock_location_security.xml b/addons/stock_location/security/stock_location_security.xml index 880f5de70da..310c45da06c 100644 --- a/addons/stock_location/security/stock_location_security.xml +++ b/addons/stock_location/security/stock_location_security.xml @@ -1,6 +1,6 @@ - + diff --git a/addons/stock_planning/security/stock_planning_security.xml b/addons/stock_planning/security/stock_planning_security.xml index 62f15e005bb..28289addc97 100644 --- a/addons/stock_planning/security/stock_planning_security.xml +++ b/addons/stock_planning/security/stock_planning_security.xml @@ -1,6 +1,6 @@ - + From f9fe63780347c73d70f8d6a0b36a02cdb3704941 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Fri, 27 Jul 2012 03:52:02 +0200 Subject: [PATCH 002/165] Remplace all occurences of my_browse_rec.product_id.product_tmpl_id.field to my_browse_rec.product_id.field bzr revid: alexis@via.ecp.fr-20120727015202-7fylff5jr26sgxez --- addons/account/account_analytic_line.py | 4 ++-- addons/account/account_invoice.py | 4 ++-- addons/account_anglo_saxon/sale.py | 2 +- addons/account_anglo_saxon/stock.py | 4 ++-- addons/analytic_user_function/analytic_user_function.py | 6 +++--- addons/hr_expense/hr_expense.py | 2 +- addons/hr_timesheet/hr_timesheet.py | 2 +- .../wizard/hr_timesheet_invoice_create.py | 2 +- addons/mrp/mrp.py | 4 ++-- addons/mrp/procurement.py | 2 +- addons/mrp/test/order_process.yml | 2 +- addons/mrp_subproduct/mrp_subproduct.py | 2 +- addons/procurement/procurement.py | 4 ++-- addons/project_timesheet/project_timesheet.py | 2 +- addons/purchase/purchase.py | 6 +++--- addons/purchase/wizard/purchase_line_invoice.py | 2 +- addons/sale/sale.py | 6 +++--- addons/sale/stock.py | 4 ++-- addons/sale/test/picking_order_policy.yml | 2 +- addons/stock/product.py | 4 ++-- addons/stock/stock.py | 8 +++----- addons/stock/test/opening_stock.yml | 2 +- addons/stock_planning/stock_planning.py | 2 +- 23 files changed, 38 insertions(+), 40 deletions(-) diff --git a/addons/account/account_analytic_line.py b/addons/account/account_analytic_line.py index 06de5a3e43e..893acde9a58 100644 --- a/addons/account/account_analytic_line.py +++ b/addons/account/account_analytic_line.py @@ -83,7 +83,7 @@ class account_analytic_line(osv.osv): if j_id.type == 'purchase': unit = prod.uom_po_id.id if j_id.type <> 'sale': - a = prod.product_tmpl_id.property_account_expense.id + a = prod.property_account_expense.id if not a: a = prod.categ_id.property_account_expense_categ.id if not a: @@ -92,7 +92,7 @@ class account_analytic_line(osv.osv): 'for this product: "%s" (id:%d)') % \ (prod.name, prod.id,)) else: - a = prod.product_tmpl_id.property_account_income.id + a = prod.property_account_income.id if not a: a = prod.categ_id.property_account_income_categ.id if not a: diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index 6a0a29cb2fe..33ef8ad1387 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -1404,11 +1404,11 @@ class account_invoice_line(osv.osv): res = self.pool.get('product.product').browse(cr, uid, product, context=context) if type in ('out_invoice','out_refund'): - a = res.product_tmpl_id.property_account_income.id + a = res.property_account_income.id if not a: a = res.categ_id.property_account_income_categ.id else: - a = res.product_tmpl_id.property_account_expense.id + a = res.property_account_expense.id if not a: a = res.categ_id.property_account_expense_categ.id a = fpos_obj.map_account(cr, uid, fpos, a) diff --git a/addons/account_anglo_saxon/sale.py b/addons/account_anglo_saxon/sale.py index e2cfa7bbb3b..0faf30cf137 100644 --- a/addons/account_anglo_saxon/sale.py +++ b/addons/account_anglo_saxon/sale.py @@ -31,7 +31,7 @@ from osv import fields, osv # invoice_line_obj = self.pool.get('account.invoice.line') # for line in invoice_line_obj.browse(cr, uid, line_ids): # if line.product_id: -# a = line.product_id.product_tmpl_id.property_stock_account_output and line.product_id.product_tmpl_id.property_stock_account_output.id +# a = line.product_id.property_stock_account_output and line.product_id.property_stock_account_output.id # if not a: # a = line.product_id.categ_id.property_stock_account_output_categ and line.product_id.categ_id.property_stock_account_output_categ.id # if a: diff --git a/addons/account_anglo_saxon/stock.py b/addons/account_anglo_saxon/stock.py index 9ddfab86a94..e87749905a7 100644 --- a/addons/account_anglo_saxon/stock.py +++ b/addons/account_anglo_saxon/stock.py @@ -36,7 +36,7 @@ class stock_picking(osv.osv): for inv in self.pool.get('account.invoice').browse(cr, uid, res.values(), context=context): for ol in inv.invoice_line: if ol.product_id: - oa = ol.product_id.product_tmpl_id.property_stock_account_output and ol.product_id.product_tmpl_id.property_stock_account_output.id + oa = ol.product_id.property_stock_account_output and ol.product_id.property_stock_account_output.id if not oa: oa = ol.product_id.categ_id.property_stock_account_output_categ and ol.product_id.categ_id.property_stock_account_output_categ.id if oa: @@ -48,7 +48,7 @@ class stock_picking(osv.osv): for inv in self.pool.get('account.invoice').browse(cr, uid, res.values(), context=context): for ol in inv.invoice_line: if ol.product_id: - oa = ol.product_id.product_tmpl_id.property_stock_account_input and ol.product_id.product_tmpl_id.property_stock_account_input.id + oa = ol.product_id.property_stock_account_input and ol.product_id.property_stock_account_input.id if not oa: oa = ol.product_id.categ_id.property_stock_account_input_categ and ol.product_id.categ_id.property_stock_account_input_categ.id if oa: diff --git a/addons/analytic_user_function/analytic_user_function.py b/addons/analytic_user_function/analytic_user_function.py index cfb1aba10d1..e446afc393d 100644 --- a/addons/analytic_user_function/analytic_user_function.py +++ b/addons/analytic_user_function/analytic_user_function.py @@ -85,10 +85,10 @@ class hr_analytic_timesheet(osv.osv): res.setdefault('value',{}) res['value']= super(hr_analytic_timesheet, self).on_change_account_id(cr, uid, ids, account_id)['value'] res['value']['product_id'] = r.product_id.id - res['value']['product_uom_id'] = r.product_id.product_tmpl_id.uom_id.id + res['value']['product_uom_id'] = r.product_id.uom_id.id #the change of product has to impact the amount, uom and general_account_id - a = r.product_id.product_tmpl_id.property_account_expense.id + a = r.product_id.property_account_expense.id if not a: a = r.product_id.categ_id.property_account_expense_categ.id if not a: @@ -123,7 +123,7 @@ class hr_analytic_timesheet(osv.osv): res['value']['product_id'] = r.product_id.id #the change of product has to impact the amount, uom and general_account_id - a = r.product_id.product_tmpl_id.property_account_expense.id + a = r.product_id.property_account_expense.id if not a: a = r.product_id.categ_id.property_account_expense_categ.id if not a: diff --git a/addons/hr_expense/hr_expense.py b/addons/hr_expense/hr_expense.py index b1192701dfb..fd5db8dbecd 100644 --- a/addons/hr_expense/hr_expense.py +++ b/addons/hr_expense/hr_expense.py @@ -164,7 +164,7 @@ class hr_expense_expense(osv.osv): for l in exp.line_ids: tax_id = [] if l.product_id: - acc = l.product_id.product_tmpl_id.property_account_expense + acc = l.product_id.property_account_expense if not acc: acc = l.product_id.categ_id.property_account_expense_categ tax_id = [x.id for x in l.product_id.supplier_taxes_id] diff --git a/addons/hr_timesheet/hr_timesheet.py b/addons/hr_timesheet/hr_timesheet.py index 53119853c31..f959b85bbf8 100644 --- a/addons/hr_timesheet/hr_timesheet.py +++ b/addons/hr_timesheet/hr_timesheet.py @@ -125,7 +125,7 @@ class hr_analytic_timesheet(osv.osv): if emp_id: emp = emp_obj.browse(cr, uid, emp_id[0], context=context) if bool(emp.product_id): - a = emp.product_id.product_tmpl_id.property_account_expense.id + a = emp.product_id.property_account_expense.id if not a: a = emp.product_id.categ_id.property_account_expense_categ.id if a: diff --git a/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py b/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py index c9b2439596d..bf5fc1b8e59 100644 --- a/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py +++ b/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py @@ -117,7 +117,7 @@ class account_analytic_line(osv.osv): taxes = product.taxes_id tax = fiscal_pos_obj.map_tax(cr, uid, account.partner_id.property_account_position, taxes) - account_id = product.product_tmpl_id.property_account_income.id or product.categ_id.property_account_income_categ.id + account_id = product.property_account_income.id or product.categ_id.property_account_income_categ.id if not account_id: raise osv.except_osv(_("Configuration Error"), _("No income account defined for product '%s'") % product.name) curr_line = { diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index ea219621ea6..061dfe52859 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -957,7 +957,7 @@ class mrp_production(osv.osv): def _make_production_produce_line(self, cr, uid, production, context=None): stock_move = self.pool.get('stock.move') - source_location_id = production.product_id.product_tmpl_id.property_stock_production.id + source_location_id = production.product_id.property_stock_production.id destination_location_id = production.location_dest_id.id move_name = _('PROD: %s') + production.name data = { @@ -985,7 +985,7 @@ class mrp_production(osv.osv): if production_line.product_id.type not in ('product', 'consu'): return False move_name = _('PROD: %s') % production.name - destination_location_id = production.product_id.product_tmpl_id.property_stock_production.id + destination_location_id = production.product_id.property_stock_production.id if not source_location_id: source_location_id = production.location_src_id.id move_id = stock_move.create(cr, uid, { diff --git a/addons/mrp/procurement.py b/addons/mrp/procurement.py index 363f98e35d1..2b37f2a8ba2 100644 --- a/addons/mrp/procurement.py +++ b/addons/mrp/procurement.py @@ -79,7 +79,7 @@ class procurement_order(osv.osv): procurement_obj = self.pool.get('procurement.order') for procurement in procurement_obj.browse(cr, uid, ids, context=context): res_id = procurement.move_id.id - newdate = datetime.strptime(procurement.date_planned, '%Y-%m-%d %H:%M:%S') - relativedelta(days=procurement.product_id.product_tmpl_id.produce_delay or 0.0) + newdate = datetime.strptime(procurement.date_planned, '%Y-%m-%d %H:%M:%S') - relativedelta(days=procurement.product_id.produce_delay or 0.0) newdate = newdate - relativedelta(days=company.manufacturing_lead) produce_id = production_obj.create(cr, uid, { 'origin': procurement.origin, diff --git a/addons/mrp/test/order_process.yml b/addons/mrp/test/order_process.yml index ee78e036d44..102f6a0363e 100644 --- a/addons/mrp/test/order_process.yml +++ b/addons/mrp/test/order_process.yml @@ -94,7 +94,7 @@ assert order.state == 'confirmed', "Production order should be confirmed." assert order.move_created_ids, "Trace Record is not created for Final Product." move = order.move_created_ids[0] - source_location_id = order.product_id.product_tmpl_id.property_stock_production.id + source_location_id = order.product_id.property_stock_production.id assert move.date == order.date_planned, "Planned date is not correspond." assert move.product_id.id == order.product_id.id, "Product is not correspond." assert move.product_uom.id == order.product_uom.id, "UOM is not correspond." diff --git a/addons/mrp_subproduct/mrp_subproduct.py b/addons/mrp_subproduct/mrp_subproduct.py index bacdeb2c675..2a99577b901 100644 --- a/addons/mrp_subproduct/mrp_subproduct.py +++ b/addons/mrp_subproduct/mrp_subproduct.py @@ -75,7 +75,7 @@ class mrp_production(osv.osv): """ 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 + source = production.product_id.property_stock_production.id if not production.bom_id: continue for sub_product in production.bom_id.sub_products: diff --git a/addons/procurement/procurement.py b/addons/procurement/procurement.py index 1c83711abf7..0d2388e58b9 100644 --- a/addons/procurement/procurement.py +++ b/addons/procurement/procurement.py @@ -285,7 +285,7 @@ class procurement_order(osv.osv): user = self.pool.get('res.users').browse(cr, uid, uid) partner_obj = self.pool.get('res.partner') for procurement in self.browse(cr, uid, ids): - if procurement.product_id.product_tmpl_id.supply_method <> 'buy': + if procurement.product_id.supply_method <> 'buy': return False if not procurement.product_id.seller_ids: message = _('No supplier defined for this product !') @@ -333,7 +333,7 @@ class procurement_order(osv.osv): if not procurement.move_id: source = procurement.location_id.id if procurement.procure_method == 'make_to_order': - source = procurement.product_id.product_tmpl_id.property_stock_procurement.id + source = procurement.product_id.property_stock_procurement.id id = move_obj.create(cr, uid, { 'name': procurement.name, 'location_id': source, diff --git a/addons/project_timesheet/project_timesheet.py b/addons/project_timesheet/project_timesheet.py index 565710f5664..56f6e55ae62 100644 --- a/addons/project_timesheet/project_timesheet.py +++ b/addons/project_timesheet/project_timesheet.py @@ -88,7 +88,7 @@ class project_work(osv.osv): raise osv.except_osv(_('Bad Configuration !'), _('No journal defined on the related employee.\nFill in the timesheet tab of the employee form.')) - a = emp.product_id.product_tmpl_id.property_account_expense.id + a = emp.product_id.property_account_expense.id if not a: a = emp.product_id.categ_id.property_account_expense_categ.id if not a: diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index afdca95f544..32eedc4e370 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -434,7 +434,7 @@ class purchase_order(osv.osv): inv_lines = [] for po_line in order.order_line: if po_line.product_id: - acc_id = po_line.product_id.product_tmpl_id.property_account_expense.id + acc_id = po_line.product_id.property_account_expense.id if not acc_id: acc_id = po_line.product_id.categ_id.property_account_expense_categ.id if not acc_id: @@ -485,7 +485,7 @@ class purchase_order(osv.osv): def has_stockable_product(self,cr, uid, ids, *args): for order in self.browse(cr, uid, ids): for order_line in order.order_line: - if order_line.product_id and order_line.product_id.product_tmpl_id.type in ('product', 'consu'): + if order_line.product_id and order_line.product_id.type in ('product', 'consu'): return True return False @@ -1048,7 +1048,7 @@ class procurement_order(osv.osv): context.update({'lang': partner.lang, 'partner_id': partner_id}) product = prod_obj.browse(cr, uid, procurement.product_id.id, context=context) - taxes_ids = procurement.product_id.product_tmpl_id.supplier_taxes_id + taxes_ids = procurement.product_id.supplier_taxes_id taxes = acc_pos_obj.map_tax(cr, uid, partner.property_account_position, taxes_ids) name = product.partner_ref diff --git a/addons/purchase/wizard/purchase_line_invoice.py b/addons/purchase/wizard/purchase_line_invoice.py index d43f617265f..f12477a8170 100644 --- a/addons/purchase/wizard/purchase_line_invoice.py +++ b/addons/purchase/wizard/purchase_line_invoice.py @@ -102,7 +102,7 @@ class purchase_line_invoice(osv.osv_memory): if not line.partner_id.id in invoices: invoices[line.partner_id.id] = [] if line.product_id: - a = line.product_id.product_tmpl_id.property_account_expense.id + a = line.product_id.property_account_expense.id if not a: a = line.product_id.categ_id.property_account_expense_categ.id if not a: diff --git a/addons/sale/sale.py b/addons/sale/sale.py index f920b34ca42..34697a0f2ea 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -950,7 +950,7 @@ class sale_order(osv.osv): date_planned = self._get_date_planned(cr, uid, order, line, order.date_order, context=context) if line.product_id: - if line.product_id.product_tmpl_id.type in ('product', 'consu'): + if line.product_id.type in ('product', 'consu'): if not picking_id: picking_id = picking_obj.create(cr, uid, self._prepare_order_picking(cr, uid, order, context=context)) move_id = move_obj.create(cr, uid, self._prepare_order_line_move(cr, uid, order, line, picking_id, date_planned, context=context)) @@ -1014,7 +1014,7 @@ class sale_order(osv.osv): def has_stockable_products(self, cr, uid, ids, *args): for order in self.browse(cr, uid, ids): for order_line in order.order_line: - if order_line.product_id and order_line.product_id.product_tmpl_id.type in ('product', 'consu'): + if order_line.product_id and order_line.product_id.type in ('product', 'consu'): return True return False @@ -1188,7 +1188,7 @@ class sale_order_line(osv.osv): if not line.invoiced: if not account_id: if line.product_id: - account_id = line.product_id.product_tmpl_id.property_account_income.id + account_id = line.product_id.property_account_income.id if not account_id: account_id = line.product_id.categ_id.property_account_income_categ.id if not account_id: diff --git a/addons/sale/stock.py b/addons/sale/stock.py index c4e505a80e8..22873851380 100644 --- a/addons/sale/stock.py +++ b/addons/sale/stock.py @@ -161,13 +161,13 @@ class stock_picking(osv.osv): else: name = sale_line.name if type in ('out_invoice', 'out_refund'): - account_id = sale_line.product_id.product_tmpl_id.\ + account_id = sale_line.product_id.\ property_account_income.id if not account_id: account_id = sale_line.product_id.categ_id.\ property_account_income_categ.id else: - account_id = sale_line.product_id.product_tmpl_id.\ + account_id = sale_line.product_id.\ property_account_expense.id if not account_id: account_id = sale_line.product_id.categ_id.\ diff --git a/addons/sale/test/picking_order_policy.yml b/addons/sale/test/picking_order_policy.yml index 16caefddf1b..8d5cdcbf4be 100644 --- a/addons/sale/test/picking_order_policy.yml +++ b/addons/sale/test/picking_order_policy.yml @@ -121,7 +121,7 @@ assert invoice.payment_term.id == order.payment_term.id, "Payment term is not correspond." for so_line in order.order_line: inv_line = so_line.invoice_lines[0] - ac = so_line.product_id.product_tmpl_id.property_account_income.id or so_line.product_id.categ_id.property_account_income_categ.id + ac = so_line.product_id.property_account_income.id or so_line.product_id.categ_id.property_account_income_categ.id assert inv_line.product_id.id == so_line.product_id.id or False,"Product is not correspond" assert inv_line.account_id.id == ac,"Account of Invoice line is not corresponding." assert inv_line.uos_id.id == (so_line.product_uos and so_line.product_uos.id) or so_line.product_uom.id, "Product UOS is not correspond." diff --git a/addons/stock/product.py b/addons/stock/product.py index e4164ef9e1f..0279807503e 100644 --- a/addons/stock/product.py +++ b/addons/stock/product.py @@ -132,7 +132,7 @@ class product_product(osv.osv): if diff > 0: if not stock_input_acc: - stock_input_acc = product.product_tmpl_id.\ + stock_input_acc = product.\ property_stock_account_input.id if not stock_input_acc: stock_input_acc = product.categ_id.\ @@ -158,7 +158,7 @@ class product_product(osv.osv): }) elif diff < 0: if not stock_output_acc: - stock_output_acc = product.product_tmpl_id.\ + stock_output_acc = product.\ property_stock_account_output.id if not stock_output_acc: stock_output_acc = product.categ_id.\ diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 6d8f6bb6fec..c43fb07c663 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -1029,14 +1029,12 @@ class stock_picking(osv.osv): origin += ':' + move_line.picking_id.origin if invoice_vals['type'] in ('out_invoice', 'out_refund'): - account_id = move_line.product_id.product_tmpl_id.\ - property_account_income.id + account_id = move_line.product_id.property_account_income.id if not account_id: account_id = move_line.product_id.categ_id.\ property_account_income_categ.id else: - account_id = move_line.product_id.product_tmpl_id.\ - property_account_expense.id + account_id = move_line.product_id.property_account_expense.id if not account_id: account_id = move_line.product_id.categ_id.\ property_account_expense_categ.id @@ -2729,7 +2727,7 @@ class stock_inventory(osv.osv): change = line.product_qty - amount lot_id = line.prod_lot_id.id if change: - location_id = line.product_id.product_tmpl_id.property_stock_inventory.id + location_id = line.product_id.property_stock_inventory.id value = { 'name': 'INV:' + str(line.inventory_id.id) + ':' + line.inventory_id.name, 'product_id': line.product_id.id, diff --git a/addons/stock/test/opening_stock.yml b/addons/stock/test/opening_stock.yml index 0cb6c0b78ad..2e3eaeadc74 100644 --- a/addons/stock/test/opening_stock.yml +++ b/addons/stock/test/opening_stock.yml @@ -66,7 +66,7 @@ for move_line in inventory.move_ids: for line in inventory.inventory_line_id: if move_line.product_id.id == line.product_id.id and move_line.prodlot_id.id == line.prod_lot_id.id: - location_id = line.product_id.product_tmpl_id.property_stock_inventory.id + location_id = line.product_id.property_stock_inventory.id assert move_line.product_qty == line.product_qty, "Qty is not correspond." assert move_line.product_uom.id == line.product_uom.id, "UOM is not correspond." assert move_line.date == inventory.date, "Date is not correspond." diff --git a/addons/stock_planning/stock_planning.py b/addons/stock_planning/stock_planning.py index e6f3b8d4218..bd973c6a22f 100644 --- a/addons/stock_planning/stock_planning.py +++ b/addons/stock_planning/stock_planning.py @@ -191,7 +191,7 @@ class stock_sale_forecast(osv.osv): coeff_def2uom = 1 if (product_uom != product.uom_id.id): coeff_def2uom, round_value = self._from_default_uom_factor(cr, uid, product_id, product_uom, {}) - qty = rounding(coeff_def2uom * product_amt/(product.product_tmpl_id.list_price), round_value) + qty = rounding(coeff_def2uom * product_amt/(product.list_price), round_value) res = {'value': {'product_qty': qty}} return res From 1f747d892c08354a96b5bbbe3744496341e64c22 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Fri, 24 Aug 2012 16:35:38 +0200 Subject: [PATCH 003/165] [IMP] reload static paths when new modules are availables bzr revid: chs@openerp.com-20120824143538-49u29wyaojakhzfu --- addons/web/__init__.py | 1 + addons/web/__openerp__.py | 1 + addons/web/common/http.py | 25 +++++++++++++++---------- openerp-web | 3 ++- 4 files changed, 19 insertions(+), 11 deletions(-) diff --git a/addons/web/__init__.py b/addons/web/__init__.py index 621931e9167..4425f3ce572 100644 --- a/addons/web/__init__.py +++ b/addons/web/__init__.py @@ -2,6 +2,7 @@ import logging from . import common from . import controllers +from . import ir_module _logger = logging.getLogger(__name__) diff --git a/addons/web/__openerp__.py b/addons/web/__openerp__.py index fa32a8595cc..65a7939d8bb 100644 --- a/addons/web/__openerp__.py +++ b/addons/web/__openerp__.py @@ -1,6 +1,7 @@ { 'name': 'Web', 'category': 'Hidden', + 'version': '7.0.1.0', 'description': """ OpenERP Web core module. diff --git a/addons/web/common/http.py b/addons/web/common/http.py index 9c3664c8da0..4cb5b8d4bf8 100644 --- a/addons/web/common/http.py +++ b/addons/web/common/http.py @@ -461,7 +461,7 @@ class Root(object): only used in case the list of databases is requested by the server, will be filtered by this pattern """ - def __init__(self, options, openerp_addons_namespace=True): + def __init__(self, options): self.config = options if not hasattr(self.config, 'connector'): @@ -473,11 +473,9 @@ class Root(object): self.httpsession_cookie = 'httpsessionid' self.addons = {} + self.statics = {} - static_dirs = self._load_addons(openerp_addons_namespace) - if options.serve_static: - app = werkzeug.wsgi.SharedDataMiddleware( self.dispatch, static_dirs) - self.dispatch = DisableCacheMiddleware(app) + self._load_addons() if options.session_storage: if not os.path.exists(options.session_storage): @@ -490,7 +488,7 @@ class Root(object): """ return self.dispatch(environ, start_response) - def dispatch(self, environ, start_response): + def _dispatch(self, environ, start_response): """ Performs the actual WSGI dispatching for the application, may be wrapped during the initialization of the object. @@ -520,12 +518,13 @@ class Root(object): return response(environ, start_response) - def _load_addons(self, openerp_addons_namespace=True): + def _load_addons(self): """ Loads all addons at the specified addons path, returns a mapping of static URLs to the corresponding directories """ - statics = {} + openerp_addons_namespace = getattr(self.config, 'openerp_addons_namespace', True) + for addons_path in self.config.addons_path: for module in os.listdir(addons_path): if module not in addons_module: @@ -541,14 +540,20 @@ class Root(object): m = __import__(module) addons_module[module] = m addons_manifest[module] = manifest - statics['/%s/static' % module] = path_static + self.statics['/%s/static' % module] = path_static + for k, v in controllers_class: if k not in controllers_object: o = v() controllers_object[k] = o if hasattr(o, '_cp_path'): controllers_path[o._cp_path] = o - return statics + + app = self._dispatch + if self.config.serve_static: + app = werkzeug.wsgi.SharedDataMiddleware(self._dispatch, self.statics) + + self.dispatch = DisableCacheMiddleware(app) def find_handler(self, *l): """ diff --git a/openerp-web b/openerp-web index 3340b95646e..2e12a96ef64 100755 --- a/openerp-web +++ b/openerp-web @@ -105,7 +105,8 @@ if __name__ == "__main__": else: logging.basicConfig(level=getattr(logging, options.log_level.upper())) - app = web.common.http.Root(options, openerp_addons_namespace=False) + options.openerp_addons_namespace = False + app = web.common.http.Root(options) if options.proxy_mode: app = werkzeug.contrib.fixers.ProxyFix(app) From 522fb2e4b9fdf46abed3b5ca8ba43758b22253a1 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Fri, 24 Aug 2012 16:38:37 +0200 Subject: [PATCH 004/165] [FIX] add missing file bzr revid: chs@openerp.com-20120824143837-tpgu7g2rqnkag22u --- addons/web/ir_module.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 addons/web/ir_module.py diff --git a/addons/web/ir_module.py b/addons/web/ir_module.py new file mode 100644 index 00000000000..4ed47e5197c --- /dev/null +++ b/addons/web/ir_module.py @@ -0,0 +1,17 @@ +from openerp.osv import osv +import openerp.wsgi.core as oewsgi + +from common.http import Root + +class ir_module(osv.Model): + _inherit = 'ir.module.module' + + def update_list(self, cr, uid, context=None): + result = super(ir_module, self).update_list(cr, uid, context=context) + + if tuple(result) != (0, 0): + for handler in oewsgi.module_handlers: + if isinstance(handler, Root): + handler._load_addons() + + return result From 8f1a02e331f3b64d29f2cd9bd600c88d528690d0 Mon Sep 17 00:00:00 2001 From: Benoit Guillot Date: Wed, 29 Aug 2012 10:39:33 +0200 Subject: [PATCH 005/165] [IMP] add method to prepair refund and add context in the method def refund bzr revid: benoit.guillot@akretion.com.br-20120829083933-vfi198opk85dj91m --- addons/account/account_invoice.py | 102 +++++++++--------- .../account/wizard/account_invoice_refund.py | 2 +- 2 files changed, 54 insertions(+), 50 deletions(-) diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index 7bc9ceaaf61..41524e08bdf 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -1114,7 +1114,7 @@ class account_invoice(osv.osv): ids = self.search(cr, user, [('name',operator,name)] + args, limit=limit, context=context) return self.name_get(cr, user, ids, context) - def _refund_cleanup_lines(self, cr, uid, lines): + def _refund_cleanup_lines(self, cr, uid, lines, context=None): for line in lines: del line['id'] del line['invoice_id'] @@ -1126,60 +1126,64 @@ class account_invoice(osv.osv): line['invoice_line_tax_id'] = [(6,0, line.get('invoice_line_tax_id', [])) ] return map(lambda x: (0,0,x), lines) - def refund(self, cr, uid, ids, date=None, period_id=None, description=None, journal_id=None): - invoices = self.read(cr, uid, ids, ['name', 'type', 'number', 'reference', 'comment', 'date_due', 'partner_id', 'partner_contact', 'partner_insite', 'partner_ref', 'payment_term', 'account_id', 'currency_id', 'invoice_line', 'tax_line', 'journal_id', 'company_id']) + def prepair_refund(self, cr, uid, refund_id, invoice, date=None, period_id=None, description=None, journal_id=None, context=None): obj_invoice_line = self.pool.get('account.invoice.line') obj_invoice_tax = self.pool.get('account.invoice.tax') obj_journal = self.pool.get('account.journal') + del invoice['id'] + + type_dict = { + 'out_invoice': 'out_refund', # Customer Invoice + 'in_invoice': 'in_refund', # Supplier Invoice + 'out_refund': 'out_invoice', # Customer Refund + 'in_refund': 'in_invoice', # Supplier Refund + } + + invoice_lines = obj_invoice_line.read(cr, uid, invoice['invoice_line'], context=context) + invoice_lines = self._refund_cleanup_lines(cr, uid, invoice_lines, context=context) + + tax_lines = obj_invoice_tax.read(cr, uid, invoice['tax_line'], context=context) + tax_lines = filter(lambda l: l['manual'], tax_lines) + tax_lines = self._refund_cleanup_lines(cr, uid, tax_lines, context=context) + if journal_id: + refund_journal_ids = [journal_id] + elif invoice['type'] == 'in_invoice': + refund_journal_ids = obj_journal.search(cr, uid, [('type','=','purchase_refund')], context=context) + else: + refund_journal_ids = obj_journal.search(cr, uid, [('type','=','sale_refund')], context=context) + + if not date: + date = time.strftime('%Y-%m-%d') + invoice.update({ + 'type': type_dict[invoice['type']], + 'date_invoice': date, + 'state': 'draft', + 'number': False, + 'invoice_line': invoice_lines, + 'tax_line': tax_lines, + 'journal_id': refund_journal_ids + }) + if period_id: + invoice.update({ + 'period_id': period_id, + }) + if description: + invoice.update({ + 'name': description, + }) + # take the id part of the tuple returned for many2one fields + for field in ('partner_id', 'company_id', + 'account_id', 'currency_id', 'payment_term', 'journal_id'): + invoice[field] = invoice[field] and invoice[field][0] + return invoice + + def refund(self, cr, uid, ids, date=None, period_id=None, description=None, journal_id=None, context=None): + invoices = self.read(cr, uid, ids, ['name', 'type', 'number', 'reference', 'comment', 'date_due', 'partner_id', 'partner_contact', 'partner_insite', 'partner_ref', 'payment_term', 'account_id', 'currency_id', 'invoice_line', 'tax_line', 'journal_id', 'company_id'], context=context) new_ids = [] for invoice in invoices: - del invoice['id'] - - type_dict = { - 'out_invoice': 'out_refund', # Customer Invoice - 'in_invoice': 'in_refund', # Supplier Invoice - 'out_refund': 'out_invoice', # Customer Refund - 'in_refund': 'in_invoice', # Supplier Refund - } - - invoice_lines = obj_invoice_line.read(cr, uid, invoice['invoice_line']) - invoice_lines = self._refund_cleanup_lines(cr, uid, invoice_lines) - - tax_lines = obj_invoice_tax.read(cr, uid, invoice['tax_line']) - tax_lines = filter(lambda l: l['manual'], tax_lines) - tax_lines = self._refund_cleanup_lines(cr, uid, tax_lines) - if journal_id: - refund_journal_ids = [journal_id] - elif invoice['type'] == 'in_invoice': - refund_journal_ids = obj_journal.search(cr, uid, [('type','=','purchase_refund')]) - else: - refund_journal_ids = obj_journal.search(cr, uid, [('type','=','sale_refund')]) - - if not date: - date = time.strftime('%Y-%m-%d') - invoice.update({ - 'type': type_dict[invoice['type']], - 'date_invoice': date, - 'state': 'draft', - 'number': False, - 'invoice_line': invoice_lines, - 'tax_line': tax_lines, - 'journal_id': refund_journal_ids - }) - if period_id: - invoice.update({ - 'period_id': period_id, - }) - if description: - invoice.update({ - 'name': description, - }) - # take the id part of the tuple returned for many2one fields - for field in ('partner_id', 'company_id', - 'account_id', 'currency_id', 'payment_term', 'journal_id'): - invoice[field] = invoice[field] and invoice[field][0] + invoice = self.prepair_refund(cr, uid, invoice['id'], invoice, date=date, period_id=period_id, description=description, journal_id=journal_id, context=context) # create the new invoice - new_ids.append(self.create(cr, uid, invoice)) + new_ids.append(self.create(cr, uid, invoice, context=context)) return new_ids diff --git a/addons/account/wizard/account_invoice_refund.py b/addons/account/wizard/account_invoice_refund.py index b7d278b8849..a549f09e00b 100644 --- a/addons/account/wizard/account_invoice_refund.py +++ b/addons/account/wizard/account_invoice_refund.py @@ -146,7 +146,7 @@ class account_invoice_refund(osv.osv_memory): raise osv.except_osv(_('Insufficient Data!'), \ _('No period found on the invoice.')) - refund_id = inv_obj.refund(cr, uid, [inv.id], date, period, description, journal_id) + refund_id = inv_obj.refund(cr, uid, [inv.id], date, period, description, journal_id, context=context) refund = inv_obj.browse(cr, uid, refund_id[0], context=context) inv_obj.write(cr, uid, [refund.id], {'date_due': date, 'check_total': inv.check_total}) From 4b614305d4066e7b97045a1641aed925ae709b17 Mon Sep 17 00:00:00 2001 From: Benoit Guillot Date: Wed, 29 Aug 2012 10:40:32 +0200 Subject: [PATCH 006/165] [IMP] add context on the call of the method refund bzr revid: benoit.guillot@akretion.com.br-20120829084032-9ow83wx3kcmrvep7 --- addons/point_of_sale/wizard/pos_return.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/point_of_sale/wizard/pos_return.py b/addons/point_of_sale/wizard/pos_return.py index 0e5d4e1fbb5..c56fe5fd572 100644 --- a/addons/point_of_sale/wizard/pos_return.py +++ b/addons/point_of_sale/wizard/pos_return.py @@ -278,7 +278,7 @@ class add_product(osv.osv_memory): location_id=res and res[0] or None if order_id.invoice_id: - invoice_obj.refund(cr, uid, [order_id.invoice_id.id], time.strftime('%Y-%m-%d'), False, order_id.name) + invoice_obj.refund(cr, uid, [order_id.invoice_id.id], time.strftime('%Y-%m-%d'), False, order_id.name, context=context) new_picking=picking_obj.create(cr, uid, { 'name':'%s (return)' %order_id.name, 'move_lines':[], 'state':'draft', From e6f172b66d3db990aa1804716d7756339e9e82c1 Mon Sep 17 00:00:00 2001 From: Benoit Guillot Date: Wed, 29 Aug 2012 17:34:48 +0200 Subject: [PATCH 007/165] [FIX] fix typo bzr revid: benoit.guillot@akretion.com.br-20120829153448-i4ek7jny5hqgid1a --- addons/account/account_invoice.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index 41524e08bdf..7ec504fa5e8 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -1126,7 +1126,7 @@ class account_invoice(osv.osv): line['invoice_line_tax_id'] = [(6,0, line.get('invoice_line_tax_id', [])) ] return map(lambda x: (0,0,x), lines) - def prepair_refund(self, cr, uid, refund_id, invoice, date=None, period_id=None, description=None, journal_id=None, context=None): + def _prepare_refund(self, cr, uid, refund_id, invoice, date=None, period_id=None, description=None, journal_id=None, context=None): obj_invoice_line = self.pool.get('account.invoice.line') obj_invoice_tax = self.pool.get('account.invoice.tax') obj_journal = self.pool.get('account.journal') @@ -1181,7 +1181,12 @@ class account_invoice(osv.osv): invoices = self.read(cr, uid, ids, ['name', 'type', 'number', 'reference', 'comment', 'date_due', 'partner_id', 'partner_contact', 'partner_insite', 'partner_ref', 'payment_term', 'account_id', 'currency_id', 'invoice_line', 'tax_line', 'journal_id', 'company_id'], context=context) new_ids = [] for invoice in invoices: - invoice = self.prepair_refund(cr, uid, invoice['id'], invoice, date=date, period_id=period_id, description=description, journal_id=journal_id, context=context) + invoice = self._prepare_refund(cr, uid, invoice['id'], invoice, + date=date, + period_id=period_id, + description=description, + journal_id=journal_id, + context=context) # create the new invoice new_ids.append(self.create(cr, uid, invoice, context=context)) From ad02628855b2b1ae815661df5905140d47f0c884 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Thu, 27 Sep 2012 15:34:44 +0200 Subject: [PATCH 008/165] [IMP] web: add method do_action to EmbeddedClient bzr revid: chs@openerp.com-20120927133444-6dd5ck2jmjfoa9my --- addons/web/static/src/js/chrome.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index 9fdfb50307f..fcb4747a2e0 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -1174,6 +1174,9 @@ instance.web.EmbeddedClient = instance.web.Client.extend({ var self = this; return $.when(this._super()).pipe(function() { return instance.session.session_authenticate(self.dbname, self.login, self.key, true).pipe(function() { + if (!self.action_id) { + return; + } return self.rpc("/web/action/load", { action_id: self.action_id }, function(result) { var action = result.result; action.flags = _.extend({ @@ -1184,11 +1187,15 @@ instance.web.EmbeddedClient = instance.web.Client.extend({ //pager : false }, self.options, action.flags || {}); - self.action_manager.do_action(action); + self.do_action(action); }); }); }); }, + + do_action: function(action) { + return this.action_manager.do_action(action); + } }); instance.web.embed = function (origin, dbname, login, key, action, options) { From aa7a56706bc6cd58f7254279da4371e2c13484c2 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Mon, 1 Oct 2012 18:44:58 +0200 Subject: [PATCH 009/165] [IMP] version_info read info from server bzr revid: chs@openerp.com-20121001164458-6bkchfr2qoll0qq9 --- addons/web/controllers/main.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py index e2e7ebb68de..e27a07ce1cc 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -696,9 +696,7 @@ class WebClient(openerpweb.Controller): @openerpweb.jsonrequest def version_info(self, req): - return { - "version": common.release.version - } + return req.proxy('common').version()['openerp'] class Proxy(openerpweb.Controller): _cp_path = '/web/proxy' From 590b79fe96e9a4e1539242052dead57057d87d12 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Tue, 2 Oct 2012 17:55:03 +0200 Subject: [PATCH 010/165] [FIX] correct version_info bzr revid: chs@openerp.com-20121002155503-ok9m0lud5ajmno3f --- addons/web/controllers/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py index e27a07ce1cc..5b2129a47f8 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -696,7 +696,7 @@ class WebClient(openerpweb.Controller): @openerpweb.jsonrequest def version_info(self, req): - return req.proxy('common').version()['openerp'] + return req.session.proxy('common').version()['openerp'] class Proxy(openerpweb.Controller): _cp_path = '/web/proxy' From ba76751ea1fe90dffec5b37f5046039fb9e105c3 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Wed, 10 Oct 2012 14:00:26 +0200 Subject: [PATCH 011/165] [FIX] file renamed on server bzr revid: chs@openerp.com-20121010120026-lorll9na2ndt80py --- addons/web/ir_module.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web/ir_module.py b/addons/web/ir_module.py index 4ed47e5197c..5bc76a99375 100644 --- a/addons/web/ir_module.py +++ b/addons/web/ir_module.py @@ -1,5 +1,5 @@ from openerp.osv import osv -import openerp.wsgi.core as oewsgi +import openerp.service.wsgi_server as oewsgi from common.http import Root From f4ea0af205d001110683dd8f1d11a97bf2d6724f Mon Sep 17 00:00:00 2001 From: Benoit Guillot Date: Wed, 10 Oct 2012 17:37:24 +0200 Subject: [PATCH 012/165] [IMP] add docstring and fix refund_id arg. Add also a new prepare method _prepapre_cleanup_fields() to override the fields of the refund lines bzr revid: benoit.guillot@akretion.com.br-20121010153724-rgjiluytvz3z7qju --- addons/account/account_invoice.py | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index 7ec504fa5e8..ad29b199599 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -1114,19 +1114,43 @@ class account_invoice(osv.osv): ids = self.search(cr, user, [('name',operator,name)] + args, limit=limit, context=context) return self.name_get(cr, user, ids, context) + def _prepare_cleanup_fields(self, cr, uid, context=None): + """Prepare the list of the fields to use to create the refund lines + with the method _refund_cleanup_lines(). This method may be + overriden to add or remove fields to customize the refund lines + generetion (making sure to call super() to establish + a clean extension chain). + + retrun: tuple of fields to create() the refund lines + """ + return ('company_id', 'partner_id', 'account_id', 'product_id', + 'uos_id', 'account_analytic_id', 'tax_code_id', 'base_code_id') + def _refund_cleanup_lines(self, cr, uid, lines, context=None): for line in lines: del line['id'] del line['invoice_id'] - for field in ('company_id', 'partner_id', 'account_id', 'product_id', - 'uos_id', 'account_analytic_id', 'tax_code_id', 'base_code_id'): + for field in self._prepare_cleanup_fields(cr, uid, context=context): if line.get(field): line[field] = line[field][0] if 'invoice_line_tax_id' in line: line['invoice_line_tax_id'] = [(6,0, line.get('invoice_line_tax_id', [])) ] return map(lambda x: (0,0,x), lines) - def _prepare_refund(self, cr, uid, refund_id, invoice, date=None, period_id=None, description=None, journal_id=None, context=None): + def _prepare_refund(self, cr, uid, invoice_id, invoice, date=None, period_id=None, description=None, journal_id=None, context=None): + """Prepare the dict of values to create the new refund from the invoice. + This method may be overridden to implement custom + refund generation (making sure to call super() to establish + a clean extension chain). + + :param integer invoice_id: id of the invoice to refund + :param dict invoice: read of the invoice to refund + :param date date: refund creation date from the wizard + :param integer period_id: force account.period from the wizard + :param char description: description of the refund from the wizard + :param integer journal_id: account.journal from the wizard + :return: dict of value to create() the refund + """ obj_invoice_line = self.pool.get('account.invoice.line') obj_invoice_tax = self.pool.get('account.invoice.tax') obj_journal = self.pool.get('account.journal') From 907b9700be95419684b356f0d8b2ec551cf2a713 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Thu, 11 Oct 2012 13:23:00 +0200 Subject: [PATCH 013/165] [FIX] adapt to drop of standalone web client bzr revid: chs@openerp.com-20121011112300-cfhvxh4d9gg6o17l --- addons/web/http.py | 5 +---- addons/web/ir_module.py | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/addons/web/http.py b/addons/web/http.py index 13f99776135..5db3f8aedef 100644 --- a/addons/web/http.py +++ b/addons/web/http.py @@ -526,10 +526,7 @@ class Root(object): if hasattr(o, '_cp_path'): controllers_path[o._cp_path] = o - app = self._dispatch - if self.config.serve_static: - app = werkzeug.wsgi.SharedDataMiddleware(self._dispatch, self.statics) - + app = werkzeug.wsgi.SharedDataMiddleware(self._dispatch, self.statics) self.dispatch = DisableCacheMiddleware(app) def find_handler(self, *l): diff --git a/addons/web/ir_module.py b/addons/web/ir_module.py index 5bc76a99375..c4588b19aa6 100644 --- a/addons/web/ir_module.py +++ b/addons/web/ir_module.py @@ -1,7 +1,7 @@ from openerp.osv import osv import openerp.service.wsgi_server as oewsgi -from common.http import Root +from .http import Root class ir_module(osv.Model): _inherit = 'ir.module.module' From 8ee703031a5d295d7709d9f3301eb3fd3055f258 Mon Sep 17 00:00:00 2001 From: Benoit Guillot Date: Fri, 12 Oct 2012 14:24:06 +0200 Subject: [PATCH 014/165] [IMP] use browse_record instead of dict for refund creation bzr revid: benoit.guillot@akretion.com.br-20121012122406-7ghe5pazc430wtqm --- addons/account/account_invoice.py | 75 ++++++++++++++----------------- 1 file changed, 33 insertions(+), 42 deletions(-) diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index ad29b199599..2b8c2e3f099 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -1114,30 +1114,24 @@ class account_invoice(osv.osv): ids = self.search(cr, user, [('name',operator,name)] + args, limit=limit, context=context) return self.name_get(cr, user, ids, context) - def _prepare_cleanup_fields(self, cr, uid, context=None): - """Prepare the list of the fields to use to create the refund lines - with the method _refund_cleanup_lines(). This method may be - overriden to add or remove fields to customize the refund lines - generetion (making sure to call super() to establish - a clean extension chain). - - retrun: tuple of fields to create() the refund lines - """ - return ('company_id', 'partner_id', 'account_id', 'product_id', - 'uos_id', 'account_analytic_id', 'tax_code_id', 'base_code_id') - def _refund_cleanup_lines(self, cr, uid, lines, context=None): + clean_lines = [] for line in lines: - del line['id'] - del line['invoice_id'] - for field in self._prepare_cleanup_fields(cr, uid, context=context): - if line.get(field): - line[field] = line[field][0] - if 'invoice_line_tax_id' in line: - line['invoice_line_tax_id'] = [(6,0, line.get('invoice_line_tax_id', [])) ] - return map(lambda x: (0,0,x), lines) + clean_line = {} + for field in line._all_columns.keys(): + if line._all_columns[field].column._type == 'many2one': + clean_line[field] = line[field].id + elif line._all_columns[field].column._type == 'many2many': + m2m_list = [] + for link in line[field]: + m2m_list.append(link.id) + clean_line[field] = [(6,0, m2m_list)] + else: + clean_line[field] = line[field] + clean_lines.append(clean_line) + return map(lambda x: (0,0,x), clean_lines) - def _prepare_refund(self, cr, uid, invoice_id, invoice, date=None, period_id=None, description=None, journal_id=None, context=None): + def _prepare_refund(self, cr, uid, invoice, date=None, period_id=None, description=None, journal_id=None, context=None): """Prepare the dict of values to create the new refund from the invoice. This method may be overridden to implement custom refund generation (making sure to call super() to establish @@ -1145,16 +1139,13 @@ class account_invoice(osv.osv): :param integer invoice_id: id of the invoice to refund :param dict invoice: read of the invoice to refund - :param date date: refund creation date from the wizard + :param string date: refund creation date from the wizard :param integer period_id: force account.period from the wizard - :param char description: description of the refund from the wizard + :param string description: description of the refund from the wizard :param integer journal_id: account.journal from the wizard :return: dict of value to create() the refund """ - obj_invoice_line = self.pool.get('account.invoice.line') - obj_invoice_tax = self.pool.get('account.invoice.tax') obj_journal = self.pool.get('account.journal') - del invoice['id'] type_dict = { 'out_invoice': 'out_refund', # Customer Invoice @@ -1162,12 +1153,17 @@ class account_invoice(osv.osv): 'out_refund': 'out_invoice', # Customer Refund 'in_refund': 'in_invoice', # Supplier Refund } + invoice_data = {} + for field in ['name', 'reference', 'comment', 'date_due', 'partner_id', 'company_id', + 'account_id', 'currency_id', 'payment_term', 'journal_id']: + if invoice._all_columns[field].column._type == 'many2one': + invoice_data[field] = invoice[field].id + else: + invoice_data[field] = invoice[field] and invoice[field] or False - invoice_lines = obj_invoice_line.read(cr, uid, invoice['invoice_line'], context=context) - invoice_lines = self._refund_cleanup_lines(cr, uid, invoice_lines, context=context) + invoice_lines = self._refund_cleanup_lines(cr, uid, invoice.invoice_line, context=context) - tax_lines = obj_invoice_tax.read(cr, uid, invoice['tax_line'], context=context) - tax_lines = filter(lambda l: l['manual'], tax_lines) + tax_lines = filter(lambda l: l['manual'], invoice.tax_line) tax_lines = self._refund_cleanup_lines(cr, uid, tax_lines, context=context) if journal_id: refund_journal_ids = [journal_id] @@ -1178,34 +1174,29 @@ class account_invoice(osv.osv): if not date: date = time.strftime('%Y-%m-%d') - invoice.update({ + invoice_data.update({ 'type': type_dict[invoice['type']], 'date_invoice': date, 'state': 'draft', 'number': False, 'invoice_line': invoice_lines, 'tax_line': tax_lines, - 'journal_id': refund_journal_ids + 'journal_id': refund_journal_ids and refund_journal_ids[0] or False, }) if period_id: - invoice.update({ + invoice_data.update({ 'period_id': period_id, }) if description: - invoice.update({ + invoice_data.update({ 'name': description, }) - # take the id part of the tuple returned for many2one fields - for field in ('partner_id', 'company_id', - 'account_id', 'currency_id', 'payment_term', 'journal_id'): - invoice[field] = invoice[field] and invoice[field][0] - return invoice + return invoice_data def refund(self, cr, uid, ids, date=None, period_id=None, description=None, journal_id=None, context=None): - invoices = self.read(cr, uid, ids, ['name', 'type', 'number', 'reference', 'comment', 'date_due', 'partner_id', 'partner_contact', 'partner_insite', 'partner_ref', 'payment_term', 'account_id', 'currency_id', 'invoice_line', 'tax_line', 'journal_id', 'company_id'], context=context) new_ids = [] - for invoice in invoices: - invoice = self._prepare_refund(cr, uid, invoice['id'], invoice, + for invoice in self.browse(cr, uid, ids, context=context): + invoice = self._prepare_refund(cr, uid, invoice, date=date, period_id=period_id, description=description, From 3adab7ba8c71cd222e9f9b56cb50b8d7fdfe3ff8 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Mon, 15 Oct 2012 18:23:46 +0200 Subject: [PATCH 015/165] [IMP]: once bound, a session cannot be bound to another server bzr revid: chs@openerp.com-20121015162346-jwhctk988fftjsa4 --- addons/web/static/src/js/chrome.js | 24 ++++++++++++++++++------ addons/web/static/src/js/coresetup.js | 6 ++++++ 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index 2b37ea9999a..5aa8be480d3 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -1153,17 +1153,14 @@ instance.web.EmbeddedClient = instance.web.Client.extend({ _template: 'EmbedClient', init: function(parent, origin, dbname, login, key, action_id, options) { this._super(parent, origin); - - this.dbname = dbname; - this.login = login; - this.key = key; + this.bind(dbname, login, key); this.action_id = action_id; this.options = options || {}; }, start: function() { var self = this; return $.when(this._super()).pipe(function() { - return instance.session.session_authenticate(self.dbname, self.login, self.key, true).pipe(function() { + return self.authenticate().pipe(function() { if (!self.action_id) { return; } @@ -1185,7 +1182,22 @@ instance.web.EmbeddedClient = instance.web.Client.extend({ do_action: function(action) { return this.action_manager.do_action(action); - } + }, + + authenticate: function() { + var s = instance.session; + if (s.session_is_valid() && s.db === this.dbname && s.login === this.login) { + return $.when(); + } + return instance.session.session_authenticate(this.dbname, this.login, this.key, true); + }, + + bind: function(dbname, login, key) { + this.dbname = dbname; + this.login = login; + this.key = key; + }, + }); instance.web.embed = function (origin, dbname, login, key, action, options) { diff --git a/addons/web/static/src/js/coresetup.js b/addons/web/static/src/js/coresetup.js index 1f1112df2f2..cf533ed0b59 100644 --- a/addons/web/static/src/js/coresetup.js +++ b/addons/web/static/src/js/coresetup.js @@ -27,6 +27,12 @@ instance.web.Session = instance.web.JsonRPC.extend( /** @lends instance.web.Sess * Setup a sessionm */ session_bind: function(origin) { + if (!_.isUndefined(this.origin)) { + if (this.origin === origin) { + return $.when(); + } + throw new Error('Session already bound to ' + this.origin); + } var self = this; this.setup(origin); instance.web.qweb.default_dict['_s'] = this.origin; From 1e9d0c49040136d862f15faf66e15b2e6b716c61 Mon Sep 17 00:00:00 2001 From: Benoit Guillot Date: Tue, 16 Oct 2012 18:22:51 +0200 Subject: [PATCH 016/165] [FIX] skip the one2many and the many2one fields in the invoice line and support invoice_line_tax_id bzr revid: benoit.guillot@akretion.com.br-20121016162251-iwgwq6h1po9uinr8 --- addons/account/account_invoice.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index 2b8c2e3f099..7ae25f6ed33 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -1121,13 +1121,13 @@ class account_invoice(osv.osv): for field in line._all_columns.keys(): if line._all_columns[field].column._type == 'many2one': clean_line[field] = line[field].id - elif line._all_columns[field].column._type == 'many2many': - m2m_list = [] - for link in line[field]: - m2m_list.append(link.id) - clean_line[field] = [(6,0, m2m_list)] - else: + elif line._all_columns[field].column._type not in ['many2many','one2many']: clean_line[field] = line[field] + elif field == 'invoice_line_tax_id': + tax_list = [] + for tax in line[field]: + tax_list.append(tax.id) + clean_line[field] = [(6,0, tax_list)] clean_lines.append(clean_line) return map(lambda x: (0,0,x), clean_lines) @@ -1155,7 +1155,7 @@ class account_invoice(osv.osv): } invoice_data = {} for field in ['name', 'reference', 'comment', 'date_due', 'partner_id', 'company_id', - 'account_id', 'currency_id', 'payment_term', 'journal_id']: + 'account_id', 'currency_id', 'payment_term']: if invoice._all_columns[field].column._type == 'many2one': invoice_data[field] = invoice[field].id else: From f986227f8f0b354dd2ea4aabdcdec02b3628fdfd Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Tue, 30 Oct 2012 12:37:50 +0100 Subject: [PATCH 017/165] [IMP] reload: can wait server is available bzr revid: chs@openerp.com-20121030113750-4y039gx7cunwz859 --- addons/web/static/src/js/chrome.js | 51 ++++++++++++++++++++++-------- 1 file changed, 38 insertions(+), 13 deletions(-) diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index d5f72ee8bb9..26f82665a03 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -615,22 +615,47 @@ instance.web.client_actions.add("login", "instance.web.Login"); /** * Client action to reload the whole interface. * If params has an entry 'menu_id', it opens the given menu entry. + * If params has an entry 'wait', reload will wait the openerp server to be reachable before reloading */ instance.web.Reload = function(parent, params) { - var menu_id = (params && params.menu_id) || false; - var l = window.location; - - var sobj = $.deparam(l.search.substr(1)); - sobj.ts = new Date().getTime(); - var search = '?' + $.param(sobj); - - var hash = l.hash; - if (menu_id) { - hash = "#menu_id=" + menu_id; + // hide errors + if (instance.client && instance.client.crashmanager) { + instance.client.crashmanager.destroy(); } - var url = l.protocol + "//" + l.host + l.pathname + search + hash; - window.onerror = function() {}; - window.location = url; + + var reload = function() { + console.log('relocate'); + var menu_id = (params && params.menu_id) || false; + var l = window.location; + + var sobj = $.deparam(l.search.substr(1)); + sobj.ts = new Date().getTime(); + var search = '?' + $.param(sobj); + + var hash = l.hash; + if (menu_id) { + hash = "#menu_id=" + menu_id; + } + var url = l.protocol + "//" + l.host + l.pathname + search + hash; + window.location = url; + }; + + var wait_server = function() { + parent.session.rpc("/web/webclient/version_info", {}) + .done(function() { + reload(); + }) + .fail(function() { + setTimeout(wait_server, 250); + }); + }; + + if (parent && params && params.wait) { + setTimeout(wait_server, 1000); + } else { + reload(); + } + }; instance.web.client_actions.add("reload", "instance.web.Reload"); From 1f91931fa3485046a8e471dfaa783197ef573855 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Wed, 31 Oct 2012 13:01:17 +0100 Subject: [PATCH 018/165] [FIX] "Home" client action can also wait server to be available bzr revid: chs@openerp.com-20121031120117-11n1alcu8jdv0je7 --- addons/web/static/src/js/chrome.js | 68 +++++++++++++++--------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index 26f82665a03..5dd22a3212b 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -612,50 +612,51 @@ instance.web.Login = instance.web.Widget.extend({ }); instance.web.client_actions.add("login", "instance.web.Login"); -/** - * Client action to reload the whole interface. - * If params has an entry 'menu_id', it opens the given menu entry. - * If params has an entry 'wait', reload will wait the openerp server to be reachable before reloading - */ -instance.web.Reload = function(parent, params) { + +instance.web._relocate = function(url, wait) { // hide errors if (instance.client && instance.client.crashmanager) { instance.client.crashmanager.destroy(); } - var reload = function() { - console.log('relocate'); - var menu_id = (params && params.menu_id) || false; - var l = window.location; - - var sobj = $.deparam(l.search.substr(1)); - sobj.ts = new Date().getTime(); - var search = '?' + $.param(sobj); - - var hash = l.hash; - if (menu_id) { - hash = "#menu_id=" + menu_id; - } - var url = l.protocol + "//" + l.host + l.pathname + search + hash; - window.location = url; - }; - var wait_server = function() { - parent.session.rpc("/web/webclient/version_info", {}) + instance.session.rpc("/web/webclient/version_info", {}) .done(function() { - reload(); + window.location = url; }) .fail(function() { setTimeout(wait_server, 250); }); }; - if (parent && params && params.wait) { + if (wait) { setTimeout(wait_server, 1000); } else { - reload(); + window.location = url; } - +} + +/** + * Client action to reload the whole interface. + * If params has an entry 'menu_id', it opens the given menu entry. + * If params has an entry 'wait', reload will wait the openerp server to be reachable before reloading + */ +instance.web.Reload = function(parent, params) { + + var menu_id = (params && params.menu_id) || false; + var l = window.location; + + var sobj = $.deparam(l.search.substr(1)); + sobj.ts = new Date().getTime(); + var search = '?' + $.param(sobj); + + var hash = l.hash; + if (menu_id) { + hash = "#menu_id=" + menu_id; + } + var url = l.protocol + "//" + l.host + l.pathname + search + hash; + + instance.web._relocate(url, params && params.wait); }; instance.web.client_actions.add("reload", "instance.web.Reload"); @@ -665,7 +666,7 @@ instance.web.client_actions.add("reload", "instance.web.Reload"); */ instance.web.HistoryBack = function(parent, params) { if (!parent.history_back()) { - window.location = '/' + (window.location.search || ''); + instance.web.Home(parent); } }; instance.web.client_actions.add("history_back", "instance.web.HistoryBack"); @@ -673,11 +674,10 @@ instance.web.client_actions.add("history_back", "instance.web.HistoryBack"); /** * Client action to go back home. */ -instance.web.Home = instance.web.Widget.extend({ - init: function(parent, params) { - window.location = '/' + (window.location.search || ''); - } -}); +instance.web.Home = function(parent, params) { + var url = '/' + (window.location.search || ''); + instance.web._relocate(url, params && params.wait); +}; instance.web.client_actions.add("home", "instance.web.Home"); instance.web.ChangePassword = instance.web.Widget.extend({ From 595a2b3bb160351bca19c40414ede990f45376ea Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Tue, 6 Nov 2012 17:36:58 +0100 Subject: [PATCH 019/165] [IMP] only "special=cancel" buttons close the form bzr revid: chs@openerp.com-20121106163658-fez0bvbddjbuw5wi --- addons/web/static/src/js/views.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index ebc7c326724..bf7166eb7cf 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -1234,7 +1234,7 @@ instance.web.View = instance.web.Widget.extend({ } }; - if (action_data.special) { + if (action_data.special === 'cancel') { return handler({"type":"ir.actions.act_window_close"}); } else if (action_data.type=="object") { var args = [[record_id]], additional_args = []; From c8e1d477990430028f9ad68d295b8d3d4017fd46 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Wed, 7 Nov 2012 18:18:20 +0100 Subject: [PATCH 020/165] :%s/_relocate/redirect/g bzr revid: chs@openerp.com-20121107171820-v7hryce3opnzuf0i --- addons/web/static/src/js/chrome.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index 1b90ff3ff44..7fe750d1b60 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -613,7 +613,7 @@ instance.web.Login = instance.web.Widget.extend({ instance.web.client_actions.add("login", "instance.web.Login"); -instance.web._relocate = function(url, wait) { +instance.web.redirect = function(url, wait) { // hide errors if (instance.client && instance.client.crashmanager) { instance.client.crashmanager.destroy(); @@ -656,7 +656,7 @@ instance.web.Reload = function(parent, action) { } var url = l.protocol + "//" + l.host + l.pathname + search + hash; - instance.web._relocate(url, params.wait); + instance.web.redirect(url, params.wait); }; instance.web.client_actions.add("reload", "instance.web.Reload"); @@ -676,7 +676,7 @@ instance.web.client_actions.add("history_back", "instance.web.HistoryBack"); */ instance.web.Home = function(parent, action) { var url = '/' + (window.location.search || ''); - instance.web._relocate(url, action.params && action.params.wait); + instance.web.redirect(url, action.params && action.params.wait); }; instance.web.client_actions.add("home", "instance.web.Home"); From eaa3da915b5c3b22ddaaa2f4e29b1854e748e2f1 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Thu, 8 Nov 2012 15:50:01 +0100 Subject: [PATCH 021/165] [FIX] improve warning dialog css bzr revid: chs@openerp.com-20121108145001-pswe7r5ss4nzgu00 --- addons/web/static/src/css/base.css | 10 ++++++++++ addons/web/static/src/css/base.sass | 9 +++++++++ addons/web/static/src/xml/base.xml | 4 ++-- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 94d02758ad0..b34e699b541 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -802,6 +802,16 @@ .openerp .oe_notification { z-index: 1050; } +.openerp .oe_dialog_warning { + width: 100%; +} +.openerp .oe_dialog_warning p { + text-align: center; +} +.openerp .oe_dialog_icon { + padding: 5px; + width: 32px; +} .openerp .oe_login { background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAGCAYAAADgzO9IAAAAKUlEQVQIHWO8e/fufwYsgAUkJigoiCIF5DMyoYggcUiXgNnBiGQKmAkARpcEQeriln4AAAAASUVORK5CYII=); text-align: center; diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index f911929e159..368df7f047c 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -680,6 +680,15 @@ $sheet-padding: 16px .oe_notification z-index: 1050 // }}} + // CrashManager {{{ + .oe_dialog_warning + width: 100% + p + text-align: center + .oe_dialog_icon + padding: 5px + width: 32px + // }}} // Login {{{ .oe_login background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAGCAYAAADgzO9IAAAAKUlEQVQIHWO8e/fufwYsgAUkJigoiCIF5DMyoYggcUiXgNnBiGQKmAkARpcEQeriln4AAAAASUVORK5CYII=) diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 215374cb6fb..553543f9d0a 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -36,11 +36,11 @@ - +

- var message = d.message ? d.message : d.error.data.fault_code; + var message = d.error.message ? d.error.message : d.error.data.fault_code; d.html_error = context.engine.tools.html_escape(message) .replace(/\n/g, '
');
From 9cb1b65cc73c815cb3e1668219e00d789882fd8d Mon Sep 17 00:00:00 2001 From: Saurang Suthar Date: Mon, 12 Nov 2012 17:37:29 +0530 Subject: [PATCH 022/165] [IMP]stock:displayed most recent stock moves on the top in list view of Stock Moves bzr revid: ssu@tinyerp.com-20121112120729-wb57o4mmdug6exlg --- addons/stock/stock.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 606cb9247d5..12b56eb6289 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -1606,7 +1606,7 @@ class stock_move(osv.osv): _name = "stock.move" _description = "Stock Move" - _order = 'date_expected desc, id' + _order = 'id desc, picking_id' _log_create = False def action_partial_move(self, cr, uid, ids, context=None): From 50fa72389b9348ec330b6b4a1f5ecf1f226508b1 Mon Sep 17 00:00:00 2001 From: Saurang Suthar Date: Mon, 12 Nov 2012 19:03:21 +0530 Subject: [PATCH 023/165] [IMP]delivery:set kg as UoM with weight field in Internal Moves bzr revid: ssu@tinyerp.com-20121112133321-qkksfl7lg7423d1j --- addons/delivery/delivery_view.xml | 9 +++++++-- addons/delivery/stock.py | 13 +++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/addons/delivery/delivery_view.xml b/addons/delivery/delivery_view.xml index 9b67d6b01b9..a8a2478f339 100644 --- a/addons/delivery/delivery_view.xml +++ b/addons/delivery/delivery_view.xml @@ -243,8 +243,13 @@ - - + + + + + + + diff --git a/addons/delivery/stock.py b/addons/delivery/stock.py index c3ce236dc2e..a975314d2ab 100644 --- a/addons/delivery/stock.py +++ b/addons/delivery/stock.py @@ -66,6 +66,7 @@ class stock_picking(osv.osv): }), 'carrier_tracking_ref': fields.char('Carrier Tracking Ref', size=32), 'number_of_packages': fields.integer('Number of Packages'), + 'uom_id': fields.related('uom_id', 'product_id', type='many2one', relation='product.uom', string='UoM', readonly=True), } def _prepare_shipping_invoice_line(self, cr, uid, picking, invoice, context=None): @@ -133,6 +134,18 @@ class stock_picking(osv.osv): invoice_obj.button_compute(cr, uid, [invoice.id], context=context) return result + def _get_uom(self, cr, uid, context=None): + try: + product = self.pool.get('ir.model.data').get_object(cr, uid, 'product', 'product_uom_kgm') + except ValueError: + # a ValueError is returned if the xml id given is not found in the table ir_model_data + return False + return product.id + + _defaults = { + 'uom_id': _get_uom, + } + stock_picking() class stock_move(osv.osv): From abdbd41a90f1f921812b10bf24347473d2b2cb39 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Wed, 14 Nov 2012 23:44:26 +0100 Subject: [PATCH 024/165] [FIX] embed client: use done() bzr revid: chs@openerp.com-20121114224426-nbp1zb9c2r2tcnn4 --- addons/web/static/src/js/chrome.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index c48c231bb99..9a0de562b11 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -1218,7 +1218,7 @@ instance.web.EmbeddedClient = instance.web.Client.extend({ if (!self.action_id) { return; } - return self.rpc("/web/action/load", { action_id: self.action_id }, function(result) { + return self.rpc("/web/action/load", { action_id: self.action_id }).done(function(result) { var action = result; action.flags = _.extend({ //views_switcher : false, From a232b8559002ecae2ea10f863a1d02c32bc72ddb Mon Sep 17 00:00:00 2001 From: "pankita shah (Open ERP)" Date: Wed, 21 Nov 2012 12:47:18 +0530 Subject: [PATCH 025/165] [IMP] in height,width,length add cm and imrove stock Journal, and imrove date_done field in incomming_shippment,internal moves and delivery order bzr revid: shp@tinyerp.com-20121121071718-cl9dbck5nd37i9ei --- addons/product/product.py | 14 ++++++++++ addons/product/product_view.xml | 46 +++++++++++++++++++-------------- addons/stock/product.py | 2 +- addons/stock/stock.py | 4 ++- 4 files changed, 44 insertions(+), 22 deletions(-) diff --git a/addons/product/product.py b/addons/product/product.py index 1333c9581a7..1c45ee7f24b 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -784,6 +784,9 @@ class product_packaging(osv.osv): 'height': fields.float('Height', help='The height of the package'), 'width': fields.float('Width', help='The width of the package'), 'length': fields.float('Length', help='The length of the package'), + 'uom_id': fields.related('uom_id', 'product_id', type='many2one', relation='product.uom', string='UoM', readonly=True), + 'uom_id1': fields.related('uom_id', 'product_id', type='many2one', relation='product.uom', string='UoM', readonly=True), + 'uom_id2': fields.related('uom_id', 'product_id', type='many2one', relation='product.uom', string='UoM', readonly=True), } @@ -809,10 +812,21 @@ class product_packaging(osv.osv): res = cr.fetchone() return (res and res[0]) or False + def _get_uom(self, cr, uid, context=None): + try: + product = self.pool.get('ir.model.data').get_object(cr, uid, 'product', 'product_uom_cm') + except ValueError: + # a ValueError is returned if the xml id given is not found in the table ir_model_data + return False + return product.id + _defaults = { 'rows' : lambda *a : 3, 'sequence' : lambda *a : 1, 'ul' : _get_1st_ul, + 'uom_id': _get_uom, + 'uom_id1': _get_uom, + 'uom_id2': _get_uom, } def checksum(ean): diff --git a/addons/product/product_view.xml b/addons/product/product_view.xml index 7b4197305d4..e92331d77a0 100644 --- a/addons/product/product_view.xml +++ b/addons/product/product_view.xml @@ -547,26 +547,32 @@ product.packaging

- - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/addons/stock/product.py b/addons/stock/product.py index 4d955495c28..d535f85bc64 100644 --- a/addons/stock/product.py +++ b/addons/stock/product.py @@ -530,7 +530,7 @@ class product_category(osv.osv): _columns = { 'property_stock_journal': fields.property('account.journal', relation='account.journal', type='many2one', - string='Stock journal', view_load=True, + string='Stock Journal', view_load=True, help="When doing real-time inventory valuation, this is the Accounting Journal in which entries will be automatically posted when stock moves are processed."), 'property_stock_account_input_categ': fields.property('account.account', type='many2one', relation='account.account', diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 03a9ede7221..a3dfcd079ff 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -655,7 +655,7 @@ class stock_picking(osv.osv): 'min_date': fields.function(get_min_max_date, fnct_inv=_set_minimum_date, multi="min_max_date", store=True, type='datetime', string='Scheduled Time', select=1, help="Scheduled time for the shipment to be processed"), 'date': fields.datetime('Time', help="Creation time, usually the time of the order.", select=True, states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}), - 'date_done': fields.datetime('Date Done', help="Date of Completion", states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}), + 'date_done': fields.datetime('Date of Transfer', help="Date of Completion", states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}), 'max_date': fields.function(get_min_max_date, fnct_inv=_set_maximum_date, multi="min_max_date", store=True, type='datetime', string='Max. Expected Date', select=2), 'move_lines': fields.one2many('stock.move', 'picking_id', 'Internal Moves', states={'done': [('readonly', True)], 'cancel': [('readonly', True)]}), @@ -3035,6 +3035,7 @@ class stock_picking_in(osv.osv): _columns = { 'backorder_id': fields.many2one('stock.picking.in', 'Back Order of', states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}, help="If this shipment was split, then this field links to the shipment which contains the already processed part.", select=True), + 'date_done': fields.datetime('Date of Reception', help="Date of Completion", states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}), 'state': fields.selection( [('draft', 'Draft'), ('auto', 'Waiting Another Operation'), @@ -3080,6 +3081,7 @@ class stock_picking_out(osv.osv): _columns = { 'backorder_id': fields.many2one('stock.picking.out', 'Back Order of', states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}, help="If this shipment was split, then this field links to the shipment which contains the already processed part.", select=True), + 'date_done': fields.datetime('Date of Delivery ', help="Date of Completion", states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}), 'state': fields.selection( [('draft', 'Draft'), ('auto', 'Waiting Another Operation'), From 991f538fb1797292920ca5272f2cf886a2685449 Mon Sep 17 00:00:00 2001 From: "pankita shah (Open ERP)" Date: Thu, 22 Nov 2012 14:37:31 +0530 Subject: [PATCH 026/165] [IMP] cm,kg with height,length,widthand wigth bzr revid: shp@tinyerp.com-20121122090731-ozrp4wudie5e2row --- addons/delivery/delivery_view.xml | 2 +- addons/delivery/stock.py | 12 ++---------- addons/product/product.py | 21 +++++++-------------- addons/product/product_view.xml | 6 +++--- 4 files changed, 13 insertions(+), 28 deletions(-) diff --git a/addons/delivery/delivery_view.xml b/addons/delivery/delivery_view.xml index a8a2478f339..006e70a0324 100644 --- a/addons/delivery/delivery_view.xml +++ b/addons/delivery/delivery_view.xml @@ -248,7 +248,7 @@ - + diff --git a/addons/delivery/stock.py b/addons/delivery/stock.py index a975314d2ab..a84a22654b2 100644 --- a/addons/delivery/stock.py +++ b/addons/delivery/stock.py @@ -66,7 +66,7 @@ class stock_picking(osv.osv): }), 'carrier_tracking_ref': fields.char('Carrier Tracking Ref', size=32), 'number_of_packages': fields.integer('Number of Packages'), - 'uom_id': fields.related('uom_id', 'product_id', type='many2one', relation='product.uom', string='UoM', readonly=True), + 'product_uom_weight': fields.many2one('product.uom', 'Unit of Measure', required=True,readonly="1",help="Unit of Measure (Unit of Measure) is the unit of measurement for Duration",), } def _prepare_shipping_invoice_line(self, cr, uid, picking, invoice, context=None): @@ -134,16 +134,8 @@ class stock_picking(osv.osv): invoice_obj.button_compute(cr, uid, [invoice.id], context=context) return result - def _get_uom(self, cr, uid, context=None): - try: - product = self.pool.get('ir.model.data').get_object(cr, uid, 'product', 'product_uom_kgm') - except ValueError: - # a ValueError is returned if the xml id given is not found in the table ir_model_data - return False - return product.id - _defaults = { - 'uom_id': _get_uom, + 'product_uom_weight': lambda self,cr,uid,c: self.pool.get('product.uom').search(cr, uid, [('name', '=', _('kg'))], context=c)[0], } stock_picking() diff --git a/addons/product/product.py b/addons/product/product.py index 1c45ee7f24b..6bee0567480 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -784,9 +784,9 @@ class product_packaging(osv.osv): 'height': fields.float('Height', help='The height of the package'), 'width': fields.float('Width', help='The width of the package'), 'length': fields.float('Length', help='The length of the package'), - 'uom_id': fields.related('uom_id', 'product_id', type='many2one', relation='product.uom', string='UoM', readonly=True), - 'uom_id1': fields.related('uom_id', 'product_id', type='many2one', relation='product.uom', string='UoM', readonly=True), - 'uom_id2': fields.related('uom_id', 'product_id', type='many2one', relation='product.uom', string='UoM', readonly=True), + 'product_uom_width': fields.many2one('product.uom', 'Unit of Measure',readonly="1", required=True, help="Unit of Measure (Unit of Measure) is the unit of measurement for Duration",), + 'product_uom_length': fields.many2one('product.uom', 'Unit of Measure', readonly="1",required=True, help="Unit of Measure (Unit of Measure) is the unit of measurement for Duration",), + 'product_uom_height': fields.many2one('product.uom', 'Unit of Measure',readonly="1", required=True, help="Unit of Measure (Unit of Measure) is the unit of measurement for Duration",), } @@ -812,21 +812,14 @@ class product_packaging(osv.osv): res = cr.fetchone() return (res and res[0]) or False - def _get_uom(self, cr, uid, context=None): - try: - product = self.pool.get('ir.model.data').get_object(cr, uid, 'product', 'product_uom_cm') - except ValueError: - # a ValueError is returned if the xml id given is not found in the table ir_model_data - return False - return product.id - _defaults = { 'rows' : lambda *a : 3, 'sequence' : lambda *a : 1, 'ul' : _get_1st_ul, - 'uom_id': _get_uom, - 'uom_id1': _get_uom, - 'uom_id2': _get_uom, + 'product_uom_width': lambda self,cr,uid,c: self.pool.get('product.uom').search(cr, uid, [('name', '=', _('cm'))], context=c)[0], + 'product_uom_length': lambda self,cr,uid,c: self.pool.get('product.uom').search(cr, uid, [('name', '=', _('cm'))], context=c)[0], + 'product_uom_height': lambda self,cr,uid,c: self.pool.get('product.uom').search(cr, uid, [('name', '=', _('cm'))], context=c)[0] + } def checksum(ean): diff --git a/addons/product/product_view.xml b/addons/product/product_view.xml index e92331d77a0..5f1c55c6bdb 100644 --- a/addons/product/product_view.xml +++ b/addons/product/product_view.xml @@ -564,11 +564,11 @@ - + - + - + From f6e0139229f0821febb12207ec5791545f7d99e5 Mon Sep 17 00:00:00 2001 From: "pankita shah (Open ERP)" Date: Thu, 22 Nov 2012 16:47:25 +0530 Subject: [PATCH 027/165] [IMP] view of product and additiona info tab in internal moves bzr revid: shp@tinyerp.com-20121122111725-nkbap0et70s3m2nm --- addons/delivery/delivery_view.xml | 13 ++++++------- addons/product/product_view.xml | 22 ++++++++++++++++------ 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/addons/delivery/delivery_view.xml b/addons/delivery/delivery_view.xml index 006e70a0324..6f124ebfcba 100644 --- a/addons/delivery/delivery_view.xml +++ b/addons/delivery/delivery_view.xml @@ -243,13 +243,12 @@ - - - - - - - + diff --git a/addons/product/product_view.xml b/addons/product/product_view.xml index 5f1c55c6bdb..df4d72715eb 100644 --- a/addons/product/product_view.xml +++ b/addons/product/product_view.xml @@ -563,12 +563,22 @@ - - - - - - +