Skip to content

Commit

Permalink
[4755][IMP] connector_ebisumart: propagate ebisumart_send_date to inv…
Browse files Browse the repository at this point in the history
…oice (#10)

* [IMP] connector_ebisumart: propagate ebisumart_send_date to invoice
  • Loading branch information
AungKoKoLin1997 authored Oct 23, 2024
1 parent f89c5be commit ef50c10
Show file tree
Hide file tree
Showing 6 changed files with 623 additions and 2 deletions.
100 changes: 100 additions & 0 deletions connector_ebisumart/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
===================
Connector Ebisumart
===================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |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-qrtl%2Fsbt--custom-lightgray.png?logo=github
:target: https://github.com/qrtl/sbt-custom/tree/12.0/connector_ebisumart
:alt: qrtl/sbt-custom

|badge1| |badge2| |badge3|

This module connects Odoo with Ebisumart.
Ebisumart (https://ebisumart.com/) is a popular Japanese e-commerce platform.

This module allows the synchronization of the following objects from Ebisumart to Odoo through scheduled actions:
- Product
- Partner
- Sale Order
- Purchase Order

This connector supports Ebisumart API version 1.

**Table of contents**

.. contents::
:local:

Configuration
=============

To configure this module, you need to set several things in both PrestaShop and Odoo:

Steps in Ebisumart

* Create the Ebisumart Apps.(https://support.ebisumart.com/category/APP/APP_INSTALL.html)
* Login to the Ebisumart Developer tool.
* Go to the Apps management page.
* Create a new Apps. Apps is required to connect with Odoo.
* Fill in the following fields and save the Apps.
* Apps Code - Code of Apps (Uniquely identify the Apps)
* Apps Name - Name of Apps
* Redirect URI - URL of the Odoo environment for redirecting from Ebisumart when requesting authorization. After the Odoo URL, please append /ebisumart/auth (e.g. https://odoo.example.com/ebisumart/auth)
* You can check the App password by using the 'Show Password' button.

* Need to log in to the ebisumart shop page, so please create an account for the shop page as well

Steps in Odoo:

* Go to Connectors > Ebisumart > Backends.
* Create a new record to register an Ebisumart backend.
* Name - Backend Name
* Ebisumart No - The number of Ebisumart
* App Code - The code of your application
* Password - Password for your application
* Root Ebisumart URL - Specify the root URL for the shop management tool (https://support.ebisumart.com/category/APP/APP_INSTALL.html)
* Ebisumart Access URL - Specify the URL for API access (https://support.ebisumart.com/category/APPDA/APPDA.html#APPDA_ACCESS_URL)
* Redirect URI - Specify the URL of the Odoo environment for redirecting from Ebisumart when requesting authorization (e.g., odoo_web_url/ebisumart/auth)
* Sale Partner - Assign the partner that will be used as the customer for imported sale orders.
* Coupon Product - Assign the coupon product to be used in the order line when the Ebisumart order includes a coupon
* After filling in the details, click the Authorization button. This will initiate the OAuth process to obtain the token information needed for secure API communication with Ebisumart.
* Go to Accounting > Configuration > Journals and select the appropriate journal.
* Choose the Ebisumart Payment Type that you will use, such as Credit Card or Payment Slip, to assign journal for imported orders.
* Set the timezone of the OdooBot user to match the timezone of your Ebisumart shop. This ensures that dates and times are correctly mapped during the synchronization process, avoiding any discrepancies in Odoo.

This module depends on the 'queue_job'. Therefore, please adhere to the configuration steps outlined in this module.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/qrtl/sbt-custom/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/qrtl/sbt-custom/issues/new?body=module:%20connector_ebisumart%0Aversion:%2012.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
~~~~~~~

* Quartile Limited

Maintainers
~~~~~~~~~~~

This module is part of the `qrtl/sbt-custom <https://github.com/qrtl/sbt-custom/tree/12.0/connector_ebisumart>`_ project on GitHub.

You are welcome to contribute.
2 changes: 0 additions & 2 deletions connector_ebisumart/components/binder.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ class EbisumarttoModelBinder(Component):
_inherit = ['base.binder', 'base.ebisumart.connector']
_apply_on = [
'ebisumart.product.product',
'ebisumart.purchase.order',
'ebisumart.purchase.order.line',
'ebisumart.sale.order',
'ebisumart.sale.order.line',
'ebisumart.res.partner',
Expand Down
9 changes: 9 additions & 0 deletions connector_ebisumart/models/ebisumart_sale_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ def after_import(self, ebisumart_record, backend_record):
'state': 'draft',
'type': 'in_invoice',
'purchase_id': po.id,
'date_invoice': fields.Date.context_today(self, self.ebisumart_send_date),
}
inv = self.env['account.invoice'].create(po_invoice)
inv.purchase_order_change()
Expand All @@ -125,6 +126,14 @@ def after_import(self, ebisumart_record, backend_record):
# TODO put this line after action_confirm()
self.picking_ids.write({'scheduled_date': self.ebisumart_send_date})

@api.multi
def _prepare_invoice(self):
vals = super()._prepare_invoice()
date = self.ebisumart_send_date
if date:
vals['date_invoice'] = fields.Date.context_today(self, date)
return vals


class EbisumartSaleOrderLine(models.Model):
_name = 'ebisumart.sale.order.line'
Expand Down
35 changes: 35 additions & 0 deletions connector_ebisumart/readme/CONFIGURE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
To configure this module, you need to set several things in both PrestaShop and Odoo:

Steps in Ebisumart

* Create the Ebisumart Apps.(https://support.ebisumart.com/category/APP/APP_INSTALL.html)
* Login to the Ebisumart Developer tool.
* Go to the Apps management page.
* Create a new Apps. Apps is required to connect with Odoo.
* Fill in the following fields and save the Apps.
* Apps Code - Code of Apps (Uniquely identify the Apps)
* Apps Name - Name of Apps
* Redirect URI - URL of the Odoo environment for redirecting from Ebisumart when requesting authorization. After the Odoo URL, please append /ebisumart/auth (e.g. https://odoo.example.com/ebisumart/auth)
* You can check the App password by using the 'Show Password' button.

* Need to log in to the ebisumart shop page, so please create an account for the shop page as well

Steps in Odoo:

* Go to Connectors > Ebisumart > Backends.
* Create a new record to register an Ebisumart backend.
* Name - Backend Name
* Ebisumart No - The number of Ebisumart
* App Code - The code of your application
* Password - Password for your application
* Root Ebisumart URL - Specify the root URL for the shop management tool (https://support.ebisumart.com/category/APP/APP_INSTALL.html)
* Ebisumart Access URL - Specify the URL for API access (https://support.ebisumart.com/category/APPDA/APPDA.html#APPDA_ACCESS_URL)
* Redirect URI - Specify the URL of the Odoo environment for redirecting from Ebisumart when requesting authorization (e.g., odoo_web_url/ebisumart/auth)
* Sale Partner - Assign the partner that will be used as the customer for imported sale orders.
* Coupon Product - Assign the coupon product to be used in the order line when the Ebisumart order includes a coupon
* After filling in the details, click the Authorization button. This will initiate the OAuth process to obtain the token information needed for secure API communication with Ebisumart.
* Go to Accounting > Configuration > Journals and select the appropriate journal.
* Choose the Ebisumart Payment Type that you will use, such as Credit Card or Payment Slip, to assign journal for imported orders.
* Set the timezone of the OdooBot user to match the timezone of your Ebisumart shop. This ensures that dates and times are correctly mapped during the synchronization process, avoiding any discrepancies in Odoo.

This module depends on the 'queue_job'. Therefore, please adhere to the configuration steps outlined in this module.
10 changes: 10 additions & 0 deletions connector_ebisumart/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
This module connects Odoo with Ebisumart.
Ebisumart (https://ebisumart.com/) is a popular Japanese e-commerce platform.

This module allows the synchronization of the following objects from Ebisumart to Odoo through scheduled actions:
- Product
- Partner
- Sale Order
- Purchase Order

This connector supports Ebisumart API version 1.
Loading

0 comments on commit ef50c10

Please sign in to comment.