Foram Katharotiya (OpenERP) has proposed merging
lp:~openerp-dev/openobject-addons/trunk-message-sub-type-apa-sale_demo-fka into
lp:~openerp-dev/openobject-addons/trunk-message-sub-type-apa.
Requested reviews:
Amit Patel (OpenERP) (apa-tiny)
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-message-sub-type-apa-sale_demo-fka/+merge/122018
Hello Sir,
Add demo data of subtype in sale
Thanks,
FKA
--
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-message-sub-type-apa-sale_demo-fka/+merge/122018
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-addons/trunk-message-sub-type-apa.
=== modified file 'sale/sale.py'
--- sale/sale.py 2012-08-29 09:48:28 +0000
+++ sale/sale.py 2012-08-30 09:32:45 +0000
@@ -1031,7 +1031,7 @@
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 <em>%s</em> has been <b>created</b>.") % (obj.partner_id.name), context=context)
+ self.message_append_note(cr, uid, [obj.id], body=_("Quotation for <em>%s</em> has been <b>created</b>.") % (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 @@
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 <em>%s</em> <b>cancelled</b>.") % (obj.partner_id.name), context=context)
+ self.message_append_note(cr, uid, [obj.id], body=_("Sale Order for <em>%s</em> <b>cancelled</b>.") % (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 @@
self.message_append_note(cr, uid, [order.id], body=_("Delivery Order <em>%s</em> <b>scheduled</b> 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 <b>delivered</b>."), context=context)
+ self.message_append_note(cr, uid, ids, body=_("Order <b>delivered</b>."), subtype="delivered", context=context)
def invoice_paid_send_note(self, cr, uid, ids, context=None):
- self.message_append_note(cr, uid, ids, body=_("Invoice <b>paid</b>."), context=context)
+ self.message_append_note(cr, uid, ids, body=_("Invoice <b>paid</b>."), 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 <b>waiting for validation</b>.") % (invoice.amount_total, invoice.currency_id.symbol), context=context)
+ self.message_append_note(cr, uid, [order.id], body=_("Draft Invoice of %s %s <b>waiting for validation</b>.") % (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)
=== modified file 'sale/sale_data.xml'
--- sale/sale_data.xml 2012-08-13 05:14:11 +0000
+++ sale/sale_data.xml 2012-08-30 09:32:45 +0000
@@ -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.</value>
</function>
+
+ <record id="mail.mail_subtype_new" model="mail.message.subtype">
+ <field name="name">new</field>
+ <field name="model_ids" eval="[(4,ref('sale.model_sale_order'))]"/>
+ <field name="default" eval="False"/>
+ </record>
+ <record id="mail.mail_subtype_cancel" model="mail.message.subtype">
+ <field name="name">cancel</field>
+ <field name="model_ids" eval="[(4,ref('sale.model_sale_order'))]"/>
+ <field name="default" eval="False"/>
+ </record>
+ <record id="mail.mail_subtype_paid" model="mail.message.subtype">
+ <field name="name">paid</field>
+ <field name="model_ids" eval="[(4,ref('sale.model_sale_order'))]"/>
+ </record>
+ <record id="mail.mail_subtype_pending" model="mail.message.subtype">
+ <field name="name">pending</field>
+ <field name="model_ids" eval="[(4,ref('sale.model_sale_order'))]"/>
+ <field name="default" eval="False"/>
+ </record>
+ <record id="mail.mail_subtype_delivered" model="mail.message.subtype">
+ <field name="name">delivered</field>
+ <field name="model_ids" eval="[(4,ref('sale.model_sale_order'))]"/>
+ </record>
+ <record id="mail.mail_subtype_email" model="mail.message.subtype">
+ <field name="model_ids" eval="[(4,ref('sale.model_sale_order'))]"/>
+ </record>
+ <record id="mail.mail_subtype_comment" model="mail.message.subtype">
+ <field name="model_ids" eval="[(4,ref('sale.model_sale_order'))]"/>
+ </record>
+ <record id="mail.mail_subtype_other" model="mail.message.subtype">
+ <field name="model_ids" eval="[(4,ref('sale.model_sale_order'))]"/>
+ </record>
</data>
</openerp>
_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help : https://help.launchpad.net/ListHelp