-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IMP] connector_oxigesti: add product attribute fields to export
- Loading branch information
Showing
8 changed files
with
85 additions
and
1 deletion.
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 |
---|---|---|
|
@@ -24,6 +24,7 @@ Contributors | |
|
||
* Eric Antones <[email protected]> | ||
* Kilian Niubo <[email protected]> | ||
* Frank Cespedes <[email protected]> | ||
|
||
|
||
|
||
|
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,3 +1,4 @@ | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) | ||
|
||
from . import common | ||
from . import backend_product_attribute_map |
47 changes: 47 additions & 0 deletions
47
connector_oxigesti/models/oxigesti_backend/backend_product_attribute_map.py
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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Copyright NuoBiT Solutions - Frank Cespedes <[email protected]> | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) | ||
import logging | ||
|
||
from odoo import fields, models | ||
|
||
_logger = logging.getLogger(__name__) | ||
|
||
|
||
class OxigestiBackendProductAttributeMap(models.Model): | ||
_name = "oxigesti.backend.product.attribute.map" | ||
|
||
backend_id = fields.Many2one( | ||
comodel_name="oxigesti.backend", | ||
string="Oxigesti Backend", | ||
ondelete="cascade", | ||
) | ||
|
||
attribute_id = fields.Many2one( | ||
comodel_name="product.attribute", | ||
string="Odoo Product Attribute", | ||
required=True, | ||
ondelete="restrict", | ||
) | ||
|
||
oxigesti_attribute = fields.Char( | ||
string="Oxigesti Attribute", | ||
required=True, | ||
) | ||
|
||
_sql_constraints = [ | ||
( | ||
"uniq", | ||
"unique(backend_id, attribute_id, external_id)", | ||
"Attribute mapping line must be unique", | ||
), | ||
( | ||
"attribute_uniq", | ||
"unique(backend_id, attribute_id)", | ||
"Odoo Attribute used in another map line", | ||
), | ||
( | ||
"external_uniq", | ||
"unique(backend_id, external_id)", | ||
"External ID used in another map line", | ||
), | ||
] |
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
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