Skip to content
This repository has been archived by the owner on Oct 16, 2023. It is now read-only.

Commit

Permalink
Merge pull request #9 from legalsylvain/8.0_REF_sale_eshop
Browse files Browse the repository at this point in the history
[8.0][REF] sale_eshop
  • Loading branch information
legalsylvain committed Dec 3, 2018
2 parents 766e5fa + 82872a7 commit c39fc2a
Show file tree
Hide file tree
Showing 74 changed files with 2,162 additions and 2,163 deletions.
6 changes: 4 additions & 2 deletions oca_dependencies.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
web
l10n-france
account-invoicing
sale-workflow
l10n-france
purchase-workflow
web

grap-odoo-incubator https://github.com/grap/grap-odoo-incubator.git 8.0
grap-odoo-business https://github.com/grap/grap-odoo-business.git 8.0
grap-odoo-custom https://github.com/grap/grap-odoo-custom.git 8.0

grap-odoo-backport https://github.com/grap/grap-odoo-backport.git 8.0
113 changes: 98 additions & 15 deletions sale_eshop/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,102 @@
Allow connection to Odoo eShop Project
======================================

Functionality
-------------
This module is the 'odoo' part of the project Odoo eShop.

* Create a new category eshop_category for products
* Add fields on product.product
* 'eShop Category': category in the eShop
* 'Min date' and 'Max Date' that make product available for sale
* Add fields on res.partner
* 'Can purchase on eShop'
* 'eShop password'
the 'client' part is available here : https://github.com/grap/odoo-eshop

Installation
============

Normal installation.
eShop Categories
----------------

Configuration
=============
Add a new model ``eshop.category`` to have the possibility to dispatch products
for the eshop.

No configuration is needed.
.. figure:: /sale_eshop/static/description/eshop_category_tree.png
:width: 800 px

.. figure:: /sale_eshop/static/description/eshop_category_form.png
:width: 800 px


Customers
---------

Add new fields on ``res.partner`` to handle authentication on the eshop.
It is maid with a couple ``email`` and ``eshop_password``.


.. figure:: /sale_eshop/static/description/res_partner_form.png
:width: 800 px

Products
--------

Add new fields on ``product.product`` that handles display on eShop.

* 'eShop Category': category in the eShop
* 'Start date' and 'End Date' to disable temporarily the sale on the eShop
* 'Minimum Quantity', that will force user to buy at least that quantity
* 'Rounded Quantity', that will round quantity purchased

Furthermore, it is possible to allow consumers to buy less than the minimum
quantity, setting 'Unpack Quantity' value. In that case, a surcharge can
be applied in the field 'Unpack Surcharge'.

.. figure:: /sale_eshop/static/description/product_product_form.png
:width: 800 px


Companies
---------

General settings are available via company form.

.. figure:: /sale_eshop/static/description/res_company_form.png
:width: 800 px

The important fields are :

* 'has Eshop', that enable all the connexion
* 'eShop URL'
* 'Invalidation Cache URL', to enable invalidation cache system. (see below)

Some of cosmectics fields are available in a wizard, to be change by end users.

you have to go in 'Sale' / 'Configuration' / 'eShop Sale' / 'eShop Settings'

.. figure:: /sale_eshop/static/description/wizard_res_company_eshop_setting_form.png
:width: 800 px

Other models
------------

Furthermore, other models like ``account.tax`` has extra fields that will
be displayed on the eshop.

Technical Informations
======================

* The connection from the eShop into odoo, is made with a unique user, that
has to be member of the group "Is eShop".
Then, an extra authentication is available via partners.

* Some datas are cached by the eShop, to avoid useless call to odoo. So,
if data changes, the cached should be invalidated. for that purpose,
an extra abstract model ``eshop.mixin`` is available. Models synchronized
with eShop should inherit of that model, and defined two values :
* ``_eshop_invalidation_type`` : ``single`` / ``multiple`` to indicate
if all the eShops should be invalidated, or only the one of the current
object.
* ``_eshop_invalidation_fields`` : the list of the fields that trigger
invalidation.


Roadmap / Know issues
=====================

For the time being, password are not encrypted in the database, for
the partner authentication.

Credits
=======
Expand All @@ -34,3 +110,10 @@ Contributors
------------

* Sylvain LE GAL <https://twitter.com/legalsylvain>

Funders
-------

The development of this module has been financially supported by:

* GRAP, Groupement Régional Alimentaire de Proximité (http://www.grap.coop)
25 changes: 2 additions & 23 deletions sale_eshop/__init__.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,2 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Sale - eShop for Odoo
# Copyright (C) 2014 GRAP (http://www.grap.coop)
# @author Sylvain LE GAL (https://twitter.com/legalsylvain)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

from . import model
# encoding: utf-8
from . import models
62 changes: 26 additions & 36 deletions sale_eshop/__openerp__.py
Original file line number Diff line number Diff line change
@@ -1,59 +1,49 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Sale - eShop for Odoo
# Copyright (C) 2014 GRAP (http://www.grap.coop)
# @author Sylvain LE GAL (https://twitter.com/legalsylvain)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
# coding: utf-8
# Copyright (C) 2014 - Today: GRAP (http://www.grap.coop)
# @author: Sylvain LE GAL (https://twitter.com/legalsylvain)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

{
'name': 'Sale - eShop',
'version': '8.0.1.0.0',
'version': '8.0.4.0.0',
'summary': "Allow connection to Odoo eShop Project",
'category': 'Sale',
'author': 'GRAP',
'website': 'http://www.grap.coop',
'license': 'AGPL-3',
'depends': [
'product',
'mail',
'product',
'sale',
'sale_food',
'sale_order_line_price_subtotal_gross',
'sale_recovery_moment',
'simple_tax_sale',
'grap_qweb_report',
],
'data': [
'security/ir_rule.xml',
'security/ir_module_category.yml',
'security/res_groups.yml',
'security/ir_model_access.yml',
'security/ir_module_category.xml',
'security/res_groups.xml',
'security/ir.model.access.csv',
'data/email_template.xml',
'view/wizard_view.xml',
'view/wizard_action.xml',
'view/view.xml',
'view/action.xml',
'view/menu.xml',
'data/ir_cron.xml',
'views/menu.xml',
'views/view_account_tax.xml',
'views/view_eshop_category.xml',
'views/view_product_product.xml',
'views/view_product_uom.xml',
'views/view_res_company.xml',
'views/view_res_partner.xml',
'views/view_wizard_res_company_eshop_setting.xml',
],
'demo': [
'demo/res_partner.yml',
'demo/res_company.xml',
'demo/eshop_category.xml',
'demo/product_product.xml',
'demo/product_uom.yml',
'demo/res_users.yml',
'demo/res_groups.yml',
'demo/product_uom.xml',
'demo/res_users.xml',
'demo/res_groups.xml',
'demo/res_partner.xml',
],
'installable': True,
}
73 changes: 29 additions & 44 deletions sale_eshop/data/email_template.xml
Original file line number Diff line number Diff line change
@@ -1,50 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- ********************************************************************** -->
<!--Sale - eShop for Odoo -->
<!--Copyright (C) 2015-Today GRAP (http://www.grap.coop) -->
<!--@author Sylvain LE GAL (https://twitter.com/legalsylvain) -->
<!--
Copyright (C) 2015 - Today: GRAP (http://www.grap.coop)
@author: Sylvain LE GAL (https://twitter.com/legalsylvain)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
-->
<openerp><data>

<!--This program is free software: you can redistribute it and/or modify -->
<!--it under the terms of the GNU Affero General Public License as -->
<!--published by the Free Software Foundation, either version 3 of the -->
<!--License, or (at your option) any later version. -->

<!--This program is distributed in the hope that it will be useful, -->
<!--but WITHOUT ANY WARRANTY; without even the implied warranty of -->
<!--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -->
<!--GNU Affero General Public License for more details. -->

<!--You should have received a copy of the GNU Affero General Public License-->
<!--along with this program. If not, see <http://www.gnu.org/licenses/>. -->
<!-- ********************************************************************** -->
<openerp>
<data>

<!-- Model: email.template // res.partner -->
<record model="email.template" id="eshop_send_crendential_template" >
<field name="name">Send Password</field>
<field name="model_id" ref="base.model_res_partner"/>
<field name="email_from"><![CDATA[${object.company_id.name} <${(object.company_id.email or user.email)|safe}>]]></field>
<field name="email_recipients">${object.id}</field>
<field name="subject">eShop Access</field>
<field name="lang">${object.lang}</field>
<field name="body_html"><![CDATA[
<record model="email.template" id="eshop_send_crendential_template" >
<field name="name">Send Password</field>
<field name="model_id" ref="base.model_res_partner"/>
<field name="email_from"><![CDATA[${object.company_id.name} <${(object.company_id.email or user.email)|safe}>]]></field>
<field name="partner_to">${object.id}</field>
<field name="subject">eShop Access</field>
<field name="lang">${object.lang}</field>
<field name="body_html"><![CDATA[
<div style="font-family: 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: #FFF; ">
<p>Hello, ${object.name}</p>
<p>Here is your credentials to access to the purchase website of ${object.company_id.name}:</p>
<p>
<ul>
<li>Web Site: ${object.company_id.eshop_url}</li>
<li>Login: ${object.email}</li>
<li>Password: ${object.eshop_password}</li>
</ul>
</p>
<p>Hello, ${object.name}</p>
<p>Here is your credentials to access to the purchase website of ${object.company_id.name}:</p>
<p>
<ul>
<li>Web Site: ${object.company_id.eshop_url}</li>
<li>Login: ${object.email}</li>
<li>Password: ${object.eshop_password}</li>
</ul>
</p>
% if object.eshop_state == 'email_to_confirm':
Please finish your registration by clicking on this <a href="${object.company_id.eshop_url}activate_account/${object.id}/${object.email}">activation link</a>.
Please finish your registration by clicking on this <a href="${object.company_id.eshop_url}activate_account/${object.id}/${object.email}">activation link</a>.
% endif
<p>Have a nice day</p>
<p>Have a nice day</p>
</div>
]]></field>
</record>
</data>
</openerp>
]]></field>
</record>

</data></openerp>
21 changes: 21 additions & 0 deletions sale_eshop/data/ir_cron.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2015 - Today: GRAP (http://www.grap.coop)
@author: Sylvain LE GAL (https://twitter.com/legalsylvain)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
-->
<openerp><data noupdate="1">

<record forcecreate="True" id="cron_confirm_eshop_orders" model="ir.cron">
<field name="name">Eshop - Confirm Orders</field>
<field name="user_id" ref="base.user_root"/>
<field name="interval_number">5</field>
<field name="interval_type">minutes</field>
<field name="numbercall">-1</field>
<field name="doall" eval="False"/>
<field name="model" eval="'sale.order'" />
<field name="function" eval="'_eshop_cron_confirm_orders'" />
<field name="args" eval="'()'" />
</record>

</data></openerp>
5 changes: 5 additions & 0 deletions sale_eshop/demo/eshop_category.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2014 - Today: GRAP (http://www.grap.coop)
@author: Sylvain LE GAL (https://twitter.com/legalsylvain)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
-->

<openerp><data>
<record model="eshop.category" id="category_without_image">
Expand Down
Loading

0 comments on commit c39fc2a

Please sign in to comment.