-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX] use datamodel instead of extendable_pydantic in order to keep p…
…ydantic<2
- Loading branch information
Clément Mombereau
committed
Feb 5, 2025
1 parent
57a3cfe
commit 7d12437
Showing
15 changed files
with
150 additions
and
84 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,3 +1,2 @@ | ||
# generated from manifests external_dependencies | ||
extendable_pydantic | ||
marshmallow_objects |
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,2 +1,3 @@ | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) | ||
from . import models | ||
from . import datamodels |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from . import sale_order_line | ||
from . import sale_order_invoice | ||
from . import sale_order_amount | ||
from . import sale_order_address | ||
from . import sale_order_customer | ||
from . import sale_order | ||
from . import sale_order_payment |
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,19 @@ | ||
# Copyright (c) Akretion 2020 | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) | ||
from odoo.addons.datamodel import fields | ||
from odoo.addons.datamodel.core import Datamodel | ||
|
||
|
||
class SaleOrderDatamodel(Datamodel): | ||
_name = "sale.order" | ||
|
||
name = fields.Str(required=True) | ||
address_customer = fields.NestedModel("sale.order.customer", required=True) | ||
address_shipping = fields.NestedModel("sale.order.address", required=True) | ||
address_invoicing = fields.NestedModel("sale.order.address", required=True) | ||
lines = fields.NestedModel("sale.order.line", many=True, required=True) | ||
amount = fields.NestedModel("sale.order.amount") | ||
invoice = fields.NestedModel("sale.order.invoice") | ||
payment = fields.NestedModel("sale.order.payment") | ||
pricelist_id = fields.Integer() | ||
date_order = fields.Date() |
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,20 @@ | ||
# Copyright (c) Akretion 2020 | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) | ||
|
||
from odoo.addons.datamodel import fields | ||
from odoo.addons.datamodel.core import Datamodel | ||
|
||
|
||
class SaleOrderAddressDatamodel(Datamodel): | ||
_name = "sale.order.address" | ||
|
||
name = fields.Str(required=True) | ||
street = fields.Str(required=True) | ||
street2 = fields.Str(allow_none=True) | ||
zip = fields.Str(required=True) | ||
city = fields.Str(required=True) | ||
email = fields.Email() | ||
state_code = fields.Str() | ||
country_code = fields.Str(required=True) | ||
phone = fields.Str() | ||
mobile = fields.Str() |
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,12 @@ | ||
# Copyright (c) Akretion 2020 | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) | ||
from odoo.addons.datamodel import fields | ||
from odoo.addons.datamodel.core import Datamodel | ||
|
||
|
||
class SaleOrderAmountDatamodel(Datamodel): | ||
_name = "sale.order.amount" | ||
|
||
amount_tax = fields.Decimal() | ||
amount_untaxed = fields.Decimal() | ||
amount_total = fields.Decimal() |
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,12 @@ | ||
# Copyright (c) Akretion 2020 | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) | ||
|
||
from odoo.addons.datamodel import fields | ||
from odoo.addons.datamodel.core import Datamodel | ||
|
||
|
||
class SaleOrderCustomerDatamodel(Datamodel): | ||
_inherit = "sale.order.address" | ||
_name = "sale.order.customer" | ||
|
||
external_id = fields.Str(required=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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Copyright (c) Akretion 2020 | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) | ||
from odoo.addons.datamodel import fields | ||
from odoo.addons.datamodel.core import Datamodel | ||
|
||
|
||
class SaleOrderInvoiceDatamodel(Datamodel): | ||
_name = "sale.order.invoice" | ||
|
||
date = fields.Date(required=True) | ||
number = fields.Str(required=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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Copyright (c) Akretion 2020 | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) | ||
|
||
from odoo.addons.datamodel import fields | ||
from odoo.addons.datamodel.core import Datamodel | ||
|
||
|
||
class SaleOrderLineDatamodel(Datamodel): | ||
_name = "sale.order.line" | ||
|
||
product_code = fields.Str(required=True) | ||
qty = fields.Decimal(required=True) | ||
price_unit = fields.Decimal(required=True) | ||
description = fields.Str() | ||
discount = fields.Decimal() |
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,15 @@ | ||
# Copyright (c) Akretion 2020 | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) | ||
|
||
from odoo.addons.datamodel import fields | ||
from odoo.addons.datamodel.core import Datamodel | ||
|
||
|
||
class SaleOrderPaymentDatamodel(Datamodel): | ||
_name = "sale.order.payment" | ||
|
||
mode = fields.Str(required=True) | ||
amount = fields.Decimal(required=True) | ||
reference = fields.Str(required=True) | ||
currency_code = fields.Str(required=True) | ||
acquirer_reference = fields.Str() |
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 was deleted.
Oops, something went wrong.
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