From 9ada619c371d37f128db59676101d44f26c8e7c0 Mon Sep 17 00:00:00 2001 From: "Harry (OpenERP)" Date: Thu, 8 Jul 2010 15:44:24 +0530 Subject: [PATCH 01/50] [IMP] set logger messages bzr revid: hmo@tinyerp.com-20100708101424-hgbmoqco3to16jer --- addons/crm/crm_lead.py | 11 ++++++- addons/crm/crm_opportunity.py | 6 ++++ addons/crm/wizard/crm_lead_to_opportunity.py | 4 ++- addons/hr_recruitment/hr_recruitment.py | 30 +++++++++++++++++++ addons/mrp/mrp.py | 8 +++-- addons/mrp/procurement.py | 5 +++- addons/procurement/procurement.py | 8 ++++- addons/project/project.py | 15 ++++++++++ .../project/wizard/project_task_delegate.py | 6 +++- addons/project_issue/project_issue.py | 20 +++++++++++++ addons/sale_crm/wizard/crm_make_sale.py | 4 ++- addons/scrum/scrum.py | 11 +++++++ addons/scrum/wizard/scrum_backlog_sprint.py | 11 +++++-- addons/stock/stock.py | 12 ++++++-- 14 files changed, 139 insertions(+), 12 deletions(-) diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index bf6d391ab82..6708f3e8f0e 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -168,6 +168,9 @@ and users"), """ res = super(crm_lead, self).case_open(cr, uid, ids, *args) self.write(cr, uid, ids, {'date_open': time.strftime('%Y-%m-%d %H:%M:%S')}) + for (id, name) in self.name_get(cr, uid, ids): + message = _('Lead ') + " '" + name + "' "+ _("is Open.") + self.log(cr, uid, id, message) return res def case_close(self, cr, uid, ids, *args): @@ -180,6 +183,9 @@ and users"), """ res = super(crm_lead, self).case_close(cr, uid, ids, args) self.write(cr, uid, ids, {'date_closed': time.strftime('%Y-%m-%d %H:%M:%S')}) + for (id, name) in self.name_get(cr, uid, ids): + message = _('Lead ') + " '" + name + "' "+ _("is Closed.") + self.log(cr, uid, id, message) return res def convert_opportunity(self, cr, uid, ids, context=None): @@ -276,7 +282,10 @@ and users"), vals.update(res) res = self.create(cr, uid, vals, context) - + + message = _('A Lead created') + " '" + subject + "' " + _("from Mailgate.") + self.log(cr, uid, res, message) + attachents = msg.get('attachments', []) for attactment in attachents or []: data_attach = { diff --git a/addons/crm/crm_opportunity.py b/addons/crm/crm_opportunity.py index 4faebe37d91..e13a428138a 100644 --- a/addons/crm/crm_opportunity.py +++ b/addons/crm/crm_opportunity.py @@ -65,6 +65,9 @@ class crm_opportunity(osv.osv): """ res = super(crm_opportunity, self).case_close(cr, uid, ids, args) self.write(cr, uid, ids, {'probability' : 100.0, 'date_closed': time.strftime('%Y-%m-%d %H:%M:%S')}) + for (id, name) in self.name_get(cr, uid, ids): + message = _('Opportunity ') + " '" + name + "' "+ _("is Won.") + self.log(cr, uid, id, message) return res def case_cancel(self, cr, uid, ids, *args): @@ -77,6 +80,9 @@ class crm_opportunity(osv.osv): """ res = super(crm_opportunity, self).case_cancel(cr, uid, ids, args) self.write(cr, uid, ids, {'probability' : 0.0}) + for (id, name) in self.name_get(cr, uid, ids): + message = _('Opportunity ') + " '" + name + "' "+ _("is Lost.") + self.log(cr, uid, id, message) return res def case_open(self, cr, uid, ids, *args): diff --git a/addons/crm/wizard/crm_lead_to_opportunity.py b/addons/crm/wizard/crm_lead_to_opportunity.py index a77f553b173..7f47e27a4ff 100644 --- a/addons/crm/wizard/crm_lead_to_opportunity.py +++ b/addons/crm/wizard/crm_lead_to_opportunity.py @@ -86,7 +86,8 @@ class crm_lead2opportunity(osv.osv_memory): if lead.partner_id: msg_ids = [ x.id for x in lead.message_ids] self.pool.get('mailgate.message').write(cr, uid, msg_ids, {'partner_id': lead.partner_id.id}, context=context) - + message = _('Lead ') + " '" + lead.name + "' "+ _("is converted to Opportunity.") + self.log(cr, uid, lead.id, message) value = { 'name': _('Opportunity'), 'view_type': 'form', @@ -99,6 +100,7 @@ class crm_lead2opportunity(osv.osv_memory): 'type': 'ir.actions.act_window', 'search_view_id': res['res_id'] } + return value _columns = { diff --git a/addons/hr_recruitment/hr_recruitment.py b/addons/hr_recruitment/hr_recruitment.py index 09ad521d24b..2845768f59c 100644 --- a/addons/hr_recruitment/hr_recruitment.py +++ b/addons/hr_recruitment/hr_recruitment.py @@ -277,6 +277,8 @@ class hr_applicant(osv.osv, crm.crm_case): vals.update(res) res = self.create(cr, uid, vals, context) + message = _('A Job Request created') + " '" + subject + "' " + _("from Mailgate.") + self.log(cr, uid, res, message) attachents = msg.get('attachments', []) for attactment in attachents or []: @@ -338,6 +340,34 @@ class hr_applicant(osv.osv, crm.crm_case): @param **args: Return Dictionary of Keyword Value """ return True + + def case_open(self, cr, uid, ids, *args): + """ + @param self: The object pointer + @param cr: the current row, from the database cursor, + @param uid: the current user’s ID for security checks, + @param ids: List of case's Ids + @param *args: Give Tuple Value + """ + res = super(hr_applicant, self).case_open(cr, uid, ids, *args) + for (id, name) in self.name_get(cr, uid, ids): + message = _('Job request for') + " '" + name + "' "+ _("is Open.") + self.log(cr, uid, id, message) + return res + + def case_close(self, cr, uid, ids, *args): + """ + @param self: The object pointer + @param cr: the current row, from the database cursor, + @param uid: the current user’s ID for security checks, + @param ids: List of case's Ids + @param *args: Give Tuple Value + """ + res = super(hr_applicant, self).case_close(cr, uid, ids, *args) + for (id, name) in self.name_get(cr, uid, ids): + message = _('Applicant ') + " '" + name + "' "+ _("is Hired.") + self.log(cr, uid, id, message) + return res hr_applicant() diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index f3731bb59bb..13ded3a9694 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -757,9 +757,11 @@ class mrp_production(osv.osv): new_parent_ids.append(final_product.id) for new_parent_id in new_parent_ids: stock_mov_obj.write(cr, uid, [raw_product.id], {'move_history_ids': [(4,new_parent_id)]}) - + wf_service = netsvc.LocalService("workflow") wf_service.trg_validate(uid, 'mrp.production', production_id, 'button_produce_done', cr) + message = _('Manufacturing order ') + " '" + production.name + "' "+ _("is finished.") + self.log(cr, uid, production_id, message) return True def _costs_generate(self, cr, uid, production): @@ -925,9 +927,11 @@ class mrp_production(osv.osv): 'company_id': production.company_id.id, }) wf_service.trg_validate(uid, 'procurement.order', proc_id, 'button_confirm', cr) - proc_ids.append(proc_id) + proc_ids.append(proc_id) wf_service.trg_validate(uid, 'stock.picking', picking_id, 'button_confirm', cr) self.write(cr, uid, [production.id], {'picking_id': picking_id, 'move_lines': [(6,0,moves)], 'state':'confirmed'}) + message = _('Manufacturing order ') + " '" + production.name + "' "+ _("is confirmed.") + self.log(cr, uid, production.id, message) return picking_id def force_production(self, cr, uid, ids, *args): diff --git a/addons/mrp/procurement.py b/addons/mrp/procurement.py index 8bfefc9ceef..50a976c741a 100644 --- a/addons/mrp/procurement.py +++ b/addons/mrp/procurement.py @@ -40,8 +40,11 @@ class procurement_order(osv.osv): """ properties = [x.id for x in procurement.property_ids] bom_id = self.pool.get('mrp.bom')._bom_find(cr, uid, procurement.product_id.id, procurement.product_uom.id, properties) - if not bom_id: + if not bom_id: cr.execute('update procurement_order set message=%s where id=%s', (_('No BoM defined for this product !'), procurement.id)) + for (id, name) in self.name_get(cr, uid, procurement.id): + message = _('Procurement ') + " '" + name + "' "+ _("has an exception.") + _('No BoM defined for this product !') + self.log(cr, uid, id, message) return False return True diff --git a/addons/procurement/procurement.py b/addons/procurement/procurement.py index b716650ed5a..b098d279d78 100644 --- a/addons/procurement/procurement.py +++ b/addons/procurement/procurement.py @@ -331,6 +331,8 @@ class procurement_order(osv.osv): }) move_obj.action_confirm(cr, uid, [id], context=context) self.write(cr, uid, [procurement.id], {'move_id': id, 'close_move': 1}) + message = _('Procurement ') + " '" + procurement.name + "' "+ _("is running.") + self.log(cr, uid, procurement.id, message) self.write(cr, uid, ids, {'state': 'confirmed', 'message': ''}) return True @@ -355,8 +357,10 @@ class procurement_order(osv.osv): if not (procurement.move_id.state in ('done','assigned','cancel')): ok = ok and self.pool.get('stock.move').action_assign(cr, uid, [id]) cr.execute('select count(id) from stock_warehouse_orderpoint where product_id=%s', (procurement.product_id.id,)) - if not cr.fetchone()[0]: + if not cr.fetchone()[0]: cr.execute('update procurement_order set message=%s where id=%s', (_('Not enough stock and no minimum orderpoint rule defined.'), procurement.id)) + message = _('Procurement ') + " '" + procurement.name + "' "+ _("has an exception.") + _('Not enough stock and no minimum orderpoint rule defined.') + self.log(cr, uid, procurement.id, message) return ok def action_produce_assign_service(self, cr, uid, ids, context={}): @@ -434,6 +438,8 @@ class procurement_order(osv.osv): if procurement.move_id: if procurement.close_move and (procurement.move_id.state <> 'done'): move_obj.action_done(cr, uid, [procurement.move_id.id]) + message = _('Procurement ') + " '" + procurement.name + "' "+ _("is done.") + self.log(cr, uid, procurement.id, message) res = self.write(cr, uid, ids, {'state': 'done', 'date_close': time.strftime('%Y-%m-%d')}) wf_service = netsvc.LocalService("workflow") for id in ids: diff --git a/addons/project/project.py b/addons/project/project.py index 169a2043b20..0d62929416e 100644 --- a/addons/project/project.py +++ b/addons/project/project.py @@ -174,6 +174,9 @@ class project(osv.osv): def set_done(self, cr, uid, ids, context=None): self.write(cr, uid, ids, {'state':'close'}, context=context) + for (id, name) in self.name_get(cr, uid, ids): + message = _('Project ') + " '" + name + "' "+ _("is Closed.") + self.log(cr, uid, id, message) return True def set_cancel(self, cr, uid, ids, context=None): @@ -190,6 +193,9 @@ class project(osv.osv): def reset_project(self, cr, uid, ids, context=None): res = self.setActive(cr, uid, ids, value=True, context=context) + for (id, name) in self.name_get(cr, uid, ids): + message = _('Project ') + " '" + name + "' "+ _("is Open.") + self.log(cr, uid, id, message) return res def copy(self, cr, uid, id, default={}, context=None): @@ -434,6 +440,8 @@ class task(osv.osv): elif project.warn_manager: task_id = ids[0] mail_send = True + message = _('Task ') + " '" + task.name + "' "+ _("is Done.") + self.log(cr, uid, task.id, message) self.write(cr, uid, [task.id], {'state': 'done', 'date_end':time.strftime('%Y-%m-%d %H:%M:%S'), 'remaining_hours': 0.0}) for parent_id in task.parent_ids: if parent_id.state in ('pending','draft'): @@ -494,6 +502,8 @@ class task(osv.osv): 'ref_doc1': 'project.task,%d' % task.id, 'ref_doc2': 'project.project,%d' % project.id, }) + message = _('Task ') + " '" + task.name + "' "+ _("is Cancelled.") + self.log(cr, uid, task.id, message) self.write(cr, uid, [task.id], {'state': 'cancelled', 'remaining_hours':0.0}) return True @@ -501,6 +511,8 @@ class task(osv.osv): tasks= self.browse(cr,uid,ids) for t in tasks: self.write(cr, uid, [t.id], {'state': 'open'}) + message = _('Task ') + " '" + t.name + "' "+ _("is Open.") + self.log(cr, uid, t.id, message) return True def do_draft(self, cr, uid, ids, *args): @@ -510,6 +522,9 @@ class task(osv.osv): def do_pending(self, cr, uid, ids, *args): self.write(cr, uid, ids, {'state': 'pending'}) + for (id, name) in self.name_get(cr, uid, ids): + message = _('Task ') + " '" + name + "' "+ _("is Pending.") + self.log(cr, uid, id, message) return True def next_type(self, cr, uid, ids, *args): diff --git a/addons/project/wizard/project_task_delegate.py b/addons/project/wizard/project_task_delegate.py index 30fc02f9ca3..779909273df 100644 --- a/addons/project/wizard/project_task_delegate.py +++ b/addons/project/wizard/project_task_delegate.py @@ -82,12 +82,13 @@ class project_task_delegate(osv.osv_memory): 'prefix': _get_prefix, 'new_task_description': _get_new_desc, 'state': 'pending', - } + } def validate(self, cr, uid, ids, context=None): if context is None: context = {} task_obj = self.pool.get('project.task') + user_obj = self.pool.get('res.users') delegate_data = self.read(cr, uid, ids, context=context)[0] task = task_obj.browse(cr, uid, context['active_id'], context=context) newname = delegate_data['prefix'] or '' @@ -111,6 +112,9 @@ class project_task_delegate(osv.osv_memory): task_obj.do_pending(cr, uid, [task.id]) else: task_obj.do_close(cr, uid, [task.id]) + delegrate_user = user_obj.browse(cr, uid, delegate_data['user_id'], context=context) + message = _('Task ') + " '" + delegate_data['name'] + "' "+ _("is Delegated to User:") +" '"+ delegrate_user.name +"' " + self.log(cr, uid, task.id, message) return {} project_task_delegate() diff --git a/addons/project_issue/project_issue.py b/addons/project_issue/project_issue.py index f13f816b4ca..a67ca004f09 100644 --- a/addons/project_issue/project_issue.py +++ b/addons/project_issue/project_issue.py @@ -52,8 +52,26 @@ class project_issue(osv.osv, crm.crm_case): res = super(project_issue, self).case_open(cr, uid, ids, *args) self.write(cr, uid, ids, {'date_open': time.strftime('%Y-%m-%d %H:%M:%S')}) + for (id, name) in self.name_get(cr, uid, ids): + message = _('Issue ') + " '" + name + "' "+ _("is Open.") + self.log(cr, uid, id, message) return res + def case_close(self, cr, uid, ids, *args): + """ + @param self: The object pointer + @param cr: the current row, from the database cursor, + @param uid: the current user’s ID for security checks, + @param ids: List of case's Ids + @param *args: Give Tuple Value + """ + + res = super(project_issue, self).case_close(cr, uid, ids, *args) + for (id, name) in self.name_get(cr, uid, ids): + message = _('Issue ') + " '" + name + "' "+ _("is Closed.") + self.log(cr, uid, id, message) + return res + def _compute_day(self, cr, uid, ids, fields, args, context=None): if context is None: context = {} @@ -319,6 +337,8 @@ class project_issue(osv.osv, crm.crm_case): if res: vals.update(res) res = self.create(cr, uid, vals, context) + message = _('An Issue created') + " '" + subject + "' " + _("from Mailgate.") + self.log(cr, uid, res, message) self.convert_to_bug(cr, uid, [res], context=context) attachents = msg.get('attachments', []) diff --git a/addons/sale_crm/wizard/crm_make_sale.py b/addons/sale_crm/wizard/crm_make_sale.py index ca0230b1ddf..e54d5d2a374 100644 --- a/addons/sale_crm/wizard/crm_make_sale.py +++ b/addons/sale_crm/wizard/crm_make_sale.py @@ -98,7 +98,7 @@ class crm_make_sale(osv.osv_memory): raise osv.except_osv(_('Data Insufficient!'),_('Customer has no addresses defined!')) vals = { - 'origin': 'CRM-Opportunity:%s' % str(case.id), + 'origin': 'Opportunity:%s' % str(case.id), 'section_id': case.section_id and case.section_id.id or False, 'picking_policy': make.picking_policy, 'shop_id': make.shop_id.id, @@ -129,6 +129,8 @@ class crm_make_sale(osv.osv_memory): case_obj.write(cr, uid, [case.id], {'ref': 'sale.order,%s' % new_id}) new_ids.append(new_id) + message = _('Opportunity ') + " '" + case.name + "' "+ _("is converted to Sales Quotation.") + self.log(cr, uid, case.id, message) if make.close: case_obj.case_close(cr, uid, data) diff --git a/addons/scrum/scrum.py b/addons/scrum/scrum.py index 614ef493e96..d4434968c51 100644 --- a/addons/scrum/scrum.py +++ b/addons/scrum/scrum.py @@ -92,10 +92,16 @@ class scrum_sprint(osv.osv): def button_open(self, cr, uid, ids, context={}): self.write(cr, uid, ids, {'state':'open'}, context=context) + for (id, name) in self.name_get(cr, uid, ids): + message = _('Sprint ') + " '" + name + "' "+ _("is Open.") + self.log(cr, uid, id, message) return True def button_close(self, cr, uid, ids, context={}): self.write(cr, uid, ids, {'state':'done'}, context=context) + for (id, name) in self.name_get(cr, uid, ids): + message = _('Sprint ') + " '" + name + "' "+ _("is Closed.") + self.log(cr, uid, id, message) return True def button_pending(self, cr, uid, ids, context={}): @@ -205,12 +211,17 @@ class scrum_product_backlog(osv.osv): def button_open(self, cr, uid, ids, context={}): self.write(cr, uid, ids, {'state':'open'}, context=context) + for (id, name) in self.name_get(cr, uid, ids): + message = _('Product Backlog ') + " '" + name + "' "+ _("is Open.") + self.log(cr, uid, id, message) return True def button_close(self, cr, uid, ids, context={}): self.write(cr, uid, ids, {'state':'done'}, context=context) for backlog in self.browse(cr, uid, ids, context=context): self.pool.get('project.task').write(cr, uid, [i.id for i in backlog.tasks_id], {'state': 'done'}) + message = _('Product Backlog ') + " '" + backlog.name + "' "+ _("is Closed.") + self.log(cr, uid, backlog.id, message) return True def button_pending(self, cr, uid, ids, context={}): diff --git a/addons/scrum/wizard/scrum_backlog_sprint.py b/addons/scrum/wizard/scrum_backlog_sprint.py index 108e5a48cc3..308ac75795e 100644 --- a/addons/scrum/wizard/scrum_backlog_sprint.py +++ b/addons/scrum/wizard/scrum_backlog_sprint.py @@ -19,6 +19,7 @@ # ############################################################################## from osv import osv, fields +from tools.translate import _ class backlog_sprint_assign(osv.osv_memory): _name = 'backlog.assign.sprint' @@ -35,6 +36,7 @@ class backlog_sprint_assign(osv.osv_memory): def assign_sprint(self, cr, uid, ids, context=None): backlog_obj = self.pool.get('scrum.product.backlog') + sprint_obj = self.pool.get('scrum.sprint') task = self.pool.get('project.task') backlog_ids = [] if context is None: @@ -43,7 +45,7 @@ class backlog_sprint_assign(osv.osv_memory): for backlog in backlog_obj.browse(cr, uid, context['active_ids'], context=context): backlog_ids.append(backlog.id) if data['convert_to_task']: - task.create(cr, uid, { + task_id = task.create(cr, uid, { 'product_backlog_id': backlog.id, 'name': backlog.name, 'description': backlog.note, @@ -52,11 +54,16 @@ class backlog_sprint_assign(osv.osv_memory): 'planned_hours':backlog.expected_hours, 'remaining_hours':backlog.expected_hours, }) + message = _('Product Backlog') + " '" + backlog.name + "' "+ _("is converted into Task %d."%(task_id,)) + self.log(cr, uid, backlog.id, message) if data['state_open'] and backlog.state == "draft": backlog_obj.write(cr, uid, backlog.id, {'state':'open'}) + sprint = sprint_obj.browse(cr, uid, data['sprint_id'], context=context) + message = _('Product Backlog') + " '" + backlog.name + "' "+ _("is assigned sprint:%s"%(sprint.name)) + self.log(cr, uid, backlog.id, message) backlog_obj.write(cr, uid, backlog_ids, {'sprint_id': data['sprint_id']}, context=context) return {} backlog_sprint_assign() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/stock/stock.py b/addons/stock/stock.py index e0ab1101535..d44c327b699 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -1843,7 +1843,9 @@ class stock_move(osv.osv): 'line_id': line, 'ref': move.picking_id and move.picking_id.name, }) - + + message = _('Move line') + " '" + move.name + "' "+ _("is processed.") + self.log(cr, uid, move.id, message) # This can be removed #tracking_lot = False #if context: @@ -1864,7 +1866,7 @@ class stock_move(osv.osv): wf_service.trg_write(uid, 'stock.picking', pick_id, cr) for (id,name) in picking_obj.name_get(cr, uid, picking_ids): - message = _('Document') + " '" + name + "' "+ _("is processed") + message = _('Document') + " '" + name + "' "+ _("is processed.") self.log(cr, uid, id, message) return True @@ -1938,6 +1940,8 @@ class stock_move(osv.osv): new_move = self.copy(cr, uid, move.id, default_val) #self.write(cr, uid, [new_move], {'move_history_ids':[(4,move.id)]}) #TODO : to track scrap moves res += [new_move] + message = _('Product ') + " '" + move.product_id.name + "' "+ _("is scraped with") + " '" + str(move.product_qty) + "' "+ _("quantity.") + self.log(cr, uid, move.id, message) self.action_done(cr, uid, res) return res @@ -2064,6 +2068,8 @@ class stock_move(osv.osv): } self.write(cr, uid, [move.id], update_val) + message = _('Product ') + " '" + move.product_id.name + "' "+ _("is consumed with") + " '" + str(move.product_qty) + "' "+ _("quantity.") + self.log(cr, uid, move.id, message) self.action_done(cr, uid, res) return res @@ -2261,6 +2267,8 @@ class stock_inventory(osv.osv): 'product_qty': line.product_qty }) move_ids.append(self._inventory_line_hook(cr, uid, line, value)) + message = _('Inventory') + " '" + inv.name + "' "+ _("is done.") + self.log(cr, uid, inv.id, message) self.write(cr, uid, [inv.id], {'state': 'done', 'date_done': time.strftime('%Y-%m-%d %H:%M:%S'), 'move_ids': [(6, 0, move_ids)]}) return True From 97da4468fccb9fcc5ff8a6bb85161512c4d10811 Mon Sep 17 00:00:00 2001 From: "ATUL (OpenERP)" <> Date: Thu, 8 Jul 2010 15:50:32 +0530 Subject: [PATCH 02/50] [FIX] idea: yml issue bzr revid: hmo@tinyerp.com-20100708102032-prqb40disa69gy97 --- addons/idea/security/ir.model.access.csv | 1 + addons/idea/test/test_idea.yml | 23 +++++------------------ 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/addons/idea/security/ir.model.access.csv b/addons/idea/security/ir.model.access.csv index ba3b6fe4e3f..f9f665766e1 100644 --- a/addons/idea/security/ir.model.access.csv +++ b/addons/idea/security/ir.model.access.csv @@ -5,3 +5,4 @@ "access_idea_vote_stat","idea.vote.stat","model_idea_vote_stat","base.group_user",1,0,0,0 "access_idea_category_system","idea.category system","model_idea_category","base.group_system",1,1,1,1 "access_idea_comment","idea.comment","model_idea_comment","base.group_system",1,1,1,1 +"access_idea_comment_user","idea.comment","model_idea_comment","base.group_user",1,1,1,0 diff --git a/addons/idea/test/test_idea.yml b/addons/idea/test/test_idea.yml index bcb764f8933..9646222cab4 100644 --- a/addons/idea/test/test_idea.yml +++ b/addons/idea/test/test_idea.yml @@ -44,9 +44,6 @@ !record {model: res.users, id: res_users_user1}: company_id: base.main_company context_lang: en_US - groups_id: - - base.group_system - - base.group_user login: user2 name: user2 password: user2 @@ -54,16 +51,12 @@ - | In order to post vote I connect as user1 and open the idea page I click on "Submit Vote" wizard button and vote the idea as "Normal" -- - !record {model: idea.post.vote, id: idea_post_vote_0}: - vote: 50 -- | - Now I click on "Post" button of this wizard. - !python {model: idea.post.vote}: | - uid = ref('res_users_user0') - self.do_vote(cr, uid, [ref("idea_post_vote_0")], {'active_ids': [ref('idea_idea_0')]}) + uid = ref('res_users_user0') + new_id = self.create(cr, uid, {'vote': 50}, {"active_ids": [ref("idea_idea_0")]}) + self.do_vote(cr, uid, [new_id], {"active_ids": [ref("idea_idea_0")]}) - | To add other vote I connect as user2 and open the idea page. @@ -72,16 +65,11 @@ and put comment "We can learn many things from technical presentation". -- - !record {model: idea.post.vote, id: idea_post_vote_1}: - vote: 100 - note: 'We can learn many things from technical presentation' -- | - I click on "Post" button of this wizard. - !python {model: idea.post.vote}: | uid = ref('res_users_user1') - self.do_vote(cr, uid, [ref("idea_post_vote_1")], {'active_ids': [ref('idea_idea_0')]}) + new_id = self.create(cr, uid, {'vote': 100, 'note': 'We can learn many things from technical presentation'}, {"active_ids": [ref("idea_idea_0")]}) + self.do_vote(cr, uid, [new_id], {'active_ids': [ref('idea_idea_0')]}) - | I can see that the Average score changed in "Average score" field with value 75 @@ -99,4 +87,3 @@ - !assert {model: idea.idea, id: idea_idea_0}: - state == 'close' - From 3fefccfe51519d16c3ee460cbb75f356448e5687 Mon Sep 17 00:00:00 2001 From: "Harry (OpenERP)" Date: Thu, 8 Jul 2010 15:59:52 +0530 Subject: [PATCH 03/50] [FIX] pos: yml issue bzr revid: hmo@tinyerp.com-20100708102952-p891ytnsrukc24pa --- addons/point_of_sale/test/pos_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/point_of_sale/test/pos_test.yml b/addons/point_of_sale/test/pos_test.yml index a96a792c711..360c25b53a5 100644 --- a/addons/point_of_sale/test/pos_test.yml +++ b/addons/point_of_sale/test/pos_test.yml @@ -250,7 +250,7 @@ country_id: base.in partner_id: res_partner_microlinktechnologies0 street: Ash House, Ash Road - title: Ms. + title: base.res_partner_title_miss - I create product category . - From 172cee237a705e8f1ad62d6961a157e25e6197a2 Mon Sep 17 00:00:00 2001 From: "rpa (Open ERP)" Date: Thu, 8 Jul 2010 16:00:27 +0530 Subject: [PATCH 04/50] [REF]: claim_from_delivery: Code improvements bzr revid: rpa@tinyerp.com-20100708103027-at59m943ytmnl5bq --- addons/claim_from_delivery/__init__.py | 1 + addons/claim_from_delivery/__openerp__.py | 3 ++- addons/claim_from_delivery/claim_delivery.py | 6 +++++- .../claim_delivery_view.xml | 18 +++++------------- 4 files changed, 13 insertions(+), 15 deletions(-) diff --git a/addons/claim_from_delivery/__init__.py b/addons/claim_from_delivery/__init__.py index b10828031a8..801c814fdf9 100644 --- a/addons/claim_from_delivery/__init__.py +++ b/addons/claim_from_delivery/__init__.py @@ -18,5 +18,6 @@ # ############################################################################## import claim_delivery + # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/claim_from_delivery/__openerp__.py b/addons/claim_from_delivery/__openerp__.py index 86d357834ff..c530a5605fb 100644 --- a/addons/claim_from_delivery/__openerp__.py +++ b/addons/claim_from_delivery/__openerp__.py @@ -21,7 +21,7 @@ "name" : "Claim from delivery", "version" : "1.0", "author" : "Tiny", - "category" : "Enterprise Specific Modules/Food Industries", + "category" : "Generic Modules/Inventory Control", "depends" : ["base", "crm_claim", "stock"], "init_xml" : [], "demo_xml" : [], @@ -31,5 +31,6 @@ "active": False, "installable": True } + # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/claim_from_delivery/claim_delivery.py b/addons/claim_from_delivery/claim_delivery.py index 4e81a0a3067..67e6f0baae2 100644 --- a/addons/claim_from_delivery/claim_delivery.py +++ b/addons/claim_from_delivery/claim_delivery.py @@ -24,6 +24,10 @@ from osv import fields, osv class stock_picking(osv.osv): _inherit = "stock.picking" _columns = { - 'partner_id': fields.related('address_id','partner_id',type='many2one', relation="res.partner", string="Partner"), + 'partner_id': fields.related('address_id', 'partner_id', type='many2one', relation="res.partner", string="Partner"), } + stock_picking() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + diff --git a/addons/claim_from_delivery/claim_delivery_view.xml b/addons/claim_from_delivery/claim_delivery_view.xml index 7fb68cc6348..d2fe510460d 100644 --- a/addons/claim_from_delivery/claim_delivery_view.xml +++ b/addons/claim_from_delivery/claim_delivery_view.xml @@ -14,19 +14,11 @@ - - - - - {'default_partner_address_id': address_id, 'default_partner_id': partner_id} - + From c7e161dcc5db9dfe4029c3314ba7fab8c555e4fb Mon Sep 17 00:00:00 2001 From: "Harry (OpenERP)" Date: Thu, 8 Jul 2010 16:17:49 +0530 Subject: [PATCH 05/50] [FIX] mrp: small yml issue bzr revid: hmo@tinyerp.com-20100708104749-qsqwr4ic10fjltwu --- addons/mrp/test/mrp_packs.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/addons/mrp/test/mrp_packs.yml b/addons/mrp/test/mrp_packs.yml index 309e3d2b200..ca3453f94e6 100644 --- a/addons/mrp/test/mrp_packs.yml +++ b/addons/mrp/test/mrp_packs.yml @@ -69,7 +69,7 @@ location_dest_id: stock.stock_location_customers location_id: stock.stock_location_stock name: Pack of 24 Beers - product_id: mrp_bom_packofbeers0 + product_id: product_product_packofbeers0 product_qty: 2.0 product_uom: product.product_uom_unit move_type: direct @@ -83,12 +83,12 @@ "active_id": ref("stock.menu_action_picking_tree"), } ) - | - I check that my Picking of a "PAck of 24 beers" as been automatically + I check that my Picking of a "Pack of 24 beers" has been automatically converted to a picking of 24 beers and a pack of beer, so that my stock of beers remains exact. - !assert {model: stock.picking, id: picking_out}: - - len(move_ids) == 2 - - move_ids[0].product_id.id <> move_ids[1].product_id.id - - move_ids[0].product_id.id in (ref('product_product_beers0'), ref('product_product_beerspack0')) - - move_ids[1].product_id.id in (ref('product_product_beers0'), ref('product_product_beerspack0')) + - len(move_lines) == 2 + - move_lines[0].product_id.id <> move_lines[1].product_id.id + - move_lines[0].product_id.id in (ref('product_product_beers0'), ref('product_product_beerspack0')) + - move_lines[1].product_id.id in (ref('product_product_beers0'), ref('product_product_beerspack0')) From 7c4179edd7b9c1ff47ddb6d1801941b5a296c8af Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Thu, 8 Jul 2010 16:18:52 +0530 Subject: [PATCH 06/50] [FIX]:account:Invoice Analysis:residual amount problem bzr revid: apa@tinyerp.com-20100708104852-hanh85h3znag8o01 --- .../account/report/account_invoice_report.py | 16 ++++++++----- .../report/account_invoice_report_view.xml | 24 +++++++++---------- 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/addons/account/report/account_invoice_report.py b/addons/account/report/account_invoice_report.py index c15c2e670e3..b7fb9766bf1 100644 --- a/addons/account/report/account_invoice_report.py +++ b/addons/account/report/account_invoice_report.py @@ -122,17 +122,20 @@ class account_invoice_report(osv.osv): left join account_invoice as a ON (a.move_id=aml.move_id) left join account_invoice_line as l ON (a.id=l.invoice_id) where a.id=ai.id)) as delay_to_pay, - sum(case when ai.type in ('out_refund','in_invoice') then - ai.residual * -1 - else - ai.residual - end) as residual + (case when ai.type in ('out_refund','in_invoice') then + ai.residual * -1 + else + ai.residual + end)/(select count(l.*) from account_invoice_line as l + left join account_invoice as a ON (a.id=l.invoice_id) + where a.id=ai.id) as residual from account_invoice_line as ail left join account_invoice as ai ON (ai.id=ail.invoice_id) left join product_template pt on (pt.id=ail.product_id) left join product_uom u on (u.id=ail.uos_id) group by ail.product_id, ai.date_invoice, + ai.id, to_char(ai.date_invoice, 'YYYY'), to_char(ai.date_invoice, 'MM'), to_char(ai.date_invoice, 'YYYY-MM-DD'), @@ -153,7 +156,8 @@ class account_invoice_report(osv.osv): ai.address_contact_id, ai.address_invoice_id, ai.account_id, - ai.partner_bank + ai.partner_bank, + ai.residual ) """) account_invoice_report() diff --git a/addons/account/report/account_invoice_report_view.xml b/addons/account/report/account_invoice_report_view.xml index b947f9d5f6a..ee9ee498365 100644 --- a/addons/account/report/account_invoice_report_view.xml +++ b/addons/account/report/account_invoice_report_view.xml @@ -32,7 +32,7 @@ - + @@ -93,24 +93,24 @@ - - + + - - + + - - + + - + - + - - - + + + From 226922265836407792050b91ba196d41cb34a9a9 Mon Sep 17 00:00:00 2001 From: Mantavya Gajjar Date: Thu, 8 Jul 2010 16:49:21 +0530 Subject: [PATCH 07/50] [REM]: remove unused class bzr revid: mga@tinyerp.com-20100708111921-ljt97b156qyswfao --- .../account_voucher_payment.py | 20 ++----------------- 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/addons/account_voucher_payment/account_voucher_payment.py b/addons/account_voucher_payment/account_voucher_payment.py index a34a0859bfa..7bad021ba26 100755 --- a/addons/account_voucher_payment/account_voucher_payment.py +++ b/addons/account_voucher_payment/account_voucher_payment.py @@ -196,7 +196,8 @@ class account_voucher_line(osv.osv): residual = currency_pool.compute(cr, uid, invoice.currency_id.id, currency_id, invoice.residual) res.update({ - 'amount': residual + 'amount': residual, + 'account_id': invoice.account_id.id }) return { @@ -231,21 +232,4 @@ class account_voucher_line(osv.osv): } account_voucher_line() -class account_invoice(osv.osv): - _inherit = "account.invoice" - - def action_cancel(self, cr, uid, ids, *args): - res = super(account_invoice, self).action_cancel(cr, uid, ids, *args) - invoices = self.read(cr, uid, ids, ['move_id']) - voucher_db = self.pool.get('account.voucher') - voucher_ids = voucher_db.search(cr, uid, []) - voucher_obj = voucher_db.browse(cr, uid, voucher_ids) - move_db = self.pool.get('account.move') - move_ids = move_db.search(cr, uid, []) - move_obj = move_db.browse(cr, uid, move_ids) - return res - -account_invoice() - - # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: From 522877859d6207de4f2a5a5c5187803bd28ed5d5 Mon Sep 17 00:00:00 2001 From: Mantavya Gajjar Date: Thu, 8 Jul 2010 16:49:50 +0530 Subject: [PATCH 08/50] [IMP]: improve voucher unreconcile process bzr revid: mga@tinyerp.com-20100708111950-6xj9bjjfh5428rt1 --- .../wizard/account_voucher_unreconcile.py | 20 +++++++++++++++++-- .../account_voucher_unreconcile_view.xml | 2 ++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/addons/account_voucher_payment/wizard/account_voucher_unreconcile.py b/addons/account_voucher_payment/wizard/account_voucher_unreconcile.py index f91ee20925f..2bfffb372b7 100644 --- a/addons/account_voucher_payment/wizard/account_voucher_unreconcile.py +++ b/addons/account_voucher_payment/wizard/account_voucher_unreconcile.py @@ -18,19 +18,31 @@ # along with this program. If not, see . # ############################################################################## -from osv import fields, osv + +import netsvc +from osv import osv +from osv import fields class account_voucher_unreconcile(osv.osv_memory): _name = "account.voucher.unreconcile" _description = "Account voucher unreconcile" + _columns = { + 'remove':fields.boolean('Want to remove accounting entries too ?', required=False), + } + + _defaults = { + 'remove': lambda *a: True, + } + def trans_unrec(self, cr, uid, ids, context=None): + res = self.browse(cr, uid, ids[0]) if context is None: context = {} voucher_pool = self.pool.get('account.voucher') reconcile_pool = self.pool.get('account.move.reconcile') if context.get('active_id'): - voucher = obj_voucher.browse(cr, uid, context.get('active_id'), context=context) + voucher = voucher_pool.browse(cr, uid, context.get('active_id'), context) recs = [] for line in voucher.move_ids: if line.reconcile_id: @@ -39,6 +51,10 @@ class account_voucher_unreconcile(osv.osv_memory): for rec in recs: obj_reconcile.unlink(cr, uid, rec) + if res.remove: + wf_service = netsvc.LocalService("workflow") + wf_service.trg_validate(uid, 'account.voucher', context.get('active_id'), 'cancel_voucher', cr) + return {} account_voucher_unreconcile() diff --git a/addons/account_voucher_payment/wizard/account_voucher_unreconcile_view.xml b/addons/account_voucher_payment/wizard/account_voucher_unreconcile_view.xml index 138aaec586f..3f8dd9c4e32 100644 --- a/addons/account_voucher_payment/wizard/account_voucher_unreconcile_view.xml +++ b/addons/account_voucher_payment/wizard/account_voucher_unreconcile_view.xml @@ -11,6 +11,8 @@