Skip to content

Commit

Permalink
[8.0] [ADD] pos order to sale order (w/o picking) (OCA#188)
Browse files Browse the repository at this point in the history
* [ADD] new module pos_order_to_sale_order
  • Loading branch information
legalsylvain authored and docker-odoo committed May 5, 2023
1 parent 5593033 commit 9835161
Show file tree
Hide file tree
Showing 21 changed files with 716 additions and 0 deletions.
135 changes: 135 additions & 0 deletions pos_order_to_sale_order/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3


=======================
POS Order To Sale Order
=======================


This module extends the functionality of point of sale to allow sale orders
creation from the Point of Sale.


In the POS UI, buttons has been added to create a sale order and discard
the current POS order.

This module is usefull in many cases, for exemple :

* take orders with a very simple interface

* if you have some customers that come every day in your shop, but want to
have a unique invoice at the end of the month. With that module, you can
create a sale order and deliver products every time to keep your stock value
correct, and to create a unique invoice, when you want.


Three options are available:

#. '**Create a draft Order**'
A new sale order in a draft mode will be created that can be changed later.

.. figure:: static/description/pos_create_picking_option_1.png
:width: 800 px

#. '**Create a Confirmed Order**'
A new sale order will be created and confirmed.

.. figure:: static/description/pos_create_picking_option_2.png
:width: 800 px

#. '**Create Delivered Picking**' (by default)
A new sale order will be created and confirmed. the associated picking
will be marked as delivered.

.. figure:: static/description/pos_create_picking_option_3.png
:width: 800 px

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

To configure this module, you need to:

#. Go to Point Of Sale / Configuration / Point of Sale
#. Check the box 'Create Sale Orders'
#. Select the desired default behaviour

.. figure:: static/description/pos_config_form.png
:width: 800 px

Usage
=====

.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/184/8.0

Technical Notes
===============

* Some hooks are defined in the JS file, to define custom behaviour after
having created the sale order (and the stock picking).

* Some prepare functions are available in the sale.order model, to overload
the creation of the sale order.

* You could be interested by another module, pos_sale_order, that completely
alter Point of Sale module, avoiding creating Pos Orders, and creating
allways Sale Orders.
This module is a WIP state, and is available here:
https://github.com/OCA/pos/pull/35

Known issues / Roadmap
======================

* Because of the poor design of the Odoo Point of Sale, some basic features
are not available by default, like pricelist, fiscal position, etc ...
For that reason, unit price will be recomputed by default, when creating the
sale order, and the unit price of the current bill will not be used.
We could imagine to create an option 'Use Pos Order Unit Price' in a setting.

For more information about that point, you could check pos_pricelist OCA
module. (same repository).

.. figure:: static/description/pos_create_picking_confirm.png
:width: 800 px


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

Bugs are tracked on `GitHub Issues
<https://github.com/OCA/pos/issues>`_. In case of trouble, please
check there if your issue has already been reported. If you spotted it first,
help us smash it by providing detailed and welcomed feedback.

Credits
=======

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)

Maintainer
----------

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

This module is maintained by the OCA.

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.

To contribute to this module, please visit https://odoo-community.org.
2 changes: 2 additions & 0 deletions pos_order_to_sale_order/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# -*- coding: utf-8 -*-
from . import models
26 changes: 26 additions & 0 deletions pos_order_to_sale_order/__openerp__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2017 - 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': 'PoS Order To Sale Order',
'version': '8.0.1.0.0',
'author': 'GRAP,Odoo Community Association (OCA)',
'category': 'Point Of Sale',
'license': 'AGPL-3',
'depends': [
'point_of_sale',
],
'website': 'https://odoo-community.org/',
'data': [
'views/view_pos_config.xml',
'views/pos_order_to_sale_order.xml',
],
'demo': [
'demo/res_groups.xml',
],
'qweb': [
'static/src/xml/pos_order_to_sale_order.xml',
],
}
19 changes: 19 additions & 0 deletions pos_order_to_sale_order/demo/product_template.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<openerp><data>

<record id="product.product_product_4_product_template" model="product.template">
<field name="available_in_pos" eval="True"/>
</record>

<record id="product.product_product_7_product_template" model="product.template">
<field name="available_in_pos" eval="True"/>
</record>

<record id="product.product_product_9_product_template" model="product.template">
<field name="available_in_pos" eval="True"/>
</record>

<record id="product.product_product_24_product_template" model="product.template">
<field name="available_in_pos" eval="True"/>
</record>

</data></openerp>
7 changes: 7 additions & 0 deletions pos_order_to_sale_order/demo/res_groups.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<openerp><data>

<record id="sale.group_discount_per_so_line" model="res.groups">
<field name="users" eval="[(4, ref('base.user_root'))]"/>
</record>

</data></openerp>
51 changes: 51 additions & 0 deletions pos_order_to_sale_order/demo/sale_order.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<openerp><data>

<!-- Sale Order 1-->
<record id="sale_order_1" model="sale.order">
<field name="partner_id" ref="base.res_partner_2"/>
<field name="order_policy">picking</field>
</record>

<record id="sale_order_line_11" model="sale.order.line">
<field name="order_id" ref="sale_order_1"/>
<field name="product_id" ref="product.product_product_7"/>
<field name="product_uom_qty">5</field>
</record>

<record id="sale_order_line_12" model="sale.order.line">
<field name="order_id" ref="sale_order_1"/>
<field name="product_id" ref="product.product_product_9"/>
<field name="product_uom_qty">3</field>
</record>

<workflow action="order_confirm" model="sale.order" ref="sale_order_1"/>

<!-- Sale Order 2-->
<record id="sale_order_2" model="sale.order">
<field name="partner_id" ref="base.res_partner_13"/>
<field name="order_policy">picking</field>
</record>

<record id="sale_order_line_21" model="sale.order.line">
<field name="order_id" ref="sale_order_2"/>
<field name="product_id" ref="product.product_product_7"/>
<field name="product_uom_qty">15</field>
<field name="discount">10</field>
</record>

<record id="sale_order_line_22" model="sale.order.line">
<field name="order_id" ref="sale_order_2"/>
<field name="product_id" ref="product.product_product_4"/>
<field name="product_uom_qty">1</field>
</record>

<record id="sale_order_line_23" model="sale.order.line">
<field name="order_id" ref="sale_order_2"/>
<field name="product_id" ref="product.product_product_24"/>
<field name="product_uom_qty">3</field>
<field name="price_unit">555</field>
</record>

<workflow action="order_confirm" model="sale.order" ref="sale_order_2"/>

</data></openerp>
7 changes: 7 additions & 0 deletions pos_order_to_sale_order/demo/stock_picking_type.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<openerp><data>

<record id="stock.picking_type_out" model="stock.picking.type">
<field name="available_in_pos" eval="True" />
</record>

</data></openerp>
Loading

0 comments on commit 9835161

Please sign in to comment.