[IMP] Add data of subtype in purchase & purchase_requisition
bzr revid: fka@tinyerp.com-20120830113037-7t4raly1gf4a3uoh
This commit is contained in:
parent
253325f488
commit
1e6099d713
|
@ -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 <b>created</b>."), context=context)
|
||||
return self.message_append_note(cr, uid, ids, body=_("Request for quotation <b>created</b>."), 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 <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 is <b>waiting for validation</b>.") % (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 <b>received</b>."""), context=context)
|
||||
self.message_append_note(cr, uid, ids, body=_("""Shipment <b>received</b>."""), subtype="received", context=context)
|
||||
|
||||
def invoice_done_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 draft_send_note(self, cr, uid, ids, context=None):
|
||||
return self.message_append_note(cr, uid, ids, body=_("Purchase Order has been set to <b>draft</b>."), 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 <em>%s</em> <b>cancelled</b>.") % (obj.partner_id.name), context=context)
|
||||
self.message_append_note(cr, uid, [obj.id], body=_("Purchase Order for <em>%s</em> <b>cancelled</b>.") % (obj.partner_id.name), subtype="cancel", context=context)
|
||||
|
||||
purchase_order()
|
||||
|
||||
|
|
|
@ -48,5 +48,37 @@ You can also manage purchase requisitions, see the Purchase Settings.</value>
|
|||
model="ir.values"
|
||||
name="set"/>
|
||||
|
||||
<record id="mail.mail_subtype_new" model="mail.message.subtype">
|
||||
<field name="name">new</field>
|
||||
<field name="model_ids" eval="[(4,ref('purchase.model_purchase_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('purchase.model_purchase_order'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_pending" model="mail.message.subtype">
|
||||
<field name="name">pending</field>
|
||||
<field name="model_ids" eval="[(4,ref('purchase.model_purchase_order'))]"/>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_received" model="mail.message.subtype">
|
||||
<field name="name">received</field>
|
||||
<field name="model_ids" eval="[(4,ref('purchase.model_purchase_order'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_cancel" model="mail.message.subtype">
|
||||
<field name="name">cancel</field>
|
||||
<field name="model_ids" eval="[(4,ref('purchase.model_purchase_order'))]"/>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_email" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('purchase.model_purchase_order'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_comment" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('purchase.model_purchase_order'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_other" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('purchase.model_purchase_order'))]"/>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -94,13 +94,13 @@ class purchase_requisition(osv.osv):
|
|||
self.message_append_note(cr, uid, ids, body=_("Draft Requisition has been <b>sent to suppliers</b>."), 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 <b>draft</b>."), context=context)
|
||||
self.message_append_note(cr, uid, ids, body=_("Purchase Requisition has been set to <b>draft</b>."), 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 <b>done</b>."), context=context)
|
||||
self.message_append_note(cr, uid, ids, body=_("Purchase Requisition has been <b>done</b>."), 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 <b>cancelled</b>."), context=context)
|
||||
self.message_append_note(cr, uid, ids, body=_("Purchase Requisition has been <b>cancelled</b>."), 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 <b>created</b>."), context=context)
|
||||
return self.message_append_note(cr, uid, ids, body=_("Purchase Requisition has been <b>created</b>."), subtype="new", context=context)
|
||||
|
||||
def create(self, cr, uid, vals, context=None):
|
||||
requisition = super(purchase_requisition, self).create(cr, uid, vals, context=context)
|
||||
|
|
|
@ -6,5 +6,24 @@
|
|||
id="purchase_default_set"
|
||||
model="ir.values"
|
||||
name="set"/>
|
||||
<record id="mail.mail_subtype_close" model="mail.message.subtype">
|
||||
<field name="name">close</field>
|
||||
<field name="model_ids" eval="[(4,ref('purchase_requisition.model_purchase_requisition'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_new" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('purchase_requisition.model_purchase_requisition'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_cancel" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('purchase_requisition.model_purchase_requisition'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_email" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('purchase_requisition.model_purchase_requisition'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_comment" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('purchase_requisition.model_purchase_requisition'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_other" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('purchase_requisition.model_purchase_requisition'))]"/>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
Loading…
Reference in New Issue