Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OD-1773 Klaviyo email events for the Customer RMA operations #2

Open
wants to merge 1 commit into
base: 12.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions rma_sale/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
from . import rma_order_line
from . import rma_order
from . import rma_operation
from . import stock_rule
19 changes: 19 additions & 0 deletions rma_sale/models/stock_rule.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html)

from odoo import models


class StockRule(models.Model):
_inherit = 'stock.rule'

def _get_stock_move_values(self, product_id, product_qty, product_uom,
location_id, name, origin, values, group_id):
""" Pass sale line if defined """
res = super()._get_stock_move_values(
product_id, product_qty, product_uom, location_id, name, origin, values, group_id
)
if 'rma_line_id' in values:
line = self.env['rma.order.line'].browse(values.get('rma_line_id'))
if line.sale_line_id:
res['sale_line_id'] = line.sale_line_id.id
return res