-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ADD] shopinvader_customer_invoicing_mode
- Loading branch information
1 parent
b0881a9
commit 595766b
Showing
11 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
setup/shopinvader_customer_invoicing_mode/odoo/addons/shopinvader_customer_invoicing_mode
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 @@ | ||
../../../../shopinvader_customer_invoicing_mode |
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,6 @@ | ||
import setuptools | ||
|
||
setuptools.setup( | ||
setup_requires=['setuptools-odoo'], | ||
odoo_addon=True, | ||
) |
Empty file.
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 @@ | ||
from . import services |
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,14 @@ | ||
# Copyright 2021 Camptocamp SA | ||
# @author Iván Todorovich <[email protected]> | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
{ | ||
"name": "Shopinvader Customer Invoicing Mode", | ||
"summary": "Glue module to expose the invoicing_mode field to shopinvader", | ||
"version": "14.0.1.0.0", | ||
"category": "e-commerce", | ||
"website": "https://github.com/shopinvader/odoo-shopinvader", | ||
"author": "Camptocamp", | ||
"license": "AGPL-3", | ||
"depends": ["shopinvader", "account_invoice_base_invoicing_mode"], | ||
} |
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 @@ | ||
* Iván Todorovich <[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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
This module exposes the `invoicing_mode` field added by OCA module | ||
`account_invoice_base_invoicing_mode` to the customer service. |
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 @@ | ||
from . import customer |
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,23 @@ | ||
# Copyright 2021 Camptocamp SA | ||
# @author Iván Todorovich <[email protected]> | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from odoo.addons.component.core import Component | ||
|
||
|
||
class CustomerService(Component): | ||
_inherit = "shopinvader.customer.service" | ||
|
||
def _validator_create(self): | ||
res = super()._validator_create() | ||
res.update( | ||
{ | ||
"invoicing_mode": {"type": "string", "required": False}, | ||
} | ||
) | ||
return res | ||
|
||
def _json_parser(self): | ||
res = super()._json_parser() | ||
res.append("invoicing_mode") | ||
return res |
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 @@ | ||
from . import test_customer |
18 changes: 18 additions & 0 deletions
18
shopinvader_customer_invoicing_mode/tests/test_customer.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,18 @@ | ||
# Copyright 2021 Camptocamp SA | ||
# @author Iván Todorovich <[email protected]> | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from odoo.addons.shopinvader.tests.test_customer import TestCustomerCommon | ||
|
||
|
||
class TestCustomer(TestCustomerCommon): | ||
def setUp(self, *args, **kwargs): | ||
super().setUp(*args, **kwargs) | ||
# TODO: Move to setUpClass in shopinvader's TestCustomerCommon. | ||
self.data["invoicing_mode"] = "standard" | ||
|
||
def test_create_customer(self): | ||
self.data["external_id"] = "D5CdkqOEL" | ||
res = self.service.dispatch("create", params=self.data)["data"] | ||
partner = self.env["res.partner"].browse(res["id"]) | ||
self._test_partner_data(partner, self.data) |