mirror of
https://github.com/bringout/oca-ocb-sale.git
synced 2026-04-26 12:12:05 +02:00
Initial commit: Sale packages
This commit is contained in:
commit
14e3d26998
6469 changed files with 2479670 additions and 0 deletions
|
|
@ -0,0 +1,19 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import api, models
|
||||
|
||||
|
||||
class MailComposeMessage(models.TransientModel):
|
||||
_inherit = 'mail.compose.message'
|
||||
|
||||
def _action_send_mail(self, auto_commit=False):
|
||||
context = self._context
|
||||
# Task-2792146: will move to model-based method
|
||||
if context.get('website_sale_send_recovery_email') and self.model == 'sale.order' and context.get('active_ids'):
|
||||
self.env['sale.order'].search([
|
||||
('id', 'in', context.get('active_ids')),
|
||||
('cart_recovery_email_sent', '=', False),
|
||||
('is_abandoned_cart', '=', True)
|
||||
]).write({'cart_recovery_email_sent': True})
|
||||
return super(MailComposeMessage, self)._action_send_mail(auto_commit=auto_commit)
|
||||
Loading…
Add table
Add a link
Reference in a new issue