-
-
Notifications
You must be signed in to change notification settings - Fork 311
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
edi_sale_oca: split input to edi_sale_input_oca
- Loading branch information
Showing
24 changed files
with
151 additions
and
181 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
bot please :) |
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 @@ | ||
from . import components | ||
from . import wizard |
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,24 @@ | ||
# Copyright 2022 Camptocamp SA | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
{ | ||
"name": "EDI Sales input", | ||
"summary": """ | ||
Process incoming sale orders with the EDI framework. | ||
""", | ||
"version": "14.0.1.0.0", | ||
"development_status": "Alpha", | ||
"license": "AGPL-3", | ||
"author": "Camptocamp,Odoo Community Association (OCA)", | ||
"maintainers": ["simahawk"], | ||
"website": "https://github.com/OCA/edi", | ||
"depends": [ | ||
"edi_sale_oca", | ||
"edi_record_metadata_oca", | ||
"sale_order_import", | ||
], | ||
"data": [], | ||
"demo": [ | ||
"demo/edi_exchange_type.xml", | ||
], | ||
} |
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 process |
File renamed without changes.
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,22 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<odoo> | ||
|
||
<record id="demo_edi_exc_type_order_in" model="edi.exchange.type"> | ||
<field name="backend_type_id" ref="edi_sale_oca.demo_edi_backend_type_sale" /> | ||
<field name="backend_id" ref="edi_sale_oca.demo_edi_backend" /> | ||
<field name="name">Demo Sale Order</field> | ||
<field name="code">demo_SaleOrder_in</field> | ||
<field name="direction">input</field> | ||
<field name="exchange_file_ext">xml</field> | ||
<field name="advanced_settings_edit"> | ||
components: | ||
process: | ||
usage: input.process.sale.order | ||
env_ctx: | ||
default_price_source: 'pricelist' | ||
default_import_type: 'xml' | ||
random_key: custom | ||
</field> | ||
</record> | ||
|
||
</odoo> |
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,3 @@ | ||
* Simone Orsi <[email protected]> | ||
* Duong (Tran Quoc) <[email protected]> | ||
* Thien (Vo Hong) <[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 @@ | ||
The migration of this module from 14.0 to 16.0 was financially supported by Camptocamp. |
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,27 @@ | ||
Inbound | ||
~~~~~~~ | ||
Receive sale orders from EDI channels. | ||
|
||
Control sale order confirmation | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
You can decide if the order should be confirmed by exchange type. | ||
|
||
On your exchange type, go to advanced settings and add the following:: | ||
|
||
[...] | ||
components: | ||
process: | ||
usage: input.process.sale.order | ||
env_ctx: | ||
# Values for the wizard | ||
default_confirm_order: true | ||
default_price_source: order | ||
# Custom keys, whatever you need | ||
random_one: true | ||
|
||
Note that `env_ctx` will propagate all keys to the whole env so you can use it | ||
for any kind of context related configuration. In the case of the sale order import wizard | ||
here we are just passing defaults as we could do in odoo standard. | ||
|
||
TODO: shall we add an exchange type example as demo? |
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_process |
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,51 @@ | ||
# Copyright 2022 Camptocamp SA | ||
# @author: Simone Orsi <[email protected]> | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import fields | ||
|
||
|
||
class OrderMixin(object): | ||
@classmethod | ||
def _create_sale_order(cls, **kw): | ||
"""Create a sale order | ||
:return: sale order | ||
""" | ||
model = cls.env["sale.order"] | ||
vals = dict(commitment_date=fields.Date.today()) | ||
vals.update(kw) | ||
so_vals = model.play_onchanges(vals, []) | ||
if "order_line" in so_vals: | ||
so_vals["order_line"] = [(0, 0, x) for x in vals["order_line"]] | ||
return model.create(so_vals) | ||
|
||
@classmethod | ||
def _setup_order(cls, **kw): | ||
cls.product_a = cls.env.ref("product.product_product_4") | ||
cls.product_a.barcode = "1" * 14 | ||
cls.product_b = cls.env.ref("product.product_product_4b") | ||
cls.product_b.barcode = "2" * 14 | ||
cls.product_c = cls.env.ref("product.product_product_4c") | ||
cls.product_c.barcode = "3" * 14 | ||
cls.product_d = cls.env.ref("product.product_product_5") | ||
cls.product_d.barcode = "4" * 14 | ||
line_defaults = kw.pop("line_defaults", {}) | ||
vals = { | ||
"partner_id": cls.env.ref("base.res_partner_10").id, | ||
"commitment_date": "2022-07-29", | ||
} | ||
vals.update(kw) | ||
if "client_order_ref" not in vals: | ||
vals["client_order_ref"] = "ABC123" | ||
vals["order_line"] = [ | ||
{"product_id": cls.product_a.id, "product_uom_qty": 300, "edi_id": 1000}, | ||
{"product_id": cls.product_b.id, "product_uom_qty": 200, "edi_id": 2000}, | ||
{"product_id": cls.product_c.id, "product_uom_qty": 100, "edi_id": 3000}, | ||
] | ||
if line_defaults: | ||
for line in vals["order_line"]: | ||
line.update(line_defaults) | ||
sale = cls._create_sale_order(**vals) | ||
sale.action_confirm() | ||
return sale |
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
File renamed without changes.
File renamed without changes.
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,122 +1 @@ | ||
========= | ||
EDI Sales | ||
========= | ||
|
||
.. | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! This file is generated by oca-gen-addon-readme !! | ||
!! changes will be overwritten. !! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! source digest: sha256:8cc00af990de28ee9679466fc10bfcfe395035c200137f800be3a5fbf69b987e | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
.. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png | ||
:target: https://odoo-community.org/page/development-status | ||
:alt: Alpha | ||
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png | ||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html | ||
:alt: License: AGPL-3 | ||
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fedi-lightgray.png?logo=github | ||
:target: https://github.com/OCA/edi/tree/14.0/edi_sale_oca | ||
:alt: OCA/edi | ||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png | ||
:target: https://translation.odoo-community.org/projects/edi-14-0/edi-14-0-edi_sale_oca | ||
:alt: Translate me on Weblate | ||
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png | ||
:target: https://runboat.odoo-community.org/builds?repo=OCA/edi&target_branch=14.0 | ||
:alt: Try me on Runboat | ||
|
||
|badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
||
Inbound | ||
~~~~~~~ | ||
Receive sale orders from EDI channels. | ||
|
||
Control sale order confirmation | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
You can decide if the order should be confirmed by exchange type. | ||
|
||
On your exchange type, go to advanced settings and add the following:: | ||
|
||
[...] | ||
components: | ||
process: | ||
usage: input.process.sale.order | ||
env_ctx: | ||
# Values for the wizard | ||
default_confirm_order: true | ||
default_price_source: order | ||
# Custom keys, whatever you need | ||
random_one: true | ||
|
||
Note that `env_ctx` will propagate all keys to the whole env so you can use it | ||
for any kind of context related configuration. In the case of the sale order import wizard | ||
here we are just passing defaults as we could do in odoo standard. | ||
|
||
TODO: shall we add an exchange type example as demo? | ||
|
||
.. IMPORTANT:: | ||
This is an alpha version, the data model and design can change at any time without warning. | ||
Only for development or testing purpose, do not use in production. | ||
`More details on development status <https://odoo-community.org/page/development-status>`_ | ||
|
||
**Table of contents** | ||
|
||
.. contents:: | ||
:local: | ||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues <https://github.com/OCA/edi/issues>`_. | ||
In case of trouble, please check there if your issue has already been reported. | ||
If you spotted it first, help us to smash it by providing a detailed and welcomed | ||
`feedback <https://github.com/OCA/edi/issues/new?body=module:%20edi_sale_oca%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. | ||
|
||
Do not contact contributors directly about support or help with technical issues. | ||
|
||
Credits | ||
======= | ||
|
||
Authors | ||
~~~~~~~ | ||
|
||
* Camptocamp | ||
|
||
Contributors | ||
~~~~~~~~~~~~ | ||
|
||
* Simone Orsi <[email protected]> | ||
* Duong (Tran Quoc) <[email protected]> | ||
* Thien (Vo Hong) <[email protected]> | ||
|
||
Other credits | ||
~~~~~~~~~~~~~ | ||
|
||
The migration of this module from 14.0 to 16.0 was financially supported by Camptocamp. | ||
|
||
Maintainers | ||
~~~~~~~~~~~ | ||
|
||
This module is maintained by the OCA. | ||
|
||
.. image:: https://odoo-community.org/logo.png | ||
:alt: Odoo Community Association | ||
:target: https://odoo-community.org | ||
|
||
OCA, or the Odoo Community Association, is a nonprofit organization whose | ||
mission is to support the collaborative development of Odoo features and | ||
promote its widespread use. | ||
|
||
.. |maintainer-simahawk| image:: https://github.com/simahawk.png?size=40px | ||
:target: https://github.com/simahawk | ||
:alt: simahawk | ||
|
||
Current `maintainer <https://odoo-community.org/page/maintainer-role>`__: | ||
|
||
|maintainer-simahawk| | ||
|
||
This module is part of the `OCA/edi <https://github.com/OCA/edi/tree/14.0/edi_sale_oca>`_ project on GitHub. | ||
|
||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. | ||
bot please :) |
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 @@ | ||
from . import components | ||
from . import models | ||
from . import wizard |
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 |
---|---|---|
@@ -1 +0,0 @@ | ||
from . import process | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,7 @@ | ||
Inbound | ||
~~~~~~~ | ||
Receive sale orders from EDI channels. | ||
Handle sale orders via EDI. | ||
|
||
Control sale order confirmation | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
This is a base module to plug sales processes with the EDI framework. | ||
|
||
You can decide if the order should be confirmed by exchange type. | ||
|
||
On your exchange type, go to advanced settings and add the following:: | ||
|
||
[...] | ||
components: | ||
process: | ||
usage: input.process.sale.order | ||
env_ctx: | ||
# Values for the wizard | ||
default_confirm_order: true | ||
default_price_source: order | ||
# Custom keys, whatever you need | ||
random_one: true | ||
|
||
Note that `env_ctx` will propagate all keys to the whole env so you can use it | ||
for any kind of context related configuration. In the case of the sale order import wizard | ||
here we are just passing defaults as we could do in odoo standard. | ||
|
||
TODO: shall we add an exchange type example as demo? | ||
To handle inbound/outbound sale orders, | ||
you need to use `edi_sale_input_oca` or `edi_sale_output_oca` modules, | ||
or create your own modules. |
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 @@ | ||
from . import test_order | ||
from . import test_process |
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 @@ | ||
../../../../edi_sale_input_oca |
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, | ||
) |