From e77abb81fe3af1bad710a199b5aeb4b684754518 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Thu, 10 Nov 2011 16:46:14 +0100 Subject: [PATCH 001/271] [IMP] Use babel's locale-aware date formatting when formatting dates in read_group titles bzr revid: xmo@openerp.com-20111110154614-ok0i1w11xvace41y --- openerp/osv/orm.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/openerp/osv/orm.py b/openerp/osv/orm.py index a89074d322d..a93f4f4a620 100644 --- a/openerp/osv/orm.py +++ b/openerp/osv/orm.py @@ -54,6 +54,8 @@ import time import traceback import types import warnings + +import babel.dates from lxml import etree import fields @@ -2471,7 +2473,9 @@ class BaseModel(object): dt = datetime.datetime.strptime(alldata[d['id']][groupby][:7], '%Y-%m') days = calendar.monthrange(dt.year, dt.month)[1] - d[groupby] = datetime.datetime.strptime(d[groupby][:10], '%Y-%m-%d').strftime('%B %Y') + date_value = datetime.datetime.strptime(d[groupby][:10], '%Y-%m-%d') + d[groupby] = babel.dates.format_date( + date_value, format='MMMM yyyy', locale=context.get('lang', 'en_US')) d['__domain'] = [(groupby, '>=', alldata[d['id']][groupby] and datetime.datetime.strptime(alldata[d['id']][groupby][:7] + '-01', '%Y-%m-%d').strftime('%Y-%m-%d') or False),\ (groupby, '<=', alldata[d['id']][groupby] and datetime.datetime.strptime(alldata[d['id']][groupby][:7] + '-' + str(days), '%Y-%m-%d').strftime('%Y-%m-%d') or False)] + domain del alldata[d['id']][groupby] From 79b29e17c4966f0be4f6bc42397c156e6e2d7e49 Mon Sep 17 00:00:00 2001 From: "pankita shah (Open ERP)" Date: Wed, 25 Jul 2012 12:59:52 +0530 Subject: [PATCH 002/271] [FIX]remove ProgrammingError in event module bzr revid: shp@tinyerp.com-20120725072952-mcnyappum33w1smy --- addons/event/report/report_event_registration.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/event/report/report_event_registration.py b/addons/event/report/report_event_registration.py index 17472e0cc95..59515f87a00 100644 --- a/addons/event/report/report_event_registration.py +++ b/addons/event/report/report_event_registration.py @@ -80,6 +80,7 @@ class report_event_registration(osv.osv): LEFT JOIN event_registration r ON (e.id=r.event_id) + where r.id is not null GROUP BY event_id, From 7096a336c084bab9f12aa1d13ae96e82cbf12d7d Mon Sep 17 00:00:00 2001 From: Date: Tue, 28 Aug 2012 16:22:02 +0200 Subject: [PATCH 003/271] [FIX] a default value (created using "Set Default" wizard) should never be shared between companies, but assigned on the user's company bzr revid: guewen.baconnier@camptocamp.com-20120828142202-9lwdicrdgc2spp6s --- addons/web/static/src/js/view_form.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index b64f34f3aaf..60e3d8361bc 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -1007,7 +1007,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM field_to_set, self.fields[field_to_set].get_value(), all_users, - false, + true, condition || false ]).then(function () { d.close(); }); }} From dad2475d9f68d8bafb0dcb633a7b05256a8ea0be Mon Sep 17 00:00:00 2001 From: Saurang Suthar Date: Wed, 26 Sep 2012 12:01:47 +0530 Subject: [PATCH 004/271] [IMP]sale_crm:made Convert to Quotation button invisible if opportunity is closed(Won) bzr revid: ssu@tinyerp.com-20120926063147-l4nvifaehms9lugc --- addons/sale_crm/sale_crm_view.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/sale_crm/sale_crm_view.xml b/addons/sale_crm/sale_crm_view.xml index e54ba158b9b..efee3953788 100644 --- a/addons/sale_crm/sale_crm_view.xml +++ b/addons/sale_crm/sale_crm_view.xml @@ -9,8 +9,8 @@ - From 533ac5b6f3258fda737b2e9818302657faf87e8f Mon Sep 17 00:00:00 2001 From: "Mayur Maheshwari (OpenERP)" Date: Wed, 3 Oct 2012 14:34:31 +0530 Subject: [PATCH 068/271] [FIX]hr_expense: remove purchase_ok from return bzr revid: mma@tinyerp.com-20121003090431-ia11akxym2ax2nsy --- addons/hr_expense/hr_expense.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr_expense/hr_expense.py b/addons/hr_expense/hr_expense.py index 91dc44fed61..c685eb3f95b 100644 --- a/addons/hr_expense/hr_expense.py +++ b/addons/hr_expense/hr_expense.py @@ -243,7 +243,7 @@ class product_product(osv.osv): data_obj = self.pool.get('ir.model.data') cat_id = data_obj._get_id(cr, uid, 'hr_expense', 'cat_expense') categ_id = data_obj.browse(cr, uid, cat_id).res_id - res = {'value' : {'type':'service','procure_method':'make_to_stock','supply_method':'buy','purchase_ok':True,'sale_ok' :False,'categ_id':categ_id }} + res = {'value' : {'type':'service','procure_method':'make_to_stock','supply_method':'buy', 'sale_ok' :False,'categ_id':categ_id }} return res product_product() From 638982a0d29c429fac29b9c6e77d3722520dfb1a Mon Sep 17 00:00:00 2001 From: Saurang Suthar Date: Wed, 3 Oct 2012 14:46:21 +0530 Subject: [PATCH 069/271] [IMP]sale:rename field name Several analytic accounts on sales into Use multiple analytic accounts on sales bzr revid: ssu@tinyerp.com-20121003091621-7ga3az5hlthor6ab --- addons/sale/res_config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sale/res_config.py b/addons/sale/res_config.py index 843e1fd3343..50eaf7a394a 100644 --- a/addons/sale/res_config.py +++ b/addons/sale/res_config.py @@ -125,7 +125,7 @@ class sale_configuration(osv.osv_memory): class account_config_settings(osv.osv_memory): _inherit = 'account.config.settings' _columns = { - 'module_sale_analytic_plans': fields.boolean('Several analytic accounts on sales', + 'module_sale_analytic_plans': fields.boolean('Use multiple analytic accounts on sales', help="""This allows install module sale_analytic_plans."""), 'group_analytic_account_for_sales': fields.boolean('Analytic accounting for sales', implied_group='sale.group_analytic_accounting', From b993bf588fadac427a801d18e1aef46a3be6f52e Mon Sep 17 00:00:00 2001 From: Saurang Suthar Date: Wed, 3 Oct 2012 14:56:11 +0530 Subject: [PATCH 070/271] [IMP]hr_attendance:rename field Track attendances into Attendance group allocation to users bzr revid: ssu@tinyerp.com-20121003092611-sklycsd74m4n669h --- addons/hr_attendance/res_config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr_attendance/res_config.py b/addons/hr_attendance/res_config.py index 0da2d183409..c32e056621d 100644 --- a/addons/hr_attendance/res_config.py +++ b/addons/hr_attendance/res_config.py @@ -25,7 +25,7 @@ class hr_attendance_config_settings(osv.osv_memory): _inherit = 'hr.config.settings' _columns = { - 'group_hr_attendance': fields.boolean('Track attendances', + 'group_hr_attendance': fields.boolean('Attendance group allocation to users', implied_group='base.group_hr_attendance', help="Allocates attendance group to all users."), } From 948841f419e54d4b08ec59169b4f6b102decb9f4 Mon Sep 17 00:00:00 2001 From: "Sanjay Gohel (Open ERP)" Date: Wed, 3 Oct 2012 14:59:39 +0530 Subject: [PATCH 071/271] [IMP]improve help bzr revid: sgo@tinyerp.com-20121003092939-nr2u8ft9uozb24ev --- 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 6c73f4513a3..b89b687db98 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -184,7 +184,7 @@ class sale_order(osv.osv): 'user_id': fields.many2one('res.users', 'Salesperson', states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}, select=True), 'partner_id': fields.many2one('res.partner', 'Customer', readonly=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}, required=True, change_default=True, select=True), 'partner_invoice_id': fields.many2one('res.partner', 'Invoice Address', readonly=True, required=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}, help="Invoice address for current sales order."), - 'partner_shipping_id': fields.many2one('res.partner', 'Delivery Address', readonly=True, required=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}, help="Shipping address for current sales order."), + 'partner_shipping_id': fields.many2one('res.partner', 'Delivery Address', readonly=True, required=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}, help="Delivery address for current sales order."), 'order_policy': fields.selection([ ('manual', 'On Demand'), ], 'Create Invoice', required=True, readonly=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}, From 43951ef5b42310889ff4b5ce6f14e1bb5a3f327c Mon Sep 17 00:00:00 2001 From: "Sanjay Gohel (Open ERP)" Date: Wed, 3 Oct 2012 15:07:42 +0530 Subject: [PATCH 072/271] [IMP]rename field and improve code for removing error bzr revid: sgo@tinyerp.com-20121003093742-waibinp6s7t6ismv --- addons/crm/crm_lead.py | 2 +- addons/sale/sale.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index 7e33f397e8a..cfa30a48b7b 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -776,7 +776,7 @@ class crm_lead(base_stage, format_address, osv.osv): 'default_user_id': uid, 'default_section_id': opportunity.section_id and opportunity.section_id.id or False, 'default_email_from': opportunity.email_from, - 'default_state': 'open', + 'default_state': 'needs-action', 'default_name': opportunity.name, } return res diff --git a/addons/sale/sale.py b/addons/sale/sale.py index c47bf1357c8..5f12d302f10 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -694,7 +694,7 @@ class sale_order_line(osv.osv): _description = 'Sales Order Line' _columns = { 'order_id': fields.many2one('sale.order', 'Order Reference', required=True, ondelete='cascade', select=True, readonly=True, states={'draft':[('readonly',False)]}), - 'name': fields.text('Product Description', size=256, required=True, select=True, readonly=True, states={'draft': [('readonly', False)]}), + 'name': fields.text('Description', size=256, required=True, select=True, readonly=True, states={'draft': [('readonly', False)]}), 'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of sales order lines."), 'product_id': fields.many2one('product.product', 'Product', domain=[('sale_ok', '=', True)], change_default=True), 'invoice_lines': fields.many2many('account.invoice.line', 'sale_order_line_invoice_rel', 'order_line_id', 'invoice_id', 'Invoice Lines', readonly=True), From 4ef3f9218bb97b66b301f84ed49661d3be79a909 Mon Sep 17 00:00:00 2001 From: "Purnendu Singh (OpenERP)" Date: Wed, 3 Oct 2012 15:12:42 +0530 Subject: [PATCH 073/271] [IMP] document: add on_change on fname so it will update the download link with the name of attached document bzr revid: psi@tinyerp.com-20121003094242-5wu6pki5cx442jte --- addons/document/document.py | 10 ++++++++-- addons/document/document_view.xml | 13 +++---------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/addons/document/document.py b/addons/document/document.py index 3ae783f49e7..cbc20edc044 100644 --- a/addons/document/document.py +++ b/addons/document/document.py @@ -36,7 +36,6 @@ DMS_ROOT_PATH = tools.config.get('document_path', os.path.join(tools.config['roo class document_file(osv.osv): _inherit = 'ir.attachment' - _rec_name = 'datas_fname' def _attach_parent_id(self, cr, uid, ids=None, context=None): @@ -149,7 +148,14 @@ class document_file(osv.osv): _sql_constraints = [ # filename_uniq is not possible in pure SQL ] - def _check_duplication(self, cr, uid, vals, ids=None, op='create'): + + def onchange_file(self, cr, uid, ids, datas_fname=False, context=None): + res = {'value':{}} + if datas_fname: + res['value'].update({'name': datas_fname}) + return res + + def _check_duplication(self, cr, uid, vals, ids=[], op='create'): name = vals.get('name', False) parent_id = vals.get('parent_id', False) res_model = vals.get('res_model', False) diff --git a/addons/document/document_view.xml b/addons/document/document_view.xml index 8d1ff0850b3..54776c4d36e 100644 --- a/addons/document/document_view.xml +++ b/addons/document/document_view.xml @@ -228,9 +228,11 @@ + + + - @@ -339,15 +341,6 @@ - - ir.attachment.view.inherit - ir.attachment - - - - - - process.node.form From 60f3b375bbeb598e2ebfc24c340f357b177921f5 Mon Sep 17 00:00:00 2001 From: "Randhir Mayatra (OpenERP)" Date: Wed, 3 Oct 2012 15:20:03 +0530 Subject: [PATCH 074/271] [IMP] make changes into thehr_expense module bzr revid: rma@tinyerp.com-20121003095003-98n5tb4tcscn0o07 --- addons/hr_expense/__openerp__.py | 2 +- addons/hr_expense/hr_expense.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/hr_expense/__openerp__.py b/addons/hr_expense/__openerp__.py index 058bf361d50..4b273a9cc81 100644 --- a/addons/hr_expense/__openerp__.py +++ b/addons/hr_expense/__openerp__.py @@ -46,7 +46,7 @@ This module also uses analytic accounting and is compatible with the invoice on 'author': 'OpenERP SA', 'website': 'http://www.openerp.com', 'images': ['images/hr_expenses_analysis.jpeg', 'images/hr_expenses.jpeg'], - 'depends': ['hr', 'account_voucher','procurement'], + 'depends': ['hr', 'account_voucher'], 'data': [ 'security/ir.model.access.csv', 'hr_expense_data.xml', diff --git a/addons/hr_expense/hr_expense.py b/addons/hr_expense/hr_expense.py index 91dc44fed61..61b091d1d51 100644 --- a/addons/hr_expense/hr_expense.py +++ b/addons/hr_expense/hr_expense.py @@ -243,7 +243,7 @@ class product_product(osv.osv): data_obj = self.pool.get('ir.model.data') cat_id = data_obj._get_id(cr, uid, 'hr_expense', 'cat_expense') categ_id = data_obj.browse(cr, uid, cat_id).res_id - res = {'value' : {'type':'service','procure_method':'make_to_stock','supply_method':'buy','purchase_ok':True,'sale_ok' :False,'categ_id':categ_id }} + res = {'value' : {'type':'service','purchase_ok':True,'sale_ok' :False,'categ_id':categ_id }} return res product_product() From 18742c545d3ea3ef57cfb4a64b599ebc3b8c6f3e Mon Sep 17 00:00:00 2001 From: "Randhir Mayatra (OpenERP)" Date: Wed, 3 Oct 2012 15:39:10 +0530 Subject: [PATCH 075/271] [IMP] make changes into project module bzr revid: rma@tinyerp.com-20121003100910-96m1dczfdovlky6j --- addons/project/__openerp__.py | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/project/__openerp__.py b/addons/project/__openerp__.py index 5f549a719b5..85e33be777a 100644 --- a/addons/project/__openerp__.py +++ b/addons/project/__openerp__.py @@ -39,7 +39,6 @@ 'base_setup', 'base_status', 'product', - 'procurement', 'analytic', 'board', 'mail', From bb4b253dfda091393289c08ddd9822be46b2fb4f Mon Sep 17 00:00:00 2001 From: "Ajay Chauhan (OpenERP)" Date: Wed, 3 Oct 2012 16:06:08 +0530 Subject: [PATCH 076/271] [IMP] mrp: added onchange method for product_uom field bzr revid: cha@tinyerp.com-20121003103608-1uuh3t9mw7i2scif --- addons/mrp/mrp.py | 11 +++++++++++ addons/mrp/mrp_view.xml | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index cf203a60c7f..a570842a36e 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -274,6 +274,17 @@ class mrp_bom(osv.osv): return {'value': {'name': prod.name, 'product_uom': prod.uom_id.id}} return {} + def onchange_uom(self, cr, uid, ids, product_id, product_uom, context=None): + res = {'value':{}} + if not product_uom or not product_id: + return res + product = self.pool.get('product.product').browse(cr, uid, product_id, context=context) + uom = self.pool.get('product.uom').browse(cr, uid, product_uom, context=context) + if uom.category_id.id != product.uom_id.category_id.id: + res['warning'] = {'title': _('Warning'), 'message': _('Selected Unit of Measure does not belong to the same category as the product Unit of Measure.')} + res['value'].update({'product_uom': product.uom_id.id}) + return res + def _bom_find(self, cr, uid, product_id, product_uom, properties=None): """ Finds BoM for particular product and product uom. @param product_id: Selected product. diff --git a/addons/mrp/mrp_view.xml b/addons/mrp/mrp_view.xml index abf0f823e5c..dca41050430 100644 --- a/addons/mrp/mrp_view.xml +++ b/addons/mrp/mrp_view.xml @@ -351,7 +351,7 @@