From e77abb81fe3af1bad710a199b5aeb4b684754518 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Thu, 10 Nov 2011 16:46:14 +0100 Subject: [PATCH 001/208] [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/208] [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/208] [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/208] [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 069/208] [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 070/208] [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 071/208] [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 072/208] [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 073/208] [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 074/208] [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 9c2ca851e23d5f93b59668e633618a6c3cd9f678 Mon Sep 17 00:00:00 2001 From: Tejas Tank Date: Wed, 3 Oct 2012 15:13:41 +0530 Subject: [PATCH 075/208] [IMP] procurement: Products reserverd from stock & added Manufucture Order in procurement. bzr revid: tta@openerp.com-20121003094341-suosaw2sum3grn7k --- addons/mrp/mrp_view.xml | 1 + addons/procurement/procurement.py | 2 +- addons/project_mrp/project_procurement.py | 3 +-- addons/purchase/purchase.py | 3 +-- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/addons/mrp/mrp_view.xml b/addons/mrp/mrp_view.xml index a198d736bbc..7294ad043b0 100644 --- a/addons/mrp/mrp_view.xml +++ b/addons/mrp/mrp_view.xml @@ -954,6 +954,7 @@ + diff --git a/addons/procurement/procurement.py b/addons/procurement/procurement.py index d47c3fe350f..ab644dd08db 100644 --- a/addons/procurement/procurement.py +++ b/addons/procurement/procurement.py @@ -362,7 +362,7 @@ class procurement_order(osv.osv): """ Changes procurement state to Running and writes message. @return: True """ - message = _('From stock: products assigned.') + message = _('Products reserverd from stock.') self.write(cr, uid, ids, {'state': 'running', 'message': message}, context=context) self.message_post(cr, uid, ids, body=message, context=context) diff --git a/addons/project_mrp/project_procurement.py b/addons/project_mrp/project_procurement.py index f70d43426b9..5f9a94f1894 100644 --- a/addons/project_mrp/project_procurement.py +++ b/addons/project_mrp/project_procurement.py @@ -84,8 +84,7 @@ class procurement_order(osv.osv): 'project_id': project and project.id or False, 'company_id': procurement.company_id.id, },context=context) - self.write(cr, uid, [procurement.id], {'task_id': task_id, 'state': 'running', 'message':'from project: task created.'}, context=context) - self.document_send_note(cr, uid, [procurement.id], body='%s %s:%s %s' % (_("Task"), procurement.origin or '', procurement.product_id.name, _("created")), context=context) + self.write(cr, uid, [procurement.id], {'task_id': task_id, 'state': 'running', 'message':'from project: task created.'}, context=context) self.project_task_create_note(cr, uid, ids, context=context) return task_id diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index ed99b9f2a58..4dda418c2ad 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -1082,8 +1082,7 @@ class procurement_order(osv.osv): } res[procurement.id] = self.create_procurement_purchase_order(cr, uid, procurement, po_vals, line_vals, context=new_context) self.write(cr, uid, [procurement.id], {'state': 'running', 'purchase_id': res[procurement.id]}) - self.document_send_note(cr, uid, [procurement.id], body='%s %s %s' % (_("Draft Purchase Order"), name or '', _("created")), context=context) - self.purchase_order_create_note(self, cr, uid, ids, context=context) + self.purchase_order_create_note(cr, uid, ids, context=context) return res def purchase_order_create_note(self, cr, uid, ids, context=None): From 60f3b375bbeb598e2ebfc24c340f357b177921f5 Mon Sep 17 00:00:00 2001 From: "Randhir Mayatra (OpenERP)" Date: Wed, 3 Oct 2012 15:20:03 +0530 Subject: [PATCH 076/208] [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 077/208] [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 b8578a099c462e74762bb8f8b3b0c45c6837a33a Mon Sep 17 00:00:00 2001 From: "Khushboo Bhatt (Open ERP)" Date: Wed, 3 Oct 2012 16:43:35 +0530 Subject: [PATCH 078/208] [FIX]product:string inproved bzr revid: kbh@tinyerp.com-20121003111335-ozvs174mhekgy9ax --- addons/product/product_view.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/product/product_view.xml b/addons/product/product_view.xml index 8c19aee026f..5b3af54fd7b 100644 --- a/addons/product/product_view.xml +++ b/addons/product/product_view.xml @@ -135,7 +135,7 @@ - + @@ -197,7 +197,7 @@ - + From a4da52f7f0fb96db30bf40806bc278647b3cb20b Mon Sep 17 00:00:00 2001 From: "Mayur Maheshwari (OpenERP)" Date: Wed, 3 Oct 2012 16:57:46 +0530 Subject: [PATCH 079/208] [FIX]hr_expense : remove purchase_ok bzr revid: mma@tinyerp.com-20121003112746-sw2ycbrysn65hfjz --- addons/hr_expense/hr_expense.py | 2 +- addons/product/product.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/hr_expense/hr_expense.py b/addons/hr_expense/hr_expense.py index 61b091d1d51..487e4f58782 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','purchase_ok':True,'sale_ok' :False,'categ_id':categ_id }} + res = {'value' : {'type':'service','sale_ok' :False,'categ_id':categ_id }} return res product_product() diff --git a/addons/product/product.py b/addons/product/product.py index 6bf26a45d24..11a81c23b73 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -350,7 +350,6 @@ class product_template(osv.osv): 'standard_price': lambda *a: 0.0, 'sale_ok': lambda *a: 1, 'produce_delay': lambda *a: 1, - 'purchase_ok': lambda *a: 1, 'uom_id': _get_uom_id, 'uom_po_id': _get_uom_id, 'uos_coeff' : lambda *a: 1.0, From dd44dab68c94cf88b2d9e16e614741680483d508 Mon Sep 17 00:00:00 2001 From: "Harry (OpenERP)" Date: Wed, 3 Oct 2012 17:08:10 +0530 Subject: [PATCH 080/208] [FIX] small issues bzr revid: hmo@tinyerp.com-20121003113810-mnlg6rf50xi2ljnt --- addons/mrp/procurement.py | 8 +++++--- addons/procurement/procurement.py | 2 +- addons/project_mrp/project_procurement.py | 6 ++++-- addons/purchase/purchase.py | 4 ++-- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/addons/mrp/procurement.py b/addons/mrp/procurement.py index f718856fbf8..82390a2f2c1 100644 --- a/addons/mrp/procurement.py +++ b/addons/mrp/procurement.py @@ -31,7 +31,7 @@ class procurement_order(osv.osv): _columns = { 'bom_id': fields.many2one('mrp.bom', 'BoM', ondelete='cascade', select=True), 'property_ids': fields.many2many('mrp.property', 'procurement_property_rel', 'procurement_id','property_id', 'Properties'), - 'production_id': fields.many2one('mrp.production', 'Manufucture Order'), + 'production_id': fields.many2one('mrp.production', 'Manufacturing Order'), } def check_produce_product(self, cr, uid, procurement, context=None): @@ -80,8 +80,10 @@ 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 + #TOFIX: split into new function to compute manufacturing lead time 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 = newdate - relativedelta(days=company.manufacturing_lead) + #TOFIX: implement hook method for creating production order produce_id = production_obj.create(cr, uid, { 'origin': procurement.origin, 'product_id': procurement.product_id.id, @@ -111,8 +113,8 @@ class procurement_order(osv.osv): def production_order_create_note(self, cr, uid, ids, context=None): for procurement in self.browse(cr, uid, ids, context=context): - body = "%s %s %s" % (_("Manufacturing Order"), procurement.production_id.name, _("Created")) - self.message_post(cr, uid, ids, body=body, context=context) + body = "%s %s %s" % (_("Manufacturing Order"), procurement.production_id.name, _("Created")) + self.message_post(cr, uid, [procurement.id], body=body, context=context) procurement_order() diff --git a/addons/procurement/procurement.py b/addons/procurement/procurement.py index aa3b2a2a673..5f8cd3c0b56 100644 --- a/addons/procurement/procurement.py +++ b/addons/procurement/procurement.py @@ -104,7 +104,7 @@ class procurement_order(osv.osv): " a make to order method."), 'note': fields.text('Note'), - 'message': fields.char('Latest error', size=124, help="Exception occurred while computing procurement orders."), + 'message': fields.char('Latest error', size=124, help="Exception occurred while computing procurement orders."), #TOCHECK: is it need after OpenChatter ? 'state': fields.selection([ ('draft','Draft'), ('cancel','Cancelled'), diff --git a/addons/project_mrp/project_procurement.py b/addons/project_mrp/project_procurement.py index 1daf03dfd9f..63e72493e35 100644 --- a/addons/project_mrp/project_procurement.py +++ b/addons/project_mrp/project_procurement.py @@ -69,8 +69,10 @@ class procurement_order(osv.osv): def action_produce_assign_service(self, cr, uid, ids, context=None): project_task = self.pool.get('project.task') for procurement in self.browse(cr, uid, ids, context=context): + #TOFIX: split into new function to compute task planning hours project = self._get_project(cr, uid, procurement, context=context) planned_hours = self._convert_qty_company_hours(cr, uid, procurement, context=context) + #TOFIX: implement hook method for creating Task task_id = project_task.create(cr, uid, { 'name': '%s:%s' % (procurement.origin or '', procurement.product_id.name), 'date_deadline': procurement.date_planned, @@ -90,8 +92,8 @@ class procurement_order(osv.osv): def project_task_create_note(self, cr, uid, ids, context=None): for procurement in self.browse(cr, uid, ids, context=context): - body = "%s %s %s" % (_("Task"), procurement.task_id.name, _("Created")) - self.message_post(cr, uid, ids, body=body, context=context) + body = "%s %s %s" % (_("Task"), procurement.task_id.name, _("Created")) + self.message_post(cr, uid, [procurement.id], body=body, context=context) procurement_order() diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index a574d8e4467..6bc76f14f34 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -1083,8 +1083,8 @@ class procurement_order(osv.osv): def purchase_order_create_note(self, cr, uid, ids, context=None): for procurement in self.browse(cr, uid, ids, context=context): - body = "%s %s %s" % (_("Draft Purchase Order"), procurement.purchase_id.name, _("Created")) - self.message_post(cr, uid, ids, body=body, context=context) + body = "%s %s %s" % (_("Draft Purchase Order"), procurement.purchase_id.name, _("Created")) + self.message_post(cr, uid, [procurement.id], body=body, context=context) procurement_order() From be42204adf876f675af5e7466b0d57efbb840d6c Mon Sep 17 00:00:00 2001 From: "Mayur Maheshwari (OpenERP)" Date: Wed, 3 Oct 2012 17:08:46 +0530 Subject: [PATCH 081/208] [FIX]product : remove lemda from defaults bzr revid: mma@tinyerp.com-20121003113846-mjjtghoxdu8h2nq8 --- addons/procurement/procurement.py | 4 ++-- addons/product/product.py | 16 ++++++++-------- addons/purchase/purchase.py | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/addons/procurement/procurement.py b/addons/procurement/procurement.py index afa4eb2af0b..3d5e166b082 100644 --- a/addons/procurement/procurement.py +++ b/addons/procurement/procurement.py @@ -649,8 +649,8 @@ class product_template(osv.osv): 'supply_method': fields.selection([('produce','Manufacture'),('buy','Buy')], 'Supply Method', required=True, help="Produce will generate production order or tasks, according to the product type. Buy will trigger purchase orders when requested."), } _defaults = { - 'procure_method': lambda *a: 'make_to_stock', - 'supply_method': lambda *a: 'buy', + 'procure_method': 'make_to_stock', + 'supply_method': 'buy', } product_template() diff --git a/addons/product/product.py b/addons/product/product.py index 11a81c23b73..d23cd37ae69 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -345,17 +345,17 @@ class product_template(osv.osv): _defaults = { 'company_id': lambda s,cr,uid,c: s.pool.get('res.company')._company_default_get(cr, uid, 'product.template', context=c), - 'list_price': lambda *a: 1, - 'cost_method': lambda *a: 'standard', - 'standard_price': lambda *a: 0.0, - 'sale_ok': lambda *a: 1, - 'produce_delay': lambda *a: 1, + 'list_price': 1, + 'cost_method': 'standard', + 'standard_price': 0.0, + 'sale_ok': 1, + 'produce_delay': 1, 'uom_id': _get_uom_id, 'uom_po_id': _get_uom_id, - 'uos_coeff' : lambda *a: 1.0, - 'mes_type' : lambda *a: 'fixed', + 'uos_coeff' : 1.0, + 'mes_type' : 'fixed', 'categ_id' : _default_category, - 'type' : lambda *a: 'consu', + 'type' : 'consu', } def _check_uom(self, cursor, user, ids, context=None): diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index 6643394b148..abb45ae0909 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -1102,7 +1102,7 @@ class product_template(osv.osv): 'purchase_ok': fields.boolean('Can be Purchased', help="Determine if the product is visible in the list of products within a selection from a purchase order line."), } _defaults = { - 'purchase_ok': lambda *a: 1, + 'purchase_ok': 1, } product_template() From cfb01972363037e7ffcc40d90812acaa19314b2c Mon Sep 17 00:00:00 2001 From: "Mayur Maheshwari (OpenERP)" Date: Wed, 3 Oct 2012 17:12:08 +0530 Subject: [PATCH 082/208] [FIX]product : remove lemda from defaults bzr revid: mma@tinyerp.com-20121003114208-p6p0xvecuc1vfb0e --- addons/stock/product.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock/product.py b/addons/stock/product.py index e93258b56cd..94252f80439 100644 --- a/addons/stock/product.py +++ b/addons/stock/product.py @@ -520,7 +520,7 @@ class product_template(osv.osv): } _defaults = { - 'sale_delay': lambda *a: 7, + 'sale_delay': 7, } product_template() From cc331b802c0e7c37e4168dbd144c8590c1d27af1 Mon Sep 17 00:00:00 2001 From: "Mayur Maheshwari (OpenERP)" Date: Wed, 3 Oct 2012 17:13:28 +0530 Subject: [PATCH 083/208] [FIX]product : remove sale_dealy from product.template bzr revid: mma@tinyerp.com-20121003114328-9ufkrn1d84vyny5q --- addons/product/product.py | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/product/product.py b/addons/product/product.py index d23cd37ae69..42f7d003079 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -281,7 +281,6 @@ class product_template(osv.osv): 'description_purchase': fields.text('Purchase Description',translate=True), 'description_sale': fields.text('Sale Description',translate=True), 'type': fields.selection([('consu', 'Consumable'),('service','Service')], 'Product Type', required=True, help="Will change the way procurements are processed. Consumable are product where you don't manage stock."), - 'sale_delay': fields.float('Customer Lead Time', help="This is the average delay in days between the confirmation of the customer order and the delivery of the finished products. It's the time you promise to your customers."), 'produce_delay': fields.float('Manufacturing Lead Time', help="Average delay in days to produce this product. This is only for the production order and, if it is a multi-level bill of material, it's only for the level of this product. Different lead times will be summed for all levels and purchase orders."), 'rental': fields.boolean('Can be Rent'), 'categ_id': fields.many2one('product.category','Category', required=True, change_default=True, domain="[('type','=','normal')]" ,help="Select category for the current product"), From 71bf16d126e2719fe9fd4da12e09d3e75be785b8 Mon Sep 17 00:00:00 2001 From: "Harry (OpenERP)" Date: Wed, 3 Oct 2012 17:49:04 +0530 Subject: [PATCH 084/208] [FIX] stock_location: fix issue to post message after created pulled procurement bzr revid: hmo@tinyerp.com-20121003121904-x930vx8rs0y80xre --- addons/stock_location/procurement_pull.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/addons/stock_location/procurement_pull.py b/addons/stock_location/procurement_pull.py index 840e6c854c7..87af0c7e08d 100644 --- a/addons/stock_location/procurement_pull.py +++ b/addons/stock_location/procurement_pull.py @@ -57,6 +57,7 @@ class procurement_order(osv.osv): break assert line, 'Line cannot be False if we are on this state of the workflow' origin = (proc.origin or proc.name or '').split(':')[0] +':'+line.name + #TOFIX: implement hook method for creating picking picking_id = picking_obj.create(cr, uid, { 'origin': origin, 'company_id': line.company_id and line.company_id.id or False, @@ -67,6 +68,7 @@ class procurement_order(osv.osv): 'note': _('Picking for pulled procurement coming from original location %s, pull rule %s, via original Procurement %s (#%d)') % (proc.location_id.name, line.name, proc.name, proc.id), 'invoice_state': line.invoice_state, }) + #TOFIX: implement hook method for creating move move_id = move_obj.create(cr, uid, { 'name': line.name, 'picking_id': picking_id, @@ -92,6 +94,8 @@ class procurement_order(osv.osv): move_obj.write(cr,uid, [proc.move_id.id], { 'state':'waiting' }, context=context) + + #TOFIX: implement hook method for creating new procurement proc_id = proc_obj.create(cr, uid, { 'name': line.name, 'origin': origin, @@ -115,9 +119,9 @@ class procurement_order(osv.osv): if proc.move_id: move_obj.write(cr, uid, [proc.move_id.id], {'location_id':proc.location_id.id}) - self.write(cr, uid, [proc.id], {'state':'running', 'message':_('Pulled from another location via procurement %d') % proc_id}) - self.running_send_note(cr, uid, [proc.id], context=context) - + msg = _('Pulled from another location via procurement %d') % proc_id + self.write(cr, uid, [proc.id], {'state':'running', 'message': msg}) + self.message_post(cr, uid, [proc.id], body=msg, context=context) # trigger direct processing (the new procurement shares the same planned date as the original one, which is already being processed) wf_service.trg_validate(uid, 'procurement.order', proc_id, 'button_check', cr) return False From 8169ad64cffae017db28b3cc4c03c712a34711f9 Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Wed, 3 Oct 2012 17:56:37 +0530 Subject: [PATCH 085/208] [IMP] display applicant's name above the subject in kanban of application bzr revid: fka@tinyerp.com-20121003122637-74o8xxuxoxav876x --- addons/hr_recruitment/hr_recruitment_view.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/hr_recruitment/hr_recruitment_view.xml b/addons/hr_recruitment/hr_recruitment_view.xml index 08e5f31a2d2..ccc91da2b0e 100644 --- a/addons/hr_recruitment/hr_recruitment_view.xml +++ b/addons/hr_recruitment/hr_recruitment_view.xml @@ -289,6 +289,7 @@
+


Mobile:
From 7c9ad497897f41ff20823740f671e7d9cc5238b8 Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Wed, 3 Oct 2012 18:19:11 +0530 Subject: [PATCH 086/208] [IMP] in Payslips: change journal_id label bzr revid: fka@tinyerp.com-20121003124911-o792xmzwj6tswt0e --- addons/hr_payroll_account/hr_payroll_account.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/hr_payroll_account/hr_payroll_account.py b/addons/hr_payroll_account/hr_payroll_account.py index 184f9a06867..94df47f6e44 100644 --- a/addons/hr_payroll_account/hr_payroll_account.py +++ b/addons/hr_payroll_account/hr_payroll_account.py @@ -36,7 +36,7 @@ class hr_payslip(osv.osv): _columns = { 'period_id': fields.many2one('account.period', 'Force Period',states={'draft': [('readonly', False)]}, readonly=True, domain=[('state','<>','done')], help="Keep empty to use the period of the validation(Payslip) date."), - 'journal_id': fields.many2one('account.journal', 'Expense Journal',states={'draft': [('readonly', False)]}, readonly=True, required=True), + 'journal_id': fields.many2one('account.journal', 'Salary Journal',states={'draft': [('readonly', False)]}, readonly=True, required=True), 'move_id': fields.many2one('account.move', 'Accounting Entry', readonly=True), } @@ -215,7 +215,7 @@ class hr_payslip_run(osv.osv): _inherit = 'hr.payslip.run' _description = 'Payslip Run' _columns = { - 'journal_id': fields.many2one('account.journal', 'Expense Journal', states={'draft': [('readonly', False)]}, readonly=True, required=True), + 'journal_id': fields.many2one('account.journal', 'Salary Journal', states={'draft': [('readonly', False)]}, readonly=True, required=True), } def _get_default_journal(self, cr, uid, context=None): From 98d979529d021383867be7086467018ceba23d50 Mon Sep 17 00:00:00 2001 From: "Mayur Maheshwari (OpenERP)" Date: Wed, 3 Oct 2012 18:44:14 +0530 Subject: [PATCH 087/208] [IMP]event_sale : improve view bzr revid: mma@tinyerp.com-20121003131414-v6e0srgum29xdyjx --- addons/event_sale/event_sale_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/event_sale/event_sale_view.xml b/addons/event_sale/event_sale_view.xml index 174f82f9b6b..ab7568d704e 100644 --- a/addons/event_sale/event_sale_view.xml +++ b/addons/event_sale/event_sale_view.xml @@ -4,7 +4,7 @@ event.product product.product - +
From 4858fff4ca67af7e59956750d85b1f7e042d8da1 Mon Sep 17 00:00:00 2001 From: "Khushboo Bhatt (Open ERP)" Date: Wed, 3 Oct 2012 18:45:43 +0530 Subject: [PATCH 088/208] [FIX]stock:err of attrs when select any field from group by in search view bzr revid: kbh@tinyerp.com-20121003131543-01aszl4xgujw8sac --- addons/stock/stock_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml index f5320a963c7..f66f24ae551 100644 --- a/addons/stock/stock_view.xml +++ b/addons/stock/stock_view.xml @@ -1119,7 +1119,7 @@ stock.move - + From 6c908a4b221e7c809c0e6d852cf8bf108064e8be Mon Sep 17 00:00:00 2001 From: "Mayur Maheshwari (OpenERP)" Date: Wed, 3 Oct 2012 18:52:00 +0530 Subject: [PATCH 089/208] [IMP]event_sale : improve templates view bzr revid: mma@tinyerp.com-20121003132200-bxk7i0thj3prqymp --- addons/product/product_view.xml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/addons/product/product_view.xml b/addons/product/product_view.xml index 32d6711d386..14571fbcc55 100644 --- a/addons/product/product_view.xml +++ b/addons/product/product_view.xml @@ -709,11 +709,19 @@ + + + + + + + + From 082f696ef47eceb19e3ce8d82d10440aee80004f Mon Sep 17 00:00:00 2001 From: Tejas Tank Date: Thu, 4 Oct 2012 11:41:32 +0530 Subject: [PATCH 090/208] UOM, List view: remove the ratio column. bzr revid: tta@openerp.com-20121004061132-0p5o9qcfpo0xyvzh --- addons/product/product_view.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/product/product_view.xml b/addons/product/product_view.xml index 8c19aee026f..2509abfec4e 100644 --- a/addons/product/product_view.xml +++ b/addons/product/product_view.xml @@ -449,7 +449,6 @@ - From dbb18562a5eb549c9fbe2aaee0a456e382acd727 Mon Sep 17 00:00:00 2001 From: "Khushboo Bhatt (Open ERP)" Date: Thu, 4 Oct 2012 14:12:53 +0530 Subject: [PATCH 091/208] [FIX]from product's view if we click on Bill of Materials view it opens bill of materials view which is showing BoM of this product as a component too bzr revid: kbh@tinyerp.com-20121004084253-hc1nibjcdkamocni --- addons/mrp/mrp_view.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/mrp/mrp_view.xml b/addons/mrp/mrp_view.xml index abf0f823e5c..c00582dbcc4 100644 --- a/addons/mrp/mrp_view.xml +++ b/addons/mrp/mrp_view.xml @@ -1037,6 +1037,7 @@ {'default_product_id': active_id, 'search_default_product_id': active_id} Bill of Materials + [('bom_id','=',False)] mrp.bom From c5ac7217a867146f6456978713cfe511c7a41966 Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Thu, 4 Oct 2012 11:09:02 +0200 Subject: [PATCH 092/208] [IMP]mail: follower/partners list on wall posting message form bzr revid: chm@openerp.com-20121004090902-p4b3t4zvs9frc3ky --- addons/mail/mail_message_view.xml | 8 +-- addons/mail/static/src/css/mail.css | 36 +++++++++--- addons/mail/static/src/js/mail.js | 89 +++++++++++++++-------------- addons/mail/static/src/xml/mail.xml | 16 ++++++ 4 files changed, 93 insertions(+), 56 deletions(-) diff --git a/addons/mail/mail_message_view.xml b/addons/mail/mail_message_view.xml index 6d854d4d701..2992868bfcf 100644 --- a/addons/mail/mail_message_view.xml +++ b/addons/mail/mail_message_view.xml @@ -88,28 +88,28 @@ Inbox mail.wall + 'context': {'default_model': 'res.partner', 'default_res_id': uid, 'default_is_private':True} }""/> Wall mail.wall + 'context': {'default_model': 'res.partner', 'default_res_id': uid, 'default_is_private':False} }""/> Archives mail.wall + 'context': {'default_model': 'res.partner', 'default_res_id': uid} }""/> Sent mail.wall + 'context': {'default_model': 'res.partner', 'default_res_id': uid} }""/> diff --git a/addons/mail/static/src/css/mail.css b/addons/mail/static/src/css/mail.css index 4ffb9013496..e5a9ad0c825 100644 --- a/addons/mail/static/src/css/mail.css +++ b/addons/mail/static/src/css/mail.css @@ -173,16 +173,41 @@ clear: both; } +.openerp .oe_mail .oe_mail_compose_textarea .oe_mail_post_header .oe_all_follower { + color: blue; +} +.openerp .oe_mail .oe_mail_compose_textarea .oe_mail_post_header .oe_partner_follower a { + color: red; +} +.openerp .oe_mail .oe_mail_compose_textarea .oe_mail_post_header .oe_hidden, +.openerp .oe_mail .oe_mail_compose_textarea .oe_mail_post_header .oe_more_hidden { + display: none; +} + +.openerp .oe_mail .oe_mail_compose_textarea .oe_mail_post_bottom button.post { + float: left; +} + +.openerp .oe_mail .oe_mail_compose_textarea .oe_mail_post_bottom span { + float: right; +} + /* default textarea (oe_mail_compose_textarea), and body textarea for compose form view */ -.openerp .oe_mail_msg_content textarea.oe_mail_compose_textarea, -.openerp .oe_mail_msg_content div.oe_mail_compose_message_body textarea { +.openerp .oe_mail.oe_semantic_html_override .oe_mail_compose_textarea textarea, +.openerp .oe_mail div.oe_mail_compose_message_body textarea { width: 474px; - height: 60px; + min-height: 120px; + height: auto; padding: 4px; font-size: 12px; border: 1px solid #cccccc; } +/* not top textarea */ +.openerp .oe_mail.oe_semantic_html_override .oe_semantic_html_override .oe_mail_compose_textarea textarea { + height: 60px; +} + /* default textarea (oe_mail_compose_textarea), and body textarea for compose form view */ .openerp .oe_mail_msg_content textarea.oe_mail_compose_textarea:focus, .openerp .oe_mail_msg_content div.oe_mail_compose_message_body textarea:focus { @@ -413,11 +438,6 @@ } /* Dropdown menu */ -/*.openerp .oe_mail_msg_content .oe_dropdown_toggle { - position: absolute; - top: 0px; - right: 3px; -}*/ .openerp .oe_mail .oe_semantic_html_override { position: relative; diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js index 8915f1387e1..b2fa071b191 100644 --- a/addons/mail/static/src/js/mail.js +++ b/addons/mail/static/src/js/mail.js @@ -336,13 +336,40 @@ openerp.mail = function(session) { */ init: function(parent, options) { this._super(parent); + + // record parameters + var param = options.parameters; + for(var i in param){ + this[i] = param[i]; + } + this.id = param.id || -1; + this.model = param.model || false; + this.parent_id= param.parent_id || false; + this.res_id = param.res_id || false; + this.type = param.type || false; + this.is_author = param.is_author || false; + this.subject = param.subject || false; + this.name = param.name || false; + this.record_name = param.record_name || false; + this.body = param.body || false; + this.vote_user_ids =param.vote_user_ids || []; + this.has_voted = param.has_voted || false; + + this.vote_user_ids = param.vote_user_ids || []; + + this.unread = param.unread || false; + this._date = param.date; + this.author_id = param.author_id || []; + this.attachment_ids = param.attachment_ids || []; + + // record domain and context this.domain = options.domain || []; this.context = _.extend({ default_model: 'mail.thread', default_res_id: 0, default_parent_id: false }, options.context || {}); - // options + // record options this.options={ 'thread' : options.options.thread, 'message' : { @@ -356,31 +383,9 @@ openerp.mail = function(session) { 'truncate_limit': options.options.message.truncate_limit || 250, } }; + // record options and data - this.parent_thread= parent.messages!= undefined ? parent : options.options.thread._parents[0] ; - - var param = options.parameters; - // record parameters - this.id = param.id || -1; - this.model = param.model || false; - this.parent_id= param.parent_id || false; - this.res_id = param.res_id || false; - this.type = param.type || false; - this.is_author = param.is_author || false; - this.subject = param.subject || false; - this.name = param.name || false; - this.record_name = param.record_name || false; - this.body = param.body || false; - this.vote_user_ids =param.vote_user_ids || []; - this.has_voted = param.has_voted || false; - - this.vote_user_ids = param.vote_user_ids || []; - - this.unread = param.unread || false; - this._date = param.date; - this.author_id = param.author_id || []; - this.attachment_ids = param.attachment_ids || []; - + this.parent_thread= parent.messages!= undefined ? parent : options.options.thread._parents[0]; this.thread = false; if( param.id > 0 ) { @@ -468,6 +473,7 @@ openerp.mail = function(session) { if(this.thread){ return false; } + var param = _.extend(self, {'parent_id': self.id}); /*create thread*/ self.thread = new mail.Thread(self, { 'domain': self.domain, @@ -480,11 +486,7 @@ openerp.mail = function(session) { 'thread' : self.options.thread, 'message' : self.options.message }, - 'parameters':{ - 'model': self.model, - 'id': self.id, - 'parent_id': self.id - } + 'parameters': param } ); /*insert thread in parent message*/ @@ -520,7 +522,7 @@ openerp.mail = function(session) { */ on_message_read_unread: function (event) { event.stopPropagation(); - this.animated_destroy({fadeTime:250}); + if($(event.srcElement).hasClass("oe_read")) this.animated_destroy({fadeTime:250}); // if this message is read, all childs message display is read var ids = [this.id].concat( this.get_child_ids() ); this.ds_notification.call('set_message_read', [ids,$(event.srcElement).hasClass("oe_read")]); @@ -667,6 +669,13 @@ openerp.mail = function(session) { this.id= param.id || false; this.model= param.model || false; this.parent_id= param.parent_id || false; + this.is_private = param.is_private || false; + this.partner_ids = []; + for(var i in param.partner_ids){ + if(param.partner_ids[i][0]!=(param.author_id ? param.author_id[0] : -1)){ + this.partner_ids.push(param.partner_ids[i]); + } + } this.messages = []; @@ -720,17 +729,9 @@ openerp.mail = function(session) { * in the function. */ bind_events: function() { var self = this; - // event: writing in basic textarea of composition form (quick reply) - // event: onblur for hide 'Reply' - this.$('.oe_mail_compose_textarea:first textarea') - .keyup(function (event) { - var charCode = (event.which) ? event.which : window.event.keyCode; - if (event.shiftKey && charCode == 13) { this.value = this.value+"\n"; } - else if (charCode == 13) { return self.message_post(); } - }) - .blur(function (event) { - $(this).parents('.oe_mail_thread_action:first').hide(); - }); + self.$('.oe_mail_compose_textarea:first button.post').click(function () {return self.message_post();}); + self.$('.oe_mail_compose_textarea .oe_more').click(function () { var p=$(this).parent(); p.find('.oe_more_hidden, .oe_hidden').show(); p.find('.oe_more').hide(); }); + self.$('.oe_mail_compose_textarea .oe_more_hidden').click(function () { var p=$(this).parent(); p.find('.oe_more_hidden, .oe_hidden').hide(); p.find('.oe_more').show(); }); }, /* get all child message/thread id linked @@ -1037,7 +1038,7 @@ openerp.mail = function(session) { 'options':{ 'thread':{ 'thread_level': this.options.thread_level, - 'show_header_compose': show_header_compose, + 'show_header_compose': 0, //show_header_compose, 'use_composer': show_header_compose, 'display_on_flat':true }, @@ -1142,7 +1143,7 @@ openerp.mail = function(session) { 'thread' :{ 'thread_level': this.options.thread_level, 'use_composer': true, - 'show_header_compose': 1, + 'show_header_compose': 0, }, 'message': { 'show_reply': this.options.thread_level > 0, diff --git a/addons/mail/static/src/xml/mail.xml b/addons/mail/static/src/xml/mail.xml index 1e2e6a970b6..b7eebd0b4d1 100644 --- a/addons/mail/static/src/xml/mail.xml +++ b/addons/mail/static/src/xml/mail.xml @@ -67,7 +67,23 @@
+
+ Post a message to: + All Followers + and + + + + + , others... + <<< + +