From 9e067bc26eb63c6a8658a4ab412c636ee3bfdcdc Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Thu, 30 Aug 2012 14:54:43 +0530 Subject: [PATCH 01/34] [IMP] Add demo data of subtype in sale bzr revid: fka@tinyerp.com-20120830092443-4ptms30neaz4xjnv --- addons/sale/sale.py | 10 +++++----- addons/sale/sale_data.xml | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 5 deletions(-) diff --git a/addons/sale/sale.py b/addons/sale/sale.py index c525ba04df1..fdffdf465c9 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -1031,7 +1031,7 @@ class sale_order(osv.osv): def create_send_note(self, cr, uid, ids, context=None): for obj in self.browse(cr, uid, ids, context=context): - self.message_append_note(cr, uid, [obj.id], body=_("Quotation for %s has been created.") % (obj.partner_id.name), context=context) + self.message_append_note(cr, uid, [obj.id], body=_("Quotation for %s has been created.") % (obj.partner_id.name), subtype="new", context=context) def confirm_send_note(self, cr, uid, ids, context=None): for obj in self.browse(cr, uid, ids, context=context): @@ -1039,7 +1039,7 @@ class sale_order(osv.osv): def cancel_send_note(self, cr, uid, ids, context=None): for obj in self.browse(cr, uid, ids, context=context): - self.message_append_note(cr, uid, [obj.id], body=_("Sale Order for %s cancelled.") % (obj.partner_id.name), context=context) + self.message_append_note(cr, uid, [obj.id], body=_("Sale Order for %s cancelled.") % (obj.partner_id.name), subtype="cancel", context=context) def delivery_send_note(self, cr, uid, ids, picking_id, context=None): for order in self.browse(cr, uid, ids, context=context): @@ -1051,15 +1051,15 @@ class sale_order(osv.osv): self.message_append_note(cr, uid, [order.id], body=_("Delivery Order %s scheduled for %s.") % (picking.name, picking_date_str), context=context) def delivery_end_send_note(self, cr, uid, ids, context=None): - self.message_append_note(cr, uid, ids, body=_("Order delivered."), context=context) + self.message_append_note(cr, uid, ids, body=_("Order delivered."), subtype="delivered", context=context) def invoice_paid_send_note(self, cr, uid, ids, context=None): - self.message_append_note(cr, uid, ids, body=_("Invoice paid."), context=context) + self.message_append_note(cr, uid, ids, body=_("Invoice paid."), subtype="paid", context=context) def invoice_send_note(self, cr, uid, ids, invoice_id, context=None): for order in self.browse(cr, uid, ids, context=context): for invoice in (inv for inv in order.invoice_ids if inv.id == invoice_id): - self.message_append_note(cr, uid, [order.id], body=_("Draft Invoice of %s %s waiting for validation.") % (invoice.amount_total, invoice.currency_id.symbol), context=context) + self.message_append_note(cr, uid, [order.id], body=_("Draft Invoice of %s %s waiting for validation.") % (invoice.amount_total, invoice.currency_id.symbol), subtype="pending", context=context) def action_cancel_draft_send_note(self, cr, uid, ids, context=None): return self.message_append_note(cr, uid, ids, body='Sale order has been set in draft.', context=context) diff --git a/addons/sale/sale_data.xml b/addons/sale/sale_data.xml index bbee9ca7455..974b3dd4490 100644 --- a/addons/sale/sale_data.xml +++ b/addons/sale/sale_data.xml @@ -49,5 +49,38 @@ If you need to manage your sales pipeline (leads, opportunities, phonecalls), you can install the module <i>CRM</i> from the top menu Settings. + + + new + + + + + cancel + + + + + paid + + + + pending + + + + + delivered + + + + + + + + + + + From 1e6099d7136739d3ba415968e5cc6461c6179961 Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Thu, 30 Aug 2012 17:00:37 +0530 Subject: [PATCH 02/34] [IMP] Add data of subtype in purchase & purchase_requisition bzr revid: fka@tinyerp.com-20120830113037-7t4raly1gf4a3uoh --- addons/purchase/purchase.py | 10 +++--- addons/purchase/purchase_data.xml | 32 +++++++++++++++++++ .../purchase_requisition.py | 8 ++--- .../purchase_requisition_data.xml | 19 +++++++++++ 4 files changed, 60 insertions(+), 9 deletions(-) diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index 756016d39e2..1dfcc8a3f46 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -744,7 +744,7 @@ class purchase_order(osv.osv): return res + ['validator'] def create_send_note(self, cr, uid, ids, context=None): - return self.message_append_note(cr, uid, ids, body=_("Request for quotation created."), context=context) + return self.message_append_note(cr, uid, ids, body=_("Request for quotation created."), subtype="new", context=context) def confirm_send_note(self, cr, uid, ids, context=None): for obj in self.browse(cr, uid, ids, context=context): @@ -762,20 +762,20 @@ class purchase_order(osv.osv): def invoice_send_note(self, cr, uid, ids, invoice_id, context=None): for order in self.browse(cr, uid, ids, context=context): for invoice in (inv for inv in order.invoice_ids if inv.id == invoice_id): - self.message_append_note(cr, uid, [order.id], body=_("Draft Invoice of %s %s is waiting for validation.") % (invoice.amount_total, invoice.currency_id.symbol), context=context) + self.message_append_note(cr, uid, [order.id], body=_("Draft Invoice of %s %s is waiting for validation.") % (invoice.amount_total, invoice.currency_id.symbol), subtype="pending", context=context) def shipment_done_send_note(self, cr, uid, ids, context=None): - self.message_append_note(cr, uid, ids, body=_("""Shipment received."""), context=context) + self.message_append_note(cr, uid, ids, body=_("""Shipment received."""), subtype="received", context=context) def invoice_done_send_note(self, cr, uid, ids, context=None): - self.message_append_note(cr, uid, ids, body=_("Invoice paid."), context=context) + self.message_append_note(cr, uid, ids, body=_("Invoice paid."), subtype="paid", context=context) def draft_send_note(self, cr, uid, ids, context=None): return self.message_append_note(cr, uid, ids, body=_("Purchase Order has been set to draft."), context=context) def cancel_send_note(self, cr, uid, ids, context=None): for obj in self.browse(cr, uid, ids, context=context): - self.message_append_note(cr, uid, [obj.id], body=_("Purchase Order for %s cancelled.") % (obj.partner_id.name), context=context) + self.message_append_note(cr, uid, [obj.id], body=_("Purchase Order for %s cancelled.") % (obj.partner_id.name), subtype="cancel", context=context) purchase_order() diff --git a/addons/purchase/purchase_data.xml b/addons/purchase/purchase_data.xml index 75074d4cedf..41ff7dd59ac 100644 --- a/addons/purchase/purchase_data.xml +++ b/addons/purchase/purchase_data.xml @@ -48,5 +48,37 @@ You can also manage purchase requisitions, see the Purchase Settings. model="ir.values" name="set"/> + + new + + + + + paid + + + + pending + + + + + received + + + + cancel + + + + + + + + + + + + diff --git a/addons/purchase_requisition/purchase_requisition.py b/addons/purchase_requisition/purchase_requisition.py index cf0294730a7..084701ff52e 100644 --- a/addons/purchase_requisition/purchase_requisition.py +++ b/addons/purchase_requisition/purchase_requisition.py @@ -94,13 +94,13 @@ class purchase_requisition(osv.osv): self.message_append_note(cr, uid, ids, body=_("Draft Requisition has been sent to suppliers."), context=context) def reset_send_note(self, cr, uid, ids, context=None): - self.message_append_note(cr, uid, ids, body=_("Purchase Requisition has been set to draft."), context=context) + self.message_append_note(cr, uid, ids, body=_("Purchase Requisition has been set to draft."), subtype="new", context=context) def done_to_send_note(self, cr, uid, ids, context=None): - self.message_append_note(cr, uid, ids, body=_("Purchase Requisition has been done."), context=context) + self.message_append_note(cr, uid, ids, body=_("Purchase Requisition has been done."), subtype="close", context=context) def cancel_send_note(self, cr, uid, ids, context=None): - self.message_append_note(cr, uid, ids, body=_("Purchase Requisition has been cancelled."), context=context) + self.message_append_note(cr, uid, ids, body=_("Purchase Requisition has been cancelled."), subtype="cancel", context=context) def _planned_date(self, requisition, delay=0.0): company = requisition.company_id @@ -184,7 +184,7 @@ class purchase_requisition(osv.osv): return res def create_send_note(self, cr, uid, ids, context=None): - return self.message_append_note(cr, uid, ids, body=_("Purchase Requisition has been created."), context=context) + return self.message_append_note(cr, uid, ids, body=_("Purchase Requisition has been created."), subtype="new", context=context) def create(self, cr, uid, vals, context=None): requisition = super(purchase_requisition, self).create(cr, uid, vals, context=context) diff --git a/addons/purchase_requisition/purchase_requisition_data.xml b/addons/purchase_requisition/purchase_requisition_data.xml index 98591535f91..211f51374dd 100644 --- a/addons/purchase_requisition/purchase_requisition_data.xml +++ b/addons/purchase_requisition/purchase_requisition_data.xml @@ -6,5 +6,24 @@ id="purchase_default_set" model="ir.values" name="set"/> + + close + + + + + + + + + + + + + + + + + \ No newline at end of file From 1dd00e9116a1b37469a97064ce74f0e75c904aff Mon Sep 17 00:00:00 2001 From: "Randhir Mayatra (OpenERP)" Date: Thu, 30 Aug 2012 18:19:47 +0530 Subject: [PATCH 03/34] [IMP]Add data of the subtype in accouting modules bzr revid: rma@tinyerp.com-20120830124947-xxkah5za90oa5tuy --- addons/account/account_invoice.py | 6 ++--- addons/account/data/account_data.xml | 26 ++++++++++++++++--- addons/account_voucher/account_voucher.py | 6 ++--- .../account_voucher/account_voucher_data.xml | 23 ++++++++++++++++ addons/analytic/analytic.py | 2 +- 5 files changed, 53 insertions(+), 10 deletions(-) diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index 7bc9ceaaf61..57606ba46fb 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -1297,15 +1297,15 @@ class account_invoice(osv.osv): def create_send_note(self, cr, uid, ids, context=None): for obj in self.browse(cr, uid, ids, context=context): - self.message_append_note(cr, uid, [obj.id],body=_("%s created.") % (self._get_document_type(obj.type)), context=context) + self.message_append_note(cr, uid, [obj.id],body=_("%s created.") % (self._get_document_type(obj.type)), subtype="new", context=context) def confirm_paid_send_note(self, cr, uid, ids, context=None): for obj in self.browse(cr, uid, ids, context=context): - self.message_append_note(cr, uid, [obj.id], body=_("%s paid.") % (self._get_document_type(obj.type)), context=context) + self.message_append_note(cr, uid, [obj.id], body=_("%s paid.") % (self._get_document_type(obj.type)), subtype="paid", context=context) def invoice_cancel_send_note(self, cr, uid, ids, context=None): for obj in self.browse(cr, uid, ids, context=context): - self.message_append_note(cr, uid, [obj.id], body=_("%s cancelled.") % (self._get_document_type(obj.type)), context=context) + self.message_append_note(cr, uid, [obj.id], body=_("%s cancelled.") % (self._get_document_type(obj.type)), subtype="cancel", context=context) account_invoice() diff --git a/addons/account/data/account_data.xml b/addons/account/data/account_data.xml index e8899d0348a..589683055d8 100644 --- a/addons/account/data/account_data.xml +++ b/addons/account/data/account_data.xml @@ -563,8 +563,28 @@ Invoice account.invoice - - - + + new + + + + + paid + + + + cancel + + + + + + + + + + + + diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index 223705af85e..ee57368e509 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -1293,17 +1293,17 @@ class account_voucher(osv.osv): def create_send_note(self, cr, uid, ids, context=None): for obj in self.browse(cr, uid, ids, context=context): message = "%s created." % self._document_type[obj.type or False] - self.message_append_note(cr, uid, [obj.id], body=message, context=context) + self.message_append_note(cr, uid, [obj.id], body=message, subtype="new", context=context) def post_send_note(self, cr, uid, ids, context=None): for obj in self.browse(cr, uid, ids, context=context): message = "%s '%s' is posted." % (self._document_type[obj.type or False], obj.move_id.name) - self.message_append_note(cr, uid, [obj.id], body=message, context=context) + self.message_append_note(cr, uid, [obj.id], body=message, subtype="post", context=context) def reconcile_send_note(self, cr, uid, ids, context=None): for obj in self.browse(cr, uid, ids, context=context): message = "%s reconciled." % self._document_type[obj.type or False] - self.message_append_note(cr, uid, [obj.id], body=message, context=context) + self.message_append_note(cr, uid, [obj.id], body=message, subtype="reconcile", context=context) account_voucher() diff --git a/addons/account_voucher/account_voucher_data.xml b/addons/account_voucher/account_voucher_data.xml index 8be2851a434..76e4d7b1849 100644 --- a/addons/account_voucher/account_voucher_data.xml +++ b/addons/account_voucher/account_voucher_data.xml @@ -12,5 +12,28 @@ You can track customer payments easily and automate the reminders. You get an ov If you want to use advanced accounting features, you should install the "Accounting and Finance" module. + + + + + + post + + + + + reconcile + + + + + + + + + + + + diff --git a/addons/analytic/analytic.py b/addons/analytic/analytic.py index 7eeb9266e47..60d2731fe9d 100644 --- a/addons/analytic/analytic.py +++ b/addons/analytic/analytic.py @@ -297,7 +297,7 @@ class account_analytic_account(osv.osv): def create_send_note(self, cr, uid, ids, context=None): for obj in self.browse(cr, uid, ids, context=context): - self.message_append_note(cr, uid, [obj.id], body=_("Contract for %s has been created.") % (obj.partner_id.name), context=context) + self.message_append_note(cr, uid, [obj.id], body=_("Contract for %s has been created.") % (obj.partner_id.name), subtype="new", context=context) account_analytic_account() From 6e8660a776fdf582535776eb5b199cd256822961 Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Fri, 31 Aug 2012 12:05:24 +0530 Subject: [PATCH 04/34] [IMP] Add data of subtype in idea bzr revid: fka@tinyerp.com-20120831063524-bnvxkie4tgsjxjsq --- addons/idea/idea.py | 8 ++++---- addons/idea/idea_data.xml | 29 +++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/addons/idea/idea.py b/addons/idea/idea.py index e2e5ec50ddf..a20ddf51414 100644 --- a/addons/idea/idea.py +++ b/addons/idea/idea.py @@ -67,21 +67,21 @@ class idea_idea(osv.osv): def idea_cancel(self, cr, uid, ids, context={}): self.write(cr, uid, ids, { 'state': 'cancel' }) - self.message_post(cr, uid, ids, body=_('Idea canceled.'), context=context) + self.message_post(cr, uid, ids, body=_('Idea canceled.'), subtype="cancel", context=context) return True def idea_open(self, cr, uid, ids, context={}): self.write(cr, uid, ids, { 'state': 'open'}) - self.message_post(cr, uid, ids, body=_('Idea accepted.'), context=context) + self.message_post(cr, uid, ids, body=_('Idea accepted.'), subtype="open", context=context) return True def idea_close(self, cr, uid, ids, context={}): - self.message_post(cr, uid, ids, body=_('Idea done.'), context=context) + self.message_post(cr, uid, ids, body=_('Idea done.'), subtype="close", context=context) self.write(cr, uid, ids, { 'state': 'close' }) return True def idea_draft(self, cr, uid, ids, context={}): - self.message_post(cr, uid, ids, body=_('Idea reset to draft.'), context=context) + self.message_post(cr, uid, ids, body=_('Idea reset to draft.'), subtype="new", context=context) self.write(cr, uid, ids, { 'state': 'draft' }) return True idea_idea() diff --git a/addons/idea/idea_data.xml b/addons/idea/idea_data.xml index d63eb907ef8..a4cd4970511 100644 --- a/addons/idea/idea_data.xml +++ b/addons/idea/idea_data.xml @@ -15,6 +15,35 @@ + + + + new + + + + + open + + + + cancel + + + + + close + + + + + + + + + + + From 40339ae0258c73906d7d3f2a951c6d5aad7ceb89 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Fri, 31 Aug 2012 09:55:05 +0200 Subject: [PATCH 05/34] [IMP] boms on products bzr revid: fp@tinyerp.com-20120831075505-n3478j5h7jqsu72j --- addons/mrp/mrp_view.xml | 1 - addons/mrp/product.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/mrp/mrp_view.xml b/addons/mrp/mrp_view.xml index 99c8befbb6c..a785d022b53 100644 --- a/addons/mrp/mrp_view.xml +++ b/addons/mrp/mrp_view.xml @@ -1006,7 +1006,6 @@ - diff --git a/addons/mrp/product.py b/addons/mrp/product.py index 1bc3bb749ce..c6cd4a7f51c 100644 --- a/addons/mrp/product.py +++ b/addons/mrp/product.py @@ -26,7 +26,7 @@ from tools.translate import _ class product_product(osv.osv): _inherit = "product.product" _columns = { - "bom_ids": fields.one2many('mrp.bom', 'product_id','Bill of Materials'), + "bom_ids": fields.one2many('mrp.bom', 'product_id','Bill of Materials', [('bom_id','=',False)]), } def copy(self, cr, uid, id, default=None, context=None): if not default: From 39ed85c18dc3b3226ddc62ed73391fce714d2d9a Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Fri, 31 Aug 2012 10:39:09 +0200 Subject: [PATCH 06/34] fix bzr revid: fp@tinyerp.com-20120831083909-suttma1sjdz7uu0m --- .../account_analytic_analysis_view.xml | 1 - addons/mrp/mrp_view.xml | 55 ++++++++----------- addons/mrp/product.py | 2 +- addons/procurement/procurement_view.xml | 41 +++++--------- addons/product/product_view.xml | 2 + 5 files changed, 40 insertions(+), 61 deletions(-) diff --git a/addons/account_analytic_analysis/account_analytic_analysis_view.xml b/addons/account_analytic_analysis/account_analytic_analysis_view.xml index 8f051b33bf9..63a8e6c7add 100644 --- a/addons/account_analytic_analysis/account_analytic_analysis_view.xml +++ b/addons/account_analytic_analysis/account_analytic_analysis_view.xml @@ -23,7 +23,6 @@ - + product.normal.form.mrp.inherit product.product - - - - - - - - product.normal.form.mrp.inherit - product.product - - - - - - - - - - - - -
- - - - - - - - -
+ + +
@@ -1078,5 +1050,24 @@ id="menu_mrp_production_order_action" name="Orders Planning" parent="menu_mrp_planning" sequence="1"/> + + + {'default_product_id': active_id, 'search_default_product_id': active_id} + Bill of Materials + mrp.bom + + + + product.product.procurement + product.product + + + +