message_update 同message_new,只不过当mail.thread存在时,改执行self.write(update_vals)。 message_post 还有两个近似的方法:message_post_with_view message_post_with_template 在一个已经存在的mail.thread上发送一条新的消息,需要提供message_type等内容。通过message_type控制消息类型,现有包括:email、notification...
self.message_post_with_view( 'my_library.book_return_reminder_qweb', values={'extra_data': 'test'} ) 要管理日期格式、时区和带有货币符号的金额,在Jinja模板中需要使用format_date、format_tz和format_amount函数,而在QWeb模板中则是自动进行管理的。
message_post_with_view(views_or_xmlid, **kwargs): 使用ir.qweb 引擎和一个view_id来显示发送邮件/发布消息的助手方法。这个方法是独立运行的,因为模板和编辑器中没有任何允许批量处理视图的内容。当模板处理ir.ui.view时这个方法可能会消失。 参数 或为ir.ui.view record(str) – 要发送的视图的外部id或...
message_post、message_post_with_template及message_post_with_view均可在用户配置中实现。当用户在配置页面修改了通知方式,用户将无法收到邮件,而是在odoo的通知系统中收到消息提醒。此外,Odoo消息线程遵循一个称为子类型的概念。 子类型仅用于接收您感兴趣的信息的电子邮件。您可以在message_post_*方法中传递额外的...
applicant.job_id.message_post( body=_( 'New Employee %s Hired') % applicant.partner_nameifapplicant.partner_nameelseapplicant.name, subtype="hr_recruitment.mt_job_applicant_hired") applicant.message_post_with_view( 'hr_recruitment.applicant_hired_template', ...
我们的业务逻辑可利用这个消息系统来向用户发送通知。可使用message_post() 方法来发送通知,示例如下: self.message_post('Hello!') 这会添加一个普通文本消息,但不会向follower发送通知。这是因为默认由mail.mt_note子类型发送消息。但我们可以通过指定的子类型来发送消息。要添加一条向follower发送通知的消息,应使...
picking.message_post_with_view('mail.message_origin_link', values={'self': picking, 'origin': order}, subtype_id=self.env.ref('mail.mt_note').id) return True class PurchaseOrderLine(models.Model): _inherit = 'purchase.order.line' move_ids = fields.One2many('stock.move', 'purchase_...
self.message_post('Hello!') 1. 这会添加一个普通文本消息,但不会向follower发送通知。这是因为默认由mail.mt_note子类型发送消息。但我们可以通过指定的子类型来发送消息。要添加一条向follower发送通知的消息,应使用mt_comment子类型。另一个可选属性是消息标题,使用这两项的示例如下: ...
Hi I am traying to add warning when customer have a balance i have used raise UserError("Customer has balance!") it is working but it will block it to create SO i need some thing just a simple warning not blocking any one can help?
--此处代码略--> <record id="estate_property_view_form" model="ir.ui.view"> <field name="name">estate.property.form</field> <field name="model">estate.property</field> <field name="arch" type="xml"> <!--此处代码略--> <field name="message_follower_ids"/> <field name="...