Skip to content

Commit

Permalink
[16.0][MIG] - finalize sale_exception migration
Browse files Browse the repository at this point in the history
  • Loading branch information
sbejaoui committed Jan 25, 2023
1 parent 4be9ab6 commit 1a8ad2a
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 19 deletions.
3 changes: 2 additions & 1 deletion sale_exception/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
from . import sale
from . import exception_rule
from . import sale_order
from . import sale_order_line
22 changes: 22 additions & 0 deletions sale_exception/models/exception_rule.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright 2011 Akretion, Sodexis
# Copyright 2018 Akretion
# Copyright 2019 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from odoo import fields, models


class ExceptionRule(models.Model):
_inherit = "exception.rule"

model = fields.Selection(
selection_add=[
("sale.order", "Sale order"),
("sale.order.line", "Sale order line"),
],
ondelete={
"sale.order": "cascade",
"sale.order.line": "cascade",
},
)
sale_ids = fields.Many2many("sale.order", string="Sales")
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,7 @@
# Copyright 2019 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from odoo import api, fields, models


class ExceptionRule(models.Model):
_inherit = "exception.rule"

model = fields.Selection(
selection_add=[
("sale.order", "Sale order"),
("sale.order.line", "Sale order line"),
],
ondelete={
"sale.order": "cascade",
"sale.order.line": "cascade",
},
)
sale_ids = fields.Many2many("sale.order", string="Sales")
from odoo import api, models


class SaleOrder(models.Model):
Expand Down
2 changes: 1 addition & 1 deletion sale_exception/tests/test_multi_records.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html

import mock
from unittest import mock

from odoo.tests import TransactionCase

Expand Down

0 comments on commit 1a8ad2a

Please sign in to comment.