From 76f977c21846f7d103ef7a543eca1063c0bcba83 Mon Sep 17 00:00:00 2001 From: dhr Date: Fri, 30 Nov 2012 17:15:02 +0530 Subject: [PATCH 001/262] [IMP]Changed Bom Structure Display from bill of materials bzr revid: dhr@tinyerp.com-20121130114502-1a5hcleuhdfxf4c0 --- 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 2ed442b1831..dc520f020f1 100644 --- a/addons/mrp/mrp_view.xml +++ b/addons/mrp/mrp_view.xml @@ -545,6 +545,7 @@ ir.actions.act_window mrp.bom [('bom_id', '=',active_ids)] + tree From 0c18a21f71c2769abc3f7ae973c9e73ce6f8077f Mon Sep 17 00:00:00 2001 From: Paramjit Singh Sahota Date: Mon, 10 Dec 2012 11:55:45 +0530 Subject: [PATCH 002/262] [IMP] Improved code for Settings => Technical => Security => Access Controls List: clicking on create should open an editable line in the top of the list, not at the bottom. bzr revid: psa@tinyerp.com-20121210062545-7g6d2a3padvgkjt7 --- openerp/addons/base/ir/ir_model_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openerp/addons/base/ir/ir_model_view.xml b/openerp/addons/base/ir/ir_model_view.xml index 1b5d0cc3caf..b8631e3f55b 100644 --- a/openerp/addons/base/ir/ir_model_view.xml +++ b/openerp/addons/base/ir/ir_model_view.xml @@ -352,7 +352,7 @@ ir.model.access - + From af79a385b67fcdad356bff59149ed23183e5f776 Mon Sep 17 00:00:00 2001 From: Paramjit Singh Sahota Date: Mon, 10 Dec 2012 12:39:35 +0530 Subject: [PATCH 003/262] [IMP] Improved code for Notifications: move Notifications menuitem below Emails. bzr revid: psa@tinyerp.com-20121210070935-iulu3a3yfh7000r7 --- addons/mail/mail_followers_view.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/mail/mail_followers_view.xml b/addons/mail/mail_followers_view.xml index a9d1d80240b..515be85132a 100644 --- a/addons/mail/mail_followers_view.xml +++ b/addons/mail/mail_followers_view.xml @@ -66,11 +66,11 @@ --> + action="action_view_followers" sequence="30" groups="base.group_no_one"/> + action="action_view_notifications" sequence="13" groups="base.group_no_one"/> From e9f3f51807bfae723925f937b6d9dbd6e2b36934 Mon Sep 17 00:00:00 2001 From: Paramjit Singh Sahota Date: Mon, 10 Dec 2012 17:18:05 +0530 Subject: [PATCH 004/262] [IMP] Improved code for Human Resources > Appraisal > Appraisals: when Appraisal is done, make employee/date/Appraisal Forms and plan fields readonly. bzr revid: psa@tinyerp.com-20121210114805-3ba1ix0sta3bej6c --- addons/hr_evaluation/hr_evaluation_view.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/hr_evaluation/hr_evaluation_view.xml b/addons/hr_evaluation/hr_evaluation_view.xml index 82ef2aa83f4..8c9823bad08 100644 --- a/addons/hr_evaluation/hr_evaluation_view.xml +++ b/addons/hr_evaluation/hr_evaluation_view.xml @@ -165,9 +165,9 @@ From 86503f581216d271afe75980d977a7cb77715d09 Mon Sep 17 00:00:00 2001 From: Dhruti Shastri Date: Wed, 6 Feb 2013 16:19:15 +0530 Subject: [PATCH 034/262] [stock] : Chained location: cancelling receptions doesn't cancel all stock moves bzr revid: dhs@tinyerp.com-20130206104915-f54l890d06xxq9ks --- 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 7198c89e286..2ba3f50d2a7 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -2201,7 +2201,7 @@ class stock_move(osv.osv): if move.picking_id: pickings.add(move.picking_id.id) if move.move_dest_id and move.move_dest_id.state == 'waiting': - self.write(cr, uid, [move.move_dest_id.id], {'state': 'assigned'}) + self.write(cr, uid, [move.move_dest_id.id], {'state': 'confirmed'}) if context.get('call_unlink',False) and move.move_dest_id.picking_id: wf_service = netsvc.LocalService("workflow") wf_service.trg_write(uid, 'stock.picking', move.move_dest_id.picking_id.id, cr) From 9e99431d1fdb5772e5f53381d750f3c9a13b005a Mon Sep 17 00:00:00 2001 From: "sgo@tinyerp.com" <> Date: Wed, 6 Feb 2013 18:08:51 +0530 Subject: [PATCH 035/262] [IMP]add pricelist field in pos config and set default bzr revid: sgo@tinyerp.com-20130206123851-4b3lhr5bzf7msla6 --- addons/point_of_sale/point_of_sale.py | 8 +++++++- addons/point_of_sale/point_of_sale_view.xml | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py index d95b64d5c84..6835576d253 100644 --- a/addons/point_of_sale/point_of_sale.py +++ b/addons/point_of_sale/point_of_sale.py @@ -70,6 +70,7 @@ class pos_config(osv.osv): "to customize the reference numbers of your orders."), 'session_ids': fields.one2many('pos.session', 'config_id', 'Sessions'), 'group_by' : fields.boolean('Group Journal Items', help="Check this if you want to group the Journal Items by Product while closing a Session"), + 'pricelist_id': fields.many2one('product.pricelist','Pricelist', required=True) } def _check_cash_control(self, cr, uid, ids, context=None): @@ -115,12 +116,17 @@ class pos_config(osv.osv): def _default_warehouse(self, cr, uid, context=None): res = self.pool.get('stock.warehouse').search(cr, uid, []) return res and res[0] or False + + def _default_pricelist(self, cr, uid, context=None): + res = self.pool.get('product.pricelist').search(cr, uid, [('type', '=', 'sale')]) + return res and res[0] or False _defaults = { 'state' : POS_CONFIG_STATE[0][0], 'warehouse_id': _default_warehouse, 'journal_id': _default_sale_journal, 'group_by' : True, + 'pricelist_id': _default_pricelist } def set_active(self, cr, uid, ids, context=None): @@ -619,7 +625,7 @@ class pos_order(osv.osv): session_ids = self._default_session(cr, uid, context) if session_ids: session_record = self.pool.get('pos.session').browse(cr, uid, session_ids, context=context) - return session_record.user_id.partner_id.property_product_pricelist and session_record.user_id.partner_id.property_product_pricelist.id or False + return session_record.config_id.pricelist_id and session_record.config_id.pricelist_id.id or False return False _defaults = { diff --git a/addons/point_of_sale/point_of_sale_view.xml b/addons/point_of_sale/point_of_sale_view.xml index 3cf920d8a11..6a8208bac0a 100644 --- a/addons/point_of_sale/point_of_sale_view.xml +++ b/addons/point_of_sale/point_of_sale_view.xml @@ -84,7 +84,7 @@ - + @@ -773,6 +773,7 @@ + From d0e2c54663f9153a4333c6b03496b9cebb6779a5 Mon Sep 17 00:00:00 2001 From: "sgo@tinyerp.com" <> Date: Wed, 6 Feb 2013 18:29:13 +0530 Subject: [PATCH 036/262] [IMP]set config pricelist on pos frontend bzr revid: sgo@tinyerp.com-20130206125913-ibn73y41aw19gkmw --- addons/point_of_sale/static/src/js/models.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js index 5a4f7c8cefb..a43e5a28074 100644 --- a/addons/point_of_sale/static/src/js/models.js +++ b/addons/point_of_sale/static/src/js/models.js @@ -158,7 +158,7 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal return self.fetch( 'pos.config', - ['name','journal_ids','warehouse_id','journal_id', + ['name','journal_ids','warehouse_id','journal_id','pricelist_id', 'iface_self_checkout', 'iface_led', 'iface_cashdrawer', 'iface_payment_terminal', 'iface_electronic_scale', 'iface_barscan', 'iface_vkeyboard', 'iface_print_via_proxy','iface_cashdrawer','state','sequence_id','session_ids'], @@ -184,14 +184,13 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal return self.fetch('pos.category', ['id','name','parent_id','child_id','image']) }).then(function(categories){ self.db.add_categories(categories); - return new instance.web.Model("ir.model.data").call("get_object_reference", ["product", "list0"]) - }).then(function(pricelist){ + return self.fetch( 'product.product', ['name', 'list_price','price','pos_categ_id', 'taxes_id', 'ean13', - 'to_weight', 'uom_id', 'uos_id', 'uos_coeff', 'mes_type', 'description_sale', 'description','pricelist_id'], + 'to_weight', 'uom_id', 'uos_id', 'uos_coeff', 'mes_type', 'description_sale', 'description'], [['sale_ok','=',true],['available_in_pos','=',true]], - {pricelist: pricelist[1]} // context for price + {pricelist: self.get('pos_config').pricelist_id[0]} // context for price ); }).then(function(products){ self.db.add_products(products); From bc17621cecb4a36d4d4e6c6272b2e1b57e51fa1f Mon Sep 17 00:00:00 2001 From: "sgo@tinyerp.com" <> Date: Thu, 7 Feb 2013 12:21:26 +0530 Subject: [PATCH 037/262] [IMP]improve pos config form view and add group on warehouse bzr revid: sgo@tinyerp.com-20130207065126-1liwmg1u3emnra6j --- addons/point_of_sale/point_of_sale.py | 3 ++- addons/point_of_sale/point_of_sale_view.xml | 23 ++++++++++++++------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py index e1fe577c922..ebb87d02f26 100644 --- a/addons/point_of_sale/point_of_sale.py +++ b/addons/point_of_sale/point_of_sale.py @@ -114,7 +114,8 @@ class pos_config(osv.osv): return res and res[0] or False def _default_warehouse(self, cr, uid, context=None): - res = self.pool.get('stock.warehouse').search(cr, uid, []) + user = self.pool.get('res.users').browse(cr, uid, uid, context) + res = self.pool.get('stock.warehouse').search(cr, uid, [('company_id','=',user.company_id.id)], context) return res and res[0] or False def _default_pricelist(self, cr, uid, context=None): diff --git a/addons/point_of_sale/point_of_sale_view.xml b/addons/point_of_sale/point_of_sale_view.xml index 6a8208bac0a..a3628761173 100644 --- a/addons/point_of_sale/point_of_sale_view.xml +++ b/addons/point_of_sale/point_of_sale_view.xml @@ -769,13 +769,20 @@ + From 6dac31941aa8a0eb9d4b037cb59a8de75a3f132a Mon Sep 17 00:00:00 2001 From: "sgo@tinyerp.com" <> Date: Thu, 7 Feb 2013 12:54:40 +0530 Subject: [PATCH 038/262] [IMP]improve code bzr revid: sgo@tinyerp.com-20130207072440-ekqkxi0o5cxe9iz0 --- addons/point_of_sale/point_of_sale.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py index ebb87d02f26..bcdf3a55873 100644 --- a/addons/point_of_sale/point_of_sale.py +++ b/addons/point_of_sale/point_of_sale.py @@ -115,7 +115,7 @@ class pos_config(osv.osv): def _default_warehouse(self, cr, uid, context=None): user = self.pool.get('res.users').browse(cr, uid, uid, context) - res = self.pool.get('stock.warehouse').search(cr, uid, [('company_id','=',user.company_id.id)], context) + res = self.pool.get('stock.warehouse').search(cr, uid, [('company_id','=',user.company_id.id)], context=context) return res and res[0] or False def _default_pricelist(self, cr, uid, context=None): From d7bd9743a2580ec1ee9eb77743a151f8c3d71608 Mon Sep 17 00:00:00 2001 From: "sgo@tinyerp.com" <> Date: Thu, 7 Feb 2013 15:28:27 +0530 Subject: [PATCH 039/262] [IMP]improve pos config view bzr revid: sgo@tinyerp.com-20130207095827-oaya9xo9cjroqcex --- addons/point_of_sale/point_of_sale_view.xml | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/addons/point_of_sale/point_of_sale_view.xml b/addons/point_of_sale/point_of_sale_view.xml index a3628761173..dbd5e731db1 100644 --- a/addons/point_of_sale/point_of_sale_view.xml +++ b/addons/point_of_sale/point_of_sale_view.xml @@ -773,16 +773,12 @@

- - - - - - - - - - + + + + + + From 1641ea0997b1cc3aeeaa62f46dd230b417971a98 Mon Sep 17 00:00:00 2001 From: Amit Dodiya Date: Tue, 12 Feb 2013 12:16:41 +0530 Subject: [PATCH 040/262] [FIX]stock: while running the product to process wizard on done state move gives traceback bzr revid: ado@tinyerp.com-20130212064641-t317b31srnd0wohi --- addons/stock/wizard/stock_partial_move.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/stock/wizard/stock_partial_move.py b/addons/stock/wizard/stock_partial_move.py index 89744615f22..66a346a41df 100644 --- a/addons/stock/wizard/stock_partial_move.py +++ b/addons/stock/wizard/stock_partial_move.py @@ -22,6 +22,7 @@ from openerp.osv import fields, osv from openerp.tools.misc import DEFAULT_SERVER_DATETIME_FORMAT import time +from openerp.tools.translate import _ class stock_partial_move_line(osv.osv_memory): _inherit = "stock.partial.picking.line" @@ -67,6 +68,8 @@ class stock_partial_move(osv.osv_memory): } moves_ids = [] for move in partial.move_ids: + if not move.move_id: + raise osv.except_osv(_('Invalid Action !'), _("You can't process the move which is in done state You have manually created line in wizard. Please delete any lines you created !")) move_id = move.move_id.id partial_data['move%s' % (move_id)] = { 'product_id': move.product_id.id, From 35b909c78395c5b3a735fdf052adc9a25e8ff08e Mon Sep 17 00:00:00 2001 From: Amit Dodiya Date: Tue, 12 Feb 2013 13:06:10 +0530 Subject: [PATCH 041/262] [FIX]survey: while adding the question from edit survey wizard gives traceback bzr revid: ado@tinyerp.com-20130212073610-8mrpjpk2hyt5tzzd --- addons/survey/survey.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/survey/survey.py b/addons/survey/survey.py index 241b9739016..50f00c978a0 100644 --- a/addons/survey/survey.py +++ b/addons/survey/survey.py @@ -502,7 +502,7 @@ class survey_question(osv.osv): def create(self, cr, uid, vals, context=None): minimum_ans = 0 maximum_ans = 0 - page = self.pool.get('survey.page').browse(cr, uid, vals['page_id'], context=context).title + page = self.pool.get('survey.page').browse(cr, uid, vals.get('page_id'), context=context).title if vals.has_key('answer_choice_ids') and not len(vals['answer_choice_ids']): if vals.has_key('type') and vals['type'] not in ['descriptive_text', 'single_textbox', 'comment','table']: raise osv.except_osv(_('Warning!'),_('You must enter one or more answers for question "%s" of page %s .') % (vals['question'], page)) From cdb96761d4ab0a8b01b6f22e445fff00ba1ce189 Mon Sep 17 00:00:00 2001 From: Hardik Ansodariya Date: Tue, 12 Feb 2013 17:01:33 +0530 Subject: [PATCH 042/262] [FIX] hr_holidays: add date_from field in list view in order to be able group by start date(Maintenance case:585171) bzr revid: han@tinyerp.com-20130212113133-0xs34511nn45uqx0 --- addons/hr_holidays/hr_holidays_view.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/hr_holidays/hr_holidays_view.xml b/addons/hr_holidays/hr_holidays_view.xml index f8b4ad07b77..adee1e71f5d 100644 --- a/addons/hr_holidays/hr_holidays_view.xml +++ b/addons/hr_holidays/hr_holidays_view.xml @@ -146,6 +146,7 @@ + From 0b637725be2472d68f3a1fa17833a3472fc40431 Mon Sep 17 00:00:00 2001 From: "Ravi Gohil (OpenERP)" Date: Fri, 15 Feb 2013 14:12:13 +0530 Subject: [PATCH 043/262] [FIX] report_webkit: If a certain translateable term happens to be the same src value as on another report (both webkit and non-webkit reports) the resulting translation on a webkit report uses the first translation found (which is highly likely to be from the other report). (Maintenance Case: 586086) lp bug: https://launchpad.net/bugs/1098602 fixed bzr revid: rgo@tinyerp.com-20130215084213-h38jfi447y4qpf94 --- addons/report_webkit/webkit_report.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/report_webkit/webkit_report.py b/addons/report_webkit/webkit_report.py index b6c273f8852..6ad950d8302 100644 --- a/addons/report_webkit/webkit_report.py +++ b/addons/report_webkit/webkit_report.py @@ -191,8 +191,9 @@ class WebKitParser(report_sxw): def translate_call(self, src): """Translate String.""" ir_translation = self.pool.get('ir.translation') + name = self.tmpl and 'addons/' + self.tmpl or None res = ir_translation._get_source(self.parser_instance.cr, self.parser_instance.uid, - None, 'report', self.parser_instance.localcontext.get('lang', 'en_US'), src) + name, 'report', self.parser_instance.localcontext.get('lang', 'en_US'), src) if not res : return src return res From eb6ba5ba47f228adc746cedfa3cd92c154fce60b Mon Sep 17 00:00:00 2001 From: "Pinakin Nayi (OpenERP)" Date: Fri, 15 Feb 2013 15:28:01 +0530 Subject: [PATCH 044/262] [IMP]account:field supplier invoice number should be set in journal entry as description bzr revid: pna@tinyerp.com-20130215095801-wstbzqniydainl4s --- addons/account/account_invoice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index f255b6788ee..4f49ecec87a 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -926,7 +926,7 @@ class account_invoice(osv.osv): total, total_currency, iml = self.compute_invoice_totals(cr, uid, inv, company_currency, ref, iml, context=ctx) acc_id = inv.account_id.id - name = inv['name'] or '/' + name = inv['name'] or inv['supplier_invoice_number'] or '/' totlines = False if inv.payment_term: totlines = payment_term_obj.compute(cr, From a75891e1b64876f5534ce636f6e3559635a3f57e Mon Sep 17 00:00:00 2001 From: Mohammed Shekha Date: Mon, 18 Feb 2013 11:24:02 +0530 Subject: [PATCH 045/262] [FIX]Fixed the issue of translation of POS action buttons. bzr revid: msh@openerp.com-20130218055402-zaxa2g6c4o0t6cu5 --- addons/point_of_sale/static/src/js/screens.js | 11 ++++++----- addons/point_of_sale/static/src/js/widgets.js | 5 +++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/addons/point_of_sale/static/src/js/screens.js b/addons/point_of_sale/static/src/js/screens.js index eca4a3c5915..457457b2969 100644 --- a/addons/point_of_sale/static/src/js/screens.js +++ b/addons/point_of_sale/static/src/js/screens.js @@ -16,7 +16,8 @@ // hide()s function openerp_pos_screens(instance, module){ //module is instance.point_of_sale - var QWeb = instance.web.qweb; + var QWeb = instance.web.qweb, + _t = instance.web._t; module.ScreenSelector = instance.web.Class.extend({ init: function(options){ @@ -808,13 +809,13 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa var self = this; this.add_action_button({ - label: 'Print', + label: _t('Print'), icon: '/point_of_sale/static/src/img/icons/png48/printer.png', click: function(){ self.print(); }, }); this.add_action_button({ - label: 'Next Order', + label: _t('Next Order'), icon: '/point_of_sale/static/src/img/icons/png48/go-next.png', click: function() { self.finishOrder(); }, }); @@ -870,7 +871,7 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa this.set_numpad_state(this.pos_widget.numpad.state); this.back_button = this.add_action_button({ - label: 'Back', + label: _t('Back'), icon: '/point_of_sale/static/src/img/icons/png48/go-previous.png', click: function(){ self.pos_widget.screen_selector.set_current_screen(self.back_screen); @@ -878,7 +879,7 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa }); this.validate_button = this.add_action_button({ - label: 'Validate', + label: _t('Validate'), name: 'validation', icon: '/point_of_sale/static/src/img/icons/png48/validate.png', click: function(){ diff --git a/addons/point_of_sale/static/src/js/widgets.js b/addons/point_of_sale/static/src/js/widgets.js index 874c387ea23..b7cedcf548c 100644 --- a/addons/point_of_sale/static/src/js/widgets.js +++ b/addons/point_of_sale/static/src/js/widgets.js @@ -1,5 +1,6 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sale - var QWeb = instance.web.qweb; + var QWeb = instance.web.qweb, + _t = instance.web._t; // The ImageCache is used to hide the latency of the application cache on-disk access in chrome // that causes annoying flickering on product pictures. Why the hell a simple access to @@ -969,7 +970,7 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa this.onscreen_keyboard.appendTo($(".point-of-sale #content")); this.close_button = new module.HeaderButtonWidget(this,{ - label:'Close', + label: _t('Close'), action: function(){ self.try_close(); }, }); this.close_button.appendTo(this.$('#rightheader')); From fe8ccdf3140a89dbcaaed1b0bd2afa26e558eb1e Mon Sep 17 00:00:00 2001 From: Amit Dodiya Date: Mon, 18 Feb 2013 17:54:06 +0530 Subject: [PATCH 046/262] [FIX] [FIX] account: make the string translatable bzr revid: ado@tinyerp.com-20130218122406-97nnt3py85i35s9u --- addons/account/wizard/account_fiscalyear_close.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/wizard/account_fiscalyear_close.py b/addons/account/wizard/account_fiscalyear_close.py index d4f7b3e6654..c2acfb75f22 100644 --- a/addons/account/wizard/account_fiscalyear_close.py +++ b/addons/account/wizard/account_fiscalyear_close.py @@ -38,7 +38,7 @@ class account_fiscalyear_close(osv.osv_memory): 'report_name': fields.char('Name of new entries',size=64, required=True, help="Give name of the new entries"), } _defaults = { - 'report_name': _('End of Fiscal Year Entry'), + 'report_name': lambda self, cr, uid, context: _('End of Fiscal Year Entry'), } def data_save(self, cr, uid, ids, context=None): From 62e70a533e0587e78d31621f6e3d8c549c68f4c3 Mon Sep 17 00:00:00 2001 From: "Mayur Maheshwari (OpenERP)" Date: Mon, 18 Feb 2013 18:06:42 +0530 Subject: [PATCH 047/262] [FIX]stock: added warring message if user mannualy add prodcut line in return product wizard bzr revid: mma@tinyerp.com-20130218123642-3f5nzld3qmjrm0ap --- addons/stock/wizard/stock_return_picking.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/stock/wizard/stock_return_picking.py b/addons/stock/wizard/stock_return_picking.py index 7c6f0655e7a..2aca6249d56 100644 --- a/addons/stock/wizard/stock_return_picking.py +++ b/addons/stock/wizard/stock_return_picking.py @@ -180,6 +180,8 @@ class stock_return_picking(osv.osv_memory): for v in val_id: data_get = data_obj.browse(cr, uid, v, context=context) mov_id = data_get.move_id.id + if not mov_id: + raise osv.except_osv(_('Warning !'), _("You can't process the move which is in done state ! \n Or \n You have manually created line in wizard. Please delete any lines you created !")) new_qty = data_get.quantity move = move_obj.browse(cr, uid, mov_id, context=context) new_location = move.location_dest_id.id From 3d0a4e0c3dd4c90fac7d539f26e90a5ff683e19b Mon Sep 17 00:00:00 2001 From: Amit Dodiya Date: Thu, 28 Feb 2013 12:33:11 +0530 Subject: [PATCH 048/262] [FIX] make the breadcrump string translatable bzr revid: ado@tinyerp.com-20130228070311-zbhx3bcpqo6cgfx0 --- addons/account/account_invoice.py | 8 ++++---- addons/account/i18n/account.pot | 24 ++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index 2a4b410de2f..fc8acc99b22 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -1130,10 +1130,10 @@ class account_invoice(osv.osv): if not ids: return [] types = { - 'out_invoice': 'Invoice ', - 'in_invoice': 'Sup. Invoice ', - 'out_refund': 'Refund ', - 'in_refund': 'Supplier Refund ', + 'out_invoice': _('Invoice '), + 'in_invoice': _('Sup. Invoice '), + 'out_refund': _('Refund '), + 'in_refund': _('Supplier Refund '), } return [(r['id'], (r['number']) or types[r['type']] + (r['name'] or '')) for r in self.read(cr, uid, ids, ['type', 'number', 'name'], context, load='_classic_write')] diff --git a/addons/account/i18n/account.pot b/addons/account/i18n/account.pot index 12661a8ee22..7125cbae281 100644 --- a/addons/account/i18n/account.pot +++ b/addons/account/i18n/account.pot @@ -52,6 +52,30 @@ msgstr "" msgid "Residual" msgstr "" +#. module: account +#: code:addons/account/account_invoice.py:1133 +#, python-format +msgid "Invoice " +msgstr "" + +#. module: account +#: code:addons/account/account_invoice.py:1134 +#, python-format +msgid "Sup. Invoice " +msgstr "" + +#. module: account +#: code:addons/account/account_invoice.py:11345 +#, python-format +msgid "Refund " +msgstr "" + +#. module: account +#: code:addons/account/account_invoice.py:1136 +#, python-format +msgid "Supplier Refund " +msgstr "" + #. module: account #: code:addons/account/account_bank_statement.py:368 #, python-format From 9b31288c14613f62bd339dd29050e570100c088e Mon Sep 17 00:00:00 2001 From: "Ravish (Open ERP)" Date: Mon, 4 Mar 2013 16:25:32 +0530 Subject: [PATCH 049/262] currecy_so_po bzr revid: rmu@tinyerp.com-20130304105532-hzwakhr1y71q88iz --- addons/product/security/product_security.xml | 2 ++ addons/purchase/purchase.py | 3 ++- addons/purchase/purchase_view.xml | 2 +- addons/sale/sale.py | 5 +++-- addons/sale/sale_view.xml | 2 +- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/addons/product/security/product_security.xml b/addons/product/security/product_security.xml index 2e6bdac9fca..bf528160464 100644 --- a/addons/product/security/product_security.xml +++ b/addons/product/security/product_security.xml @@ -10,11 +10,13 @@ Sales Pricelists + Purchase Pricelists + diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index e76bf4a0358..4a37e28b96f 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -184,7 +184,7 @@ class purchase_order(osv.osv): 'warehouse_id': fields.many2one('stock.warehouse', 'Destination Warehouse'), 'location_id': fields.many2one('stock.location', 'Destination', required=True, domain=[('usage','<>','view')], states={'confirmed':[('readonly',True)], 'approved':[('readonly',True)],'done':[('readonly',True)]} ), 'pricelist_id':fields.many2one('product.pricelist', 'Pricelist', required=True, states={'confirmed':[('readonly',True)], 'approved':[('readonly',True)],'done':[('readonly',True)]}, help="The pricelist sets the currency used for this purchase order. It also computes the supplier price for the selected products/quantities."), - 'currency_id': fields.related('pricelist_id', 'currency_id', type="many2one", relation="res.currency", string="Currency",readonly=True, required=True), + 'currency_id': fields.many2one('res.currency','Currency', readonly=True, required=True,states={'draft': [('readonly', False)],'sent': [('readonly', False)]}), 'state': fields.selection(STATE_SELECTION, 'Status', readonly=True, help="The status of the purchase order or the quotation request. A quotation is a purchase order in a 'Draft' status. Then the order has to be confirmed by the user, the status switch to 'Confirmed'. Then the supplier must confirm the order to change the status to 'Approved'. When the purchase order is paid and received, the status becomes 'Done'. If a cancel action occurs in the invoice or in the reception of goods, the status becomes in exception.", select=True), 'order_line': fields.one2many('purchase.order.line', 'order_id', 'Order Lines', states={'approved':[('readonly',True)],'done':[('readonly',True)]}), 'validator' : fields.many2one('res.users', 'Validated by', readonly=True), @@ -224,6 +224,7 @@ class purchase_order(osv.osv): 'create_uid': fields.many2one('res.users', 'Responsible'), 'company_id': fields.many2one('res.company','Company',required=True,select=1, states={'confirmed':[('readonly',True)], 'approved':[('readonly',True)]}), 'journal_id': fields.many2one('account.journal', 'Journal'), + 'currency_id': lambda self, cr, uid, context: self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.currency_id.id } _defaults = { 'date_order': fields.date.context_today, diff --git a/addons/purchase/purchase_view.xml b/addons/purchase/purchase_view.xml index 8ba730567e2..a365b719f6a 100644 --- a/addons/purchase/purchase_view.xml +++ b/addons/purchase/purchase_view.xml @@ -191,7 +191,7 @@ - + diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 8656dccd5db..0e4e1333e53 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -215,7 +215,7 @@ class sale_order(osv.osv): help="""This field controls how invoice and delivery operations are synchronized. - With 'Before Delivery', a draft invoice is created, and it must be paid before delivery."""), 'pricelist_id': fields.many2one('product.pricelist', 'Pricelist', required=True, readonly=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}, help="Pricelist for current sales order."), - 'currency_id': fields.related('pricelist_id', 'currency_id', type="many2one", relation="res.currency", string="Currency", readonly=True, required=True), + 'currency_id': fields.many2one('res.currency','Currency', readonly=True, required=True,states={'draft': [('readonly', False)],'sent': [('readonly', False)]}), 'project_id': fields.many2one('account.analytic.account', 'Contract / Analytic', readonly=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}, help="The analytic account related to a sales order."), 'order_line': fields.one2many('sale.order.line', 'order_id', 'Order Lines', readonly=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}), @@ -261,7 +261,8 @@ class sale_order(osv.osv): 'shop_id': _get_default_shop, 'partner_invoice_id': lambda self, cr, uid, context: context.get('partner_id', False) and self.pool.get('res.partner').address_get(cr, uid, [context['partner_id']], ['invoice'])['invoice'], 'partner_shipping_id': lambda self, cr, uid, context: context.get('partner_id', False) and self.pool.get('res.partner').address_get(cr, uid, [context['partner_id']], ['delivery'])['delivery'], - 'note': lambda self, cr, uid, context: self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.sale_note + 'note': lambda self, cr, uid, context: self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.sale_note, + 'currency_id': lambda self, cr, uid, context: self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.currency_id.id } _sql_constraints = [ ('name_uniq', 'unique(name, company_id)', 'Order Reference must be unique per Company!'), diff --git a/addons/sale/sale_view.xml b/addons/sale/sale_view.xml index f4b8283f9b4..115f5dad79c 100644 --- a/addons/sale/sale_view.xml +++ b/addons/sale/sale_view.xml @@ -163,7 +163,7 @@ - + From cca957c7169f5a72f25a3e7f0ed9d397091bb5f1 Mon Sep 17 00:00:00 2001 From: "Ravish (Open ERP)" Date: Mon, 4 Mar 2013 16:52:06 +0530 Subject: [PATCH 050/262] currecy_so_po_improve bzr revid: rmu@tinyerp.com-20130304112206-dk1486i17igx33g0 --- addons/purchase/purchase.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index 4a37e28b96f..4c534265763 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -224,7 +224,7 @@ class purchase_order(osv.osv): 'create_uid': fields.many2one('res.users', 'Responsible'), 'company_id': fields.many2one('res.company','Company',required=True,select=1, states={'confirmed':[('readonly',True)], 'approved':[('readonly',True)]}), 'journal_id': fields.many2one('account.journal', 'Journal'), - 'currency_id': lambda self, cr, uid, context: self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.currency_id.id + } _defaults = { 'date_order': fields.date.context_today, @@ -236,6 +236,7 @@ class purchase_order(osv.osv): 'pricelist_id': lambda self, cr, uid, context: context.get('partner_id', False) and self.pool.get('res.partner').browse(cr, uid, context['partner_id']).property_product_pricelist_purchase.id, 'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'purchase.order', context=c), 'journal_id': _get_journal, + 'currency_id': lambda self, cr, uid, context: self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.currency_id.id } _sql_constraints = [ ('name_uniq', 'unique(name, company_id)', 'Order Reference must be unique per Company!'), From 1ee33ffb205e7ee2adc42ffa42eac7a50e6f7ad9 Mon Sep 17 00:00:00 2001 From: "Ravish (Open ERP)" Date: Tue, 5 Mar 2013 10:14:47 +0530 Subject: [PATCH 051/262] changes as per suggestion bzr revid: rmu@tinyerp.com-20130305044447-iuyiw2o8epioaajt --- addons/product/security/product_security.xml | 2 -- 1 file changed, 2 deletions(-) diff --git a/addons/product/security/product_security.xml b/addons/product/security/product_security.xml index bf528160464..2e6bdac9fca 100644 --- a/addons/product/security/product_security.xml +++ b/addons/product/security/product_security.xml @@ -10,13 +10,11 @@ Sales Pricelists - Purchase Pricelists - From a737b154b329d0beda68f74334e28076d7ac31c6 Mon Sep 17 00:00:00 2001 From: Mohammed Shekha Date: Wed, 6 Mar 2013 11:24:41 +0530 Subject: [PATCH 052/262] [FIX]Fixed the issue of context not passed call, due to which view strings are not translated. bzr revid: msh@openerp.com-20130306055441-uraju3iwod8yqg6t --- addons/share/static/src/js/share.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/share/static/src/js/share.js b/addons/share/static/src/js/share.js index da72cea602d..30d933d59d5 100644 --- a/addons/share/static/src/js/share.js +++ b/addons/share/static/src/js/share.js @@ -16,7 +16,7 @@ openerp.share = function(session) { domains: [domain], contexts: [view.dataset.context] }).done(function (result) { - Share.create({ + $.when(Share.create({ name: action.name, record_name: rec_name, domain: result.domain, @@ -24,8 +24,8 @@ openerp.share = function(session) { user_type: user_type || 'embedded', view_type: view.fields_view.type, invite: invite || false, - }).done(function(share_id) { - var step1 = Share.call('go_step_1', [[share_id]]).done(function(result) { + })).then(function(share_id) { + var step1 = Share.call('go_step_1', [[share_id], result.context]).done(function(result) { var action = result; self.do_action(action); }); From c1e0521566c9c8b893b424f6b03d2ea65d845f55 Mon Sep 17 00:00:00 2001 From: Amit Dodiya Date: Fri, 8 Mar 2013 18:32:27 +0530 Subject: [PATCH 053/262] [FIX]: account: when we create invoice from portal menu got the error becuase in context we have passed list in type so code cannot handle the list bzr revid: ado@tinyerp.com-20130308130227-bvm08cab4gjkco71 --- addons/account/account_invoice.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index 17135ed1f76..269a2367c5f 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -53,9 +53,12 @@ class account_invoice(osv.osv): company_id = context.get('company_id', user.company_id.id) type2journal = {'out_invoice': 'sale', 'in_invoice': 'purchase', 'out_refund': 'sale_refund', 'in_refund': 'purchase_refund'} journal_obj = self.pool.get('account.journal') - res = journal_obj.search(cr, uid, [('type', '=', type2journal.get(type_inv, 'sale')), - ('company_id', '=', company_id)], - limit=1) + domain = [('company_id', '=', company_id)] + if isinstance(type_inv, list): + domain.append(('type', 'in', [type2journal.get(type) for type in type_inv if type2journal.get(type)])) + else: + domain.append(('type', '=', type2journal.get(type_inv, 'sale'))) + res = journal_obj.search(cr, uid, domain, limit=1) return res and res[0] or False def _get_currency(self, cr, uid, context=None): From f97c97d672b4acd8945f5cd0ae97cc4fe68948f6 Mon Sep 17 00:00:00 2001 From: "Pinakin Nayi (OpenERP)" Date: Wed, 13 Mar 2013 12:30:29 +0530 Subject: [PATCH 054/262] [IMP]account_followup,hr_timesheet_sheet:in analysis report create button is there but no need of it bzr revid: pna@tinyerp.com-20130313070029-9ojiilbnl2tn7f3g --- addons/account_followup/report/account_followup_report.xml | 2 +- addons/hr_timesheet_sheet/report/timesheet_report_view.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account_followup/report/account_followup_report.xml b/addons/account_followup/report/account_followup_report.xml index 6fee6a77ac1..b7c38e89f5e 100644 --- a/addons/account_followup/report/account_followup_report.xml +++ b/addons/account_followup/report/account_followup_report.xml @@ -6,7 +6,7 @@ account_followup.stat.tree account_followup.stat - + diff --git a/addons/hr_timesheet_sheet/report/timesheet_report_view.xml b/addons/hr_timesheet_sheet/report/timesheet_report_view.xml index aee07fc23b6..ddc66260cf0 100644 --- a/addons/hr_timesheet_sheet/report/timesheet_report_view.xml +++ b/addons/hr_timesheet_sheet/report/timesheet_report_view.xml @@ -16,7 +16,7 @@ timesheet.report.tree timesheet.report - + From 7daa6807eee4835ab892206d4dcf4b5a80e8061f Mon Sep 17 00:00:00 2001 From: "Somesh Khare (OpenERP)" Date: Fri, 15 Mar 2013 14:35:17 +0530 Subject: [PATCH 055/262] [FIX]account_move_line:due to boolean value for journal_id and period_id error occurred (Case: ref 589954) bzr revid: skh@tinyerp.com-20130315090517-84g17n9ax2iijh0j --- addons/account/account_move_line.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index a96ed889aae..06f597768b3 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -1070,12 +1070,12 @@ class account_move_line(osv.osv): for line in self.browse(cr, uid, ids, context=context): ctx = context.copy() - if ('journal_id' not in ctx): + if not ctx.get('journal_id'): if line.move_id: ctx['journal_id'] = line.move_id.journal_id.id else: ctx['journal_id'] = line.journal_id.id - if ('period_id' not in ctx): + if not ctx.get('period_id'): if line.move_id: ctx['period_id'] = line.move_id.period_id.id else: From 52efab6820cabad5c663c39242c7a77991820863 Mon Sep 17 00:00:00 2001 From: Nehal Panchal Date: Tue, 19 Mar 2013 15:12:36 +0530 Subject: [PATCH 056/262] [FIX] warning : changed the inherited view of product form of warning module bzr revid: nep@tinyerp.com-20130319094236-calq1peyb6onmpuz --- addons/warning/warning_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/warning/warning_view.xml b/addons/warning/warning_view.xml index 1df38771e9c..04a35530bd2 100644 --- a/addons/warning/warning_view.xml +++ b/addons/warning/warning_view.xml @@ -41,7 +41,7 @@ product.warning.form.inherit product.product - + From 307818ea0b0ee424cce1405de79b010c73015660 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Wed, 20 Mar 2013 12:15:20 +0100 Subject: [PATCH 057/262] [ADD] additions from trunk-hr-goal-mat bzr revid: mat@openerp.com-20130320111520-fmz14if4k400s9s4 --- addons/hr/__openerp__.py | 1 + addons/hr/hr.py | 41 ++++++++++++++++++++++++++++++++ addons/hr/hr_view.xml | 16 +++++++++---- addons/hr/mail_hr_view.xml | 24 +++++++++++++++++++ addons/hr/static/src/css/hr.css | 5 ++++ addons/mail/mail_thread_view.xml | 3 ++- 6 files changed, 85 insertions(+), 5 deletions(-) create mode 100644 addons/hr/mail_hr_view.xml diff --git a/addons/hr/__openerp__.py b/addons/hr/__openerp__.py index b4b8e982845..b978a83e658 100644 --- a/addons/hr/__openerp__.py +++ b/addons/hr/__openerp__.py @@ -59,6 +59,7 @@ You can manage: 'hr_installer.xml', 'hr_data.xml', 'res_config_view.xml', + 'mail_hr_view.xml', ], 'demo': ['hr_demo.xml'], 'test': [ diff --git a/addons/hr/hr.py b/addons/hr/hr.py index 467f34f708b..590e8a52fa8 100644 --- a/addons/hr/hr.py +++ b/addons/hr/hr.py @@ -23,6 +23,8 @@ from openerp import addons import logging from openerp.osv import fields, osv from openerp import tools +from openerp.tools.translate import _ + _logger = logging.getLogger(__name__) class hr_employee_category(osv.osv): @@ -264,6 +266,45 @@ class hr_employee(osv.osv): image_path = addons.get_module_resource('hr', 'static/src/img', 'default_image.png') return tools.image_resize_image_big(open(image_path, 'rb').read().encode('base64')) + def action_follow(self, cr, uid, ids, context=None): + """ Wrapper because message_subscribe_users take a user_ids=None + that receive the context without the wrapper. """ + return self.message_subscribe_users(cr, uid, ids, context=context) + + def action_unfollow(self, cr, uid, ids, context=None): + """ Wrapper because message_unsubscribe_users take a user_ids=None + that receive the context without the wrapper. """ + return self.message_unsubscribe_users(cr, uid, ids, context=context) + + def message_post(self, cr, uid, thread_id, context=None, **kwargs): + """Overwrite the message_post method when using the send to my + followers screen + + When a message is sent to a hr.employee using the action + action_mail_inbox_feeds, the context is extended with res_users_id + containing the user id of the user linked to the employee and + default_res_id contains 0 (to avoid misused of the function called from + the inbox page). + In these conditions, the thread_id used to send the message is the id + of the employee instead of the res_users (or partner_id). + If several employee are linked to the same user_id, the message is + duplicated and sent to every user. + + :return: the result of message_post from mail_thread, last call if + several messages are sent. + """ + if 'res_users_id' in context: # and context['default_res_id'] == 0: + employee_ids = self.search(cr, uid, [('user_id', '=', context['res_users_id'])], context=context) + if len(employee_ids) > 0: + for employee_id in employee_ids: + res = super(hr_employee, self).message_post(cr, uid, employee_id, context=context, **kwargs) + return res + else: + raise osv.except_osv(_('Warning!'), _('Your user is not linked to an employee form, which is required to send messages to your followers.')) + + # if no overwrite, send message as usual + return super(hr_employee, self).message_post(cr, uid, thread_id, context=context, **kwargs) + _defaults = { 'active': 1, 'image': _get_default_image, diff --git a/addons/hr/hr_view.xml b/addons/hr/hr_view.xml index e0c3edfdb39..9d08627b3b2 100644 --- a/addons/hr/hr_view.xml +++ b/addons/hr/hr_view.xml @@ -27,6 +27,10 @@