-
-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MIG] product_harmonized_system to v15
TT36971
- Loading branch information
1 parent
c704683
commit 8badb4a
Showing
11 changed files
with
72 additions
and
170 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,34 +1,10 @@ | ||
# Copyright 2010-2021 Akretion France (http://www.akretion.com/) | ||
# @author: <alexis.delattre@akretion.com> | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
# Copyright 2017-2021 Camptocamp SA | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
from odoo import _, api, fields, models | ||
from odoo.exceptions import ValidationError | ||
from odoo import fields, models | ||
|
||
|
||
class ProductTemplate(models.Model): | ||
_inherit = "product.template" | ||
|
||
is_accessory_cost = fields.Boolean( | ||
help="Activate this option for shipping costs, packaging " | ||
"costs and all services related to the sale of products. " | ||
"This option is used for Intrastat reports.", | ||
) | ||
|
||
@api.constrains("type", "is_accessory_cost") | ||
def _check_accessory_cost(self): | ||
for this in self: | ||
if this.is_accessory_cost and this.type != "service": | ||
raise ValidationError( | ||
_( | ||
"The option 'Is accessory cost?' should only be " | ||
"activated on 'Service' products. You have activated " | ||
"this option for the product '{product_name}' which is " | ||
"configured with type '{product_type}'." | ||
).format( | ||
product_name=this.display_name, | ||
product_type=this._fields["type"].convert_to_export( | ||
this.type, this | ||
), | ||
) | ||
) | ||
hs_code = fields.Char(related="hs_code_id.hs_code", store=True) |
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
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
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
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
45 changes: 0 additions & 45 deletions
45
product_harmonized_system/migrations/14.0.2.0.0/post-migration.py
This file was deleted.
Oops, something went wrong.
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
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
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
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
Oops, something went wrong.