-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IMP] stop checking origin of SO with origin name
- Loading branch information
1 parent
295dec2
commit 8c2d415
Showing
2 changed files
with
5 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,13 @@ | ||
# Copyright 2018 ACSONE SA/NV | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import _, models | ||
from odoo.exceptions import UserError | ||
from odoo import models | ||
|
||
|
||
class ContractContract(models.Model): | ||
_inherit = "contract.contract" | ||
|
||
def _recurring_create_sale(self, date_ref=False): | ||
res = super()._recurring_create_sale(date_ref) | ||
res.created_from_contract = True | ||
def _prepare_recurring_sales_values(self, date_ref=False): | ||
res = super()._prepare_recurring_sales_values(date_ref) | ||
res[0]["created_from_contract"] = True | ||
return res | ||
|
||
def write(self, vals): | ||
if "name" in vals and self.generation_type == "sale": | ||
raise UserError( | ||
_( | ||
"Contracts generating sales should not be renamed. " | ||
"In case this contracts contains a product-generating " | ||
"contract, this will cause a loop of contract creation." | ||
) | ||
) | ||
return super().write(vals) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters