From 968a0de2e07d64be493c33c5e054e222eec865c2 Mon Sep 17 00:00:00 2001 From: "Rajesh Prajapati (OpenERP)" Date: Thu, 26 Jul 2012 10:28:04 +0530 Subject: [PATCH 1/8] [IMP] project : string rename to Contact and traceback of escalate button bzr revid: rpr@tinyerp.com-20120726045804-g8kn4cx01klawdr6 --- addons/base_status/base_state.py | 30 +++++++++++++++++++++++++++--- addons/project/project_view.xml | 8 ++++---- 2 files changed, 31 insertions(+), 7 deletions(-) diff --git a/addons/base_status/base_state.py b/addons/base_status/base_state.py index 35995ac7da3..27710baf917 100644 --- a/addons/base_status/base_state.py +++ b/addons/base_status/base_state.py @@ -19,7 +19,7 @@ # ############################################################################## -from osv import fields +from osv import fields, osv from tools.translate import _ class base_state(object): @@ -104,7 +104,23 @@ class base_state(object): self.case_set(cr, uid, [case.id], 'open', values, context=context) self.case_open_send_note(cr, uid, [case.id], context=context) return True - + def case_escalate(self, cr, uid, ids, context=None): + """ Escalates case to parent level """ + cases = self.browse(cr, uid, ids, context=context) + cases[0].state # fill browse record cache, for _action having old and new values + data = {'active': True} + for case in cases: + parent_id = case.section_id.parent_id + if parent_id: + data['section_id'] = parent_id.id + if parent_id.change_responsible and parent_id.user_id: + data['user_id'] = parent_id.user_id.id + else: + raise osv.except_osv(_('Error !'), _('You can not escalate, you are already at the top level regarding your sales-team category.')) + self.write(cr, uid, [case.id], data, context=context) + case.case_escalate_send_note(parent_id.user_id, context=context) + self._action(cr, uid, cases, 'escalate', context=context) + return True def case_close(self, cr, uid, ids, context=None): """ Closes case """ self.case_set(cr, uid, ids, 'done', {'date_closed': fields.datetime.now()}, context=context) @@ -169,7 +185,15 @@ class base_state(object): msg = _('%s has been opened.') % (self.case_get_note_msg_prefix(cr, uid, id, context=context)) self.message_append_note(cr, uid, [id], body=msg, context=context) return True - + def case_escalate_send_note(self, cr, uid, ids, new_section=None, context=None): + for id in ids: + if new_section: + msg = '%s has been escalated to %s.' % (self.case_get_note_msg_prefix(cr, uid, id, context=context), new_section.name) + else: + msg = '%s has been escalated.' % (self.case_get_note_msg_prefix(cr, uid, id, context=context)) + self.message_append_note(cr, uid, [id], 'System Notification', msg, context=context) + return True + def case_close_send_note(self, cr, uid, ids, context=None): for id in ids: msg = _('%s has been closed.') % (self.case_get_note_msg_prefix(cr, uid, id, context=context)) diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml index cc6f5b05ad8..c24eae7aed9 100644 --- a/addons/project/project_view.xml +++ b/addons/project/project_view.xml @@ -10,7 +10,7 @@ - + - + Mark unread @@ -84,7 +84,7 @@ - + @@ -195,7 +195,7 @@ - + From 91b7fb7291854137dc2f165961c9bc869a1cbc5b Mon Sep 17 00:00:00 2001 From: "Ajay Chauhan (OpenERP)" Date: Fri, 27 Jul 2012 11:15:43 +0530 Subject: [PATCH 2/8] [IMP]account : Solved the issue of not getting warning for overlapping periods with demo data bzr revid: cha@tinyerp.com-20120727054543-esq0461094djoe48 --- addons/account/demo/account_demo.xml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/addons/account/demo/account_demo.xml b/addons/account/demo/account_demo.xml index 0dff40ca19f..c1dcc3f58ed 100644 --- a/addons/account/demo/account_demo.xml +++ b/addons/account/demo/account_demo.xml @@ -20,7 +20,7 @@ - + @@ -29,7 +29,7 @@ - + @@ -39,7 +39,7 @@ - + @@ -48,7 +48,7 @@ - + @@ -57,7 +57,7 @@ - + @@ -66,7 +66,7 @@ - + @@ -75,7 +75,7 @@ - + @@ -84,7 +84,7 @@ - + @@ -93,7 +93,7 @@ - + @@ -102,7 +102,7 @@ - + @@ -111,7 +111,7 @@ - + @@ -120,7 +120,7 @@ - + From fe071b4816baff727ea45975b481a30a8468ce14 Mon Sep 17 00:00:00 2001 From: "Ajay Chauhan (OpenERP)" Date: Fri, 27 Jul 2012 14:16:42 +0530 Subject: [PATCH 3/8] [IMP]account : made c capital for Centralised Counterpart bzr revid: cha@tinyerp.com-20120727084642-42ronls2600r2thk --- addons/account/account.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/account.py b/addons/account/account.py index cbba0237c78..19548c647f4 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -730,7 +730,7 @@ class account_journal(osv.osv): 'view_id': fields.many2one('account.journal.view', 'Display Mode', required=True, help="Gives the view used when writing or browsing entries in this journal. The view tells OpenERP which fields should be visible, required or readonly and in which order. You can create your own view for a faster encoding in each journal."), 'default_credit_account_id': fields.many2one('account.account', 'Default Credit Account', domain="[('type','!=','view')]", help="It acts as a default account for credit amount"), 'default_debit_account_id': fields.many2one('account.account', 'Default Debit Account', domain="[('type','!=','view')]", help="It acts as a default account for debit amount"), - 'centralisation': fields.boolean('Centralised counterpart', help="Check this box to determine that each entry of this journal won't create a new counterpart but will share the same counterpart. This is used in fiscal year closing."), + 'centralisation': fields.boolean('Centralised Counterpart', help="Check this box to determine that each entry of this journal won't create a new counterpart but will share the same counterpart. This is used in fiscal year closing."), 'update_posted': fields.boolean('Allow Cancelling Entries', help="Check this box if you want to allow the cancellation the entries related to this journal or of the invoice related to this journal"), 'group_invoice_lines': fields.boolean('Group Invoice Lines', help="If this box is checked, the system will try to group the accounting lines when generating them from invoices."), 'sequence_id': fields.many2one('ir.sequence', 'Entry Sequence', help="This field contains the information related to the numbering of the journal entries of this journal.", required=True), From 1a1a92e81105ff125800ae9c249c0ecc5bbe6b6a Mon Sep 17 00:00:00 2001 From: "Rajesh Prajapati (OpenERP)" Date: Fri, 3 Aug 2012 12:57:50 +0530 Subject: [PATCH 4/8] [IMP] project : traceback of escalate button and string rename to contact bzr revid: rpr@tinyerp.com-20120803072750-zni0d9zvn8ihe1xz --- addons/base_status/base_state.py | 31 +++++++++++++++++-------------- addons/project/project_view.xml | 4 ++-- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/addons/base_status/base_state.py b/addons/base_status/base_state.py index 27710baf917..4247e67f435 100644 --- a/addons/base_status/base_state.py +++ b/addons/base_status/base_state.py @@ -92,18 +92,6 @@ class base_state(object): data.update(self.onchange_partner_address_id(cr, uid, ids, addr['contact'])['value']) return {'value': data} - def case_open(self, cr, uid, ids, context=None): - """ Opens case """ - cases = self.browse(cr, uid, ids, context=context) - for case in cases: - values = {'active': True} - if case.state == 'draft': - values['date_open'] = fields.datetime.now() - if not case.user_id: - values['user_id'] = uid - self.case_set(cr, uid, [case.id], 'open', values, context=context) - self.case_open_send_note(cr, uid, [case.id], context=context) - return True def case_escalate(self, cr, uid, ids, context=None): """ Escalates case to parent level """ cases = self.browse(cr, uid, ids, context=context) @@ -118,9 +106,23 @@ class base_state(object): else: raise osv.except_osv(_('Error !'), _('You can not escalate, you are already at the top level regarding your sales-team category.')) self.write(cr, uid, [case.id], data, context=context) - case.case_escalate_send_note(parent_id.user_id, context=context) + case.case_escalate_send_note(parent_id, context=context) self._action(cr, uid, cases, 'escalate', context=context) return True + + def case_open(self, cr, uid, ids, context=None): + """ Opens case """ + cases = self.browse(cr, uid, ids, context=context) + for case in cases: + values = {'active': True} + if case.state == 'draft': + values['date_open'] = fields.datetime.now() + if not case.user_id: + values['user_id'] = uid + self.case_set(cr, uid, [case.id], 'open', values, context=context) + self.case_open_send_note(cr, uid, [case.id], context=context) + return True + def case_close(self, cr, uid, ids, context=None): """ Closes case """ self.case_set(cr, uid, ids, 'done', {'date_closed': fields.datetime.now()}, context=context) @@ -185,6 +187,7 @@ class base_state(object): msg = _('%s has been opened.') % (self.case_get_note_msg_prefix(cr, uid, id, context=context)) self.message_append_note(cr, uid, [id], body=msg, context=context) return True + def case_escalate_send_note(self, cr, uid, ids, new_section=None, context=None): for id in ids: if new_section: @@ -193,7 +196,7 @@ class base_state(object): msg = '%s has been escalated.' % (self.case_get_note_msg_prefix(cr, uid, id, context=context)) self.message_append_note(cr, uid, [id], 'System Notification', msg, context=context) return True - + def case_close_send_note(self, cr, uid, ids, context=None): for id in ids: msg = _('%s has been closed.') % (self.case_get_note_msg_prefix(cr, uid, id, context=context)) diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml index bb57c32f5b4..73fa527b51a 100644 --- a/addons/project/project_view.xml +++ b/addons/project/project_view.xml @@ -10,7 +10,7 @@ - + - + Mark unread From ae6be26e3a33834990e3991e2cece40c225738ed Mon Sep 17 00:00:00 2001 From: "Ajay Chauhan (OpenERP)" Date: Tue, 7 Aug 2012 12:18:10 +0530 Subject: [PATCH 5/8] [IMP]account : revert the changes for demo file bzr revid: cha@tinyerp.com-20120807064810-dbh4dywgsbuy0a81 --- addons/account/demo/account_demo.xml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/addons/account/demo/account_demo.xml b/addons/account/demo/account_demo.xml index c1dcc3f58ed..0dff40ca19f 100644 --- a/addons/account/demo/account_demo.xml +++ b/addons/account/demo/account_demo.xml @@ -20,7 +20,7 @@ - + @@ -29,7 +29,7 @@ - + @@ -39,7 +39,7 @@ - + @@ -48,7 +48,7 @@ - + @@ -57,7 +57,7 @@ - + @@ -66,7 +66,7 @@ - + @@ -75,7 +75,7 @@ - + @@ -84,7 +84,7 @@ - + @@ -93,7 +93,7 @@ - + @@ -102,7 +102,7 @@ - + @@ -111,7 +111,7 @@ - + @@ -120,7 +120,7 @@ - + From 9c891b9fad099f72e9da4f1fdfc93af908a71539 Mon Sep 17 00:00:00 2001 From: "Mayur Maheshwari (OpenERP)" Date: Tue, 7 Aug 2012 15:28:35 +0530 Subject: [PATCH 6/8] [FIX]stock :set a on_change on product_id in tree view bzr revid: mma@tinyerp.com-20120807095835-b2ltv23oamaiojg7 --- 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 2f6447fa802..ff9a295ff04 100644 --- a/addons/stock/stock_view.xml +++ b/addons/stock/stock_view.xml @@ -1250,7 +1250,7 @@ - + From c8f2630b2b27dd4a00ae3e170e6d80cee091fc6b Mon Sep 17 00:00:00 2001 From: "Mayur Maheshwari (OpenERP)" Date: Wed, 8 Aug 2012 14:08:35 +0530 Subject: [PATCH 7/8] [FIX]sale :improve on_change based on uom and its category bzr revid: mma@tinyerp.com-20120808083835-t9fwlisbt9gj7ank --- addons/sale/sale.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/addons/sale/sale.py b/addons/sale/sale.py index f920b34ca42..d2d65bcc649 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -1406,7 +1406,6 @@ class sale_order_line(osv.osv): [('category_id', '=', product_obj.uom_id.category_id.id)], 'product_uos': [('category_id', '=', uos_category_id)]} - elif uos and not uom: # only happens if uom is False result['product_uom'] = product_obj.uom_id and product_obj.uom_id.id result['product_uom_qty'] = qty_uos / product_obj.uos_coeff @@ -1463,15 +1462,12 @@ class sale_order_line(osv.osv): lang=False, update_tax=True, date_order=False, context=None): context = context or {} lang = lang or ('lang' in context and context['lang']) - res = self.product_id_change(cursor, user, ids, pricelist, product, + if not uom: + return {'value': {'price_unit': 0.0, 'product_uom' : uom or False}} + return self.product_id_change(cursor, user, ids, pricelist, product, qty=qty, uom=uom, qty_uos=qty_uos, uos=uos, name=name, partner_id=partner_id, lang=lang, update_tax=update_tax, date_order=date_order, context=context) - if 'product_uom' in res['value']: - del res['value']['product_uom'] - if not uom: - res['value']['price_unit'] = 0.0 - return res def unlink(self, cr, uid, ids, context=None): if context is None: From 6fffe4ba643a6a4b7f45088591ea29f1231bda61 Mon Sep 17 00:00:00 2001 From: Stephane Wirtel Date: Wed, 8 Aug 2012 15:49:44 +0200 Subject: [PATCH 8/8] [REF] bom: Redefine the form view of the boms in the form view of the product object bzr revid: stw@openerp.com-20120808134944-oc45kzo4q5ktbmxy --- addons/mrp/mrp_view.xml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/addons/mrp/mrp_view.xml b/addons/mrp/mrp_view.xml index 4ed90bb7c79..708e60e818b 100644 --- a/addons/mrp/mrp_view.xml +++ b/addons/mrp/mrp_view.xml @@ -1025,6 +1025,14 @@ +
+ + + + + + +