summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2018-01-22 17:47:32 +0100
committerChristophe Simonis <chs@odoo.com>2018-01-22 17:47:32 +0100
commitfa1f2132e79f2ac2314a8b417d5d35d6571bd41b (patch)
tree3789a8335dd5089998de3c5c6a391b2d95a85187 /doc
parentdb27489fe756b24647e993a22340705625839698 (diff)
parent950d9b2369046f2e3199d144df8edbd0e63f8a2f (diff)
[MERGE] forward port branch 11.0 up to 950d9b23690
Diffstat (limited to 'doc')
-rw-r--r--doc/cla/corporate/bas-solutions.md16
-rw-r--r--doc/cla/corporate/odooexperts.md16
-rw-r--r--doc/cla/individual/nguyenductamlhp.md11
-rw-r--r--doc/setup/install.rst7
-rw-r--r--doc/webservices/iap.rst50
5 files changed, 67 insertions, 33 deletions
diff --git a/doc/cla/corporate/bas-solutions.md b/doc/cla/corporate/bas-solutions.md
deleted file mode 100644
index f0d49c7facf..00000000000
--- a/doc/cla/corporate/bas-solutions.md
+++ /dev/null
@@ -1,16 +0,0 @@
-Netherlands, 8-2-2015
-
-BAS Solutions agrees to the terms of the Odoo Corporate Contributor License
-Agreement v1.0.
-
-I declare that I am authorized and able to make this agreement and sign this
-declaration.
-
-Signed,
-
-Erwin van der Ploeg erwin@bas-solutions.nl https://github.com/erwin-bas-solutions
-
-List of contributors:
-
-Erwin van der Ploeg erwin@bas-solutions.nl https://github.com/erwin-bas-solutions
-Ruchir Shukla ruchir@bas-solutions.nl https://github.com/ruchir-bas-solutions \ No newline at end of file
diff --git a/doc/cla/corporate/odooexperts.md b/doc/cla/corporate/odooexperts.md
new file mode 100644
index 00000000000..3a73e799b87
--- /dev/null
+++ b/doc/cla/corporate/odooexperts.md
@@ -0,0 +1,16 @@
+Netherlands, 18-1-2018
+
+Odoo Experts agrees to the terms of the Odoo Corporate Contributor License
+Agreement v1.0.
+
+I declare that I am authorized and able to make this agreement and sign this
+declaration.
+
+Signed,
+
+Erwin van der Ploeg erwin@bas-solutions.nl https://github.com/erwin-bas-solutions
+
+List of contributors:
+
+Erwin van der Ploeg erwin@odooexperts.nl https://github.com/ploegvde
+Yenthe Van Ginneken yenthe@odooexperts.nl https://github.com/Yenthe666
diff --git a/doc/cla/individual/nguyenductamlhp.md b/doc/cla/individual/nguyenductamlhp.md
new file mode 100644
index 00000000000..898f465c52b
--- /dev/null
+++ b/doc/cla/individual/nguyenductamlhp.md
@@ -0,0 +1,11 @@
+Vietnam, 2018-01-16,
+
+I hereby agree to the terms of the Odoo Individual Contributor License
+Agreement v1.0.
+
+I declare that I am authorized and able to make this agreement and sign this
+declaration.
+
+Signed,
+
+Nguyen Duc Tam nguyenductamlhp@gmail.com https://github.com/nguyenductamlhp
diff --git a/doc/setup/install.rst b/doc/setup/install.rst
index 71a6ea7edb7..99871bda78f 100644
--- a/doc/setup/install.rst
+++ b/doc/setup/install.rst
@@ -360,13 +360,6 @@ Source installation requires manually installing dependencies:
Install ``psycopg`` using the installer here
http://www.stickpeople.com/projects/python/win-psycopg/
- Then edit the requirements.txt file:
-
- - remove ``psycopg2`` as you already have it.
- - remove the optional ``python-ldap``, ``gevent`` and ``psutil`` because
- they require compilation.
- - add ``pypiwin32`` because it's needed under windows.
-
Then use pip to install the dependencies using the following
command from a cmd.exe prompt (replace ``\YourOdooPath`` by the actual
path where you downloaded Odoo):
diff --git a/doc/webservices/iap.rst b/doc/webservices/iap.rst
index 186daf772b6..23467c267c3 100644
--- a/doc/webservices/iap.rst
+++ b/doc/webservices/iap.rst
@@ -82,8 +82,9 @@ Overview
The Credits
Every service provided through the In-App platform can be used by the
- clients with tokens or *credits*. The monetary value of a credit depends
- on the service and is decided by the provider. This could be:
+ clients with tokens or *credits*. The credits are an integer unit and
+ their monetary value depends on the service and is decided by the
+ provider. This could be:
* for an sms service: 1 credit = 1 sms,
* for an add service: 1 credit = 1 add,
@@ -210,14 +211,20 @@ The credit packages are essentially a product with 4 characteristics.
* Credits: the amount of credits the client is entitled to when buying the package,
* Price: the price in *EUROS* for the time being (USD support is planned).
-.. image:: images/package.png
- :align: center
-
.. note::
+ Odoo takes a 25% commission on all package sales. Adjust your selling price accordingly.
+
+
+.. note::
+
Depending on the strategy, the price per credit can vary from one
package to another.
+
+.. image:: images/package.png
+ :align: center
+
.. _iap-odoo-app:
Odoo App
@@ -309,15 +316,22 @@ perform the service within:
.. todo:: "My Account" > "Your InApp Services"?
+
The :class:`~odoo.addons.iap.models.iap.charge` helper will:
+.. note::
+
+ Since the 15th of January 2018, a new functionality that allows one to capture a different amount than autorized has been added.
+ See :ref:`Charging <iap-charging>`
+
1. authorize (create) a transaction with the specified number of credits,
if the account does not have enough credits it will raise the relevant
error
2. execute the body of the ``with`` statement
-3. if the body of the ``with`` executes succesfully, capture (confirm) the
- transaction
-4. otherwise if an error is raised from the body of the ``with`` cancel the
+3. (NEW) if the body of the ``with`` executes succesfully, update the price
+ of the transaction if needed
+4. capture (confirm) the transaction
+5. otherwise if an error is raised from the body of the ``with`` cancel the
transaction (and release the hold on the credits)
.. danger::
@@ -420,10 +434,12 @@ Capture
:param TransactionToken token:
:param ServiceKey key:
+ :param int credit_to_capture: (new - 15 Jan 2018) optional parameter to capture a smaller amount of credits than authorized
:raises: :class:`~odoo.exceptions.AccessError`
.. code-block:: python
-
+ :emphasize-lines: 8
+
r2 = requests.post(ODOO + '/iap/1/capture', json={
'jsonrpc': '2.0',
'id': None,
@@ -431,6 +447,7 @@ Capture
'params': {
'token': tx,
'key': SERVICE_KEY,
+ 'credit_to_capture': credit or False,
}
}).json()
if 'error' in r:
@@ -523,9 +540,17 @@ Odoo Helpers
For convenience, if you are implementing your service using Odoo the ``iap``
module provides a few helpers to make IAP flow even simpler:
+.. _iap-charging:
+
Charging
--------
+.. note::
+
+ A new functionality was introduced to capture a different amount of credits than reserved.
+ As this patch was added on the 15th of January 2018, you will need to upgrade your ``iap`` module in order to use it.
+ The specifics of the new functionality are highlighted in the code.
+
.. class:: odoo.addons.iap.models.iap.charge(env, key, account_token, credit[, description, credit_template])
A *context manager* for authorizing and automatically capturing or
@@ -544,8 +569,10 @@ Charging
:param UserToken token:
:param int credit:
:param str description:
+ :param Qweb template credit_template:
.. code-block:: python
+ :emphasize-lines: 10,13,14,15
@route('/deathstar/superlaser', type='json')
def superlaser(self, user_account,
@@ -556,8 +583,11 @@ Charging
0.0 is none, 1.0 is full power
"""
credits = int(MAXIMUM_POWER * factor)
- with charge(request.env, SERVICE_KEY, user_account, credits):
+ with charge(request.env, SERVICE_KEY, user_account, credits) as transaction:
# TODO: allow other targets
+ transaction.credit = max(credits, 2)
+ # Sales ongoing one the energy price,
+ # a maximum of 2 credits will be charged/captured.
self.env['systems.planets'].search([
('grid', '=', 'M-10'),
('name', '=', 'Alderaan'),