Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[12.0][ADD] pos_multi_store #32

Open
wants to merge 1 commit into
base: 12.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions pos_multi_store/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
.. |company| replace:: ADHOC SA

.. |company_logo| image:: https://raw.githubusercontent.com/ingadhoc/maintainer-tools/master/resources/adhoc-logo.png
:alt: ADHOC SA
:target: https://www.adhoc.com.ar

.. |icon| image:: https://raw.githubusercontent.com/ingadhoc/maintainer-tools/master/resources/adhoc-icon.png

.. image:: https://img.shields.io/badge/license-AGPL--3-blue.png
:target: https://www.gnu.org/licenses/agpl
:alt: License: AGPL-3

=============================
Multi Store for Point of Sale
=============================


Related Linked Models:

* Point of Sale Configuration
* Point of Sale Order

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

This module should be auto-installed

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

No need for configuration

Usage
=====

To use this module, you need to:

#. Just use it.

.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: http://runbot.adhoc.com.ar/

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

Bugs are tracked on `GitHub Issues
<https://github.com/ingadhoc/multi-store/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.

Credits
=======

Images
------

* |company| |icon|

Contributors
------------

Giovanni Serra <[email protected]>

Maintainer
----------

|company_logo|

This module is maintained by the |company|.

To contribute to this module, please visit https://www.adhoc.com.ar.
5 changes: 5 additions & 0 deletions pos_multi_store/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
##############################################################################
# For copyright and license notices, see __manifest__.py file in module root
# directory
##############################################################################
from . import models # noqa
42 changes: 42 additions & 0 deletions pos_multi_store/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
##############################################################################
#
# Copyright (C) 2015 ADHOC SA (http://www.adhoc.com.ar)
# All Rights Reserved.
#
# 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/>.
#
##############################################################################
{
'name': 'Multi Store for Point of Sale',
'version': '12.0.1.0.0',
'category': 'Point Of Sale',
'sequence': 14,
'summary': '',
'author': 'ADHOC SA, Giovanni Serra - GSLab.it',
'website': 'www.adhoc.com.ar',
'license': 'AGPL-3',
'images': [],
'depends': [
'point_of_sale',
'base_multi_store',
],
'data': [
'security/multi_store_security.xml',
'views/pos_order_view.xml',
],
'demo': [],
'installable': True,
'auto_install': True,
'application': False,
}
34 changes: 34 additions & 0 deletions pos_multi_store/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * pos_multi_store
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: pos_multi_store
#: model:ir.model,name:pos_multi_store.model_pos_config
msgid "Point of Sale Configuration"
msgstr ""

#. module: pos_multi_store
#: model:ir.model,name:pos_multi_store.model_pos_order
msgid "Point of Sale Orders"
msgstr "Ordini punto vendita"

#. module: pos_multi_store
#: model_terms:ir.ui.view,arch_db:pos_multi_store.view_pos_order_filter
msgid "Store"
msgstr "Negozio"

#. module: pos_multi_store
#: model_terms:ir.ui.view,arch_db:pos_multi_store.view_id
msgid "Store related to the location"
msgstr "Negozio correlato all'ubicazione"
34 changes: 34 additions & 0 deletions pos_multi_store/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * pos_multi_store
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: pos_multi_store
#: model:ir.model,name:pos_multi_store.model_pos_config
msgid "Point of Sale Configuration"
msgstr "Configurazione punto vendita"

#. module: pos_multi_store
#: model:ir.model,name:pos_multi_store.model_pos_order
msgid "Point of Sale Orders"
msgstr "Ordini "

#. module: pos_multi_store
#: model_terms:ir.ui.view,arch_db:pos_multi_store.view_pos_order_filter
msgid "Store"
msgstr ""

#. module: pos_multi_store
#: model_terms:ir.ui.view,arch_db:pos_multi_store.view_id
msgid "Store related to the location"
msgstr ""
35 changes: 35 additions & 0 deletions pos_multi_store/i18n/pos_multi_store.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * pos_multi_store
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: pos_multi_store
#: model:ir.model,name:pos_multi_store.model_pos_config
msgid "Point of Sale Configuration"
msgstr ""

#. module: pos_multi_store
#: model:ir.model,name:pos_multi_store.model_pos_order
msgid "Point of Sale Orders"
msgstr ""

#. module: pos_multi_store
#: model_terms:ir.ui.view,arch_db:pos_multi_store.view_pos_order_filter
msgid "Store"
msgstr ""

#. module: pos_multi_store
#: model_terms:ir.ui.view,arch_db:pos_multi_store.view_id
msgid "Store related to the location"
msgstr ""

34 changes: 34 additions & 0 deletions pos_multi_store/i18n/ru.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * pos_multi_store
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: pos_multi_store
#: model:ir.model,name:pos_multi_store.model_pos_config
msgid "Point of Sale Configuration"
msgstr ""

#. module: pos_multi_store
#: model:ir.model,name:pos_multi_store.model_pos_order
msgid "Point of Sale Orders"
msgstr ""

#. module: pos_multi_store
#: model_terms:ir.ui.view,arch_db:pos_multi_store.view_pos_order_filter
msgid "Store"
msgstr ""

#. module: pos_multi_store
#: model_terms:ir.ui.view,arch_db:pos_multi_store.view_id
msgid "Store related to the location"
msgstr ""
6 changes: 6 additions & 0 deletions pos_multi_store/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
##############################################################################
# For copyright and license notices, see __manifest__.py file in module root
# directory
##############################################################################
from . import pos_config # noqa
from . import pos_order # noqa
23 changes: 23 additions & 0 deletions pos_multi_store/models/pos_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
##############################################################################
# For copyright and license notices, see __manifest__.py file in module root
# directory
##############################################################################
from odoo import api, models, fields


class PosConfig(models.Model):
_inherit = 'pos.config'

store_id = fields.Many2one(
string="Store",
comodel_name='res.store',
compute='_compute_store_id',
store=True,
)

@api.depends('stock_location_id')
def _compute_store_id(self):
for record in self:
warehouse_id = record.stock_location_id.get_warehouse()
if warehouse_id:
record.store_id = warehouse_id.store_id
23 changes: 23 additions & 0 deletions pos_multi_store/models/pos_order.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
##############################################################################
# For copyright and license notices, see __manifest__.py file in module root
# directory
##############################################################################
from odoo import api, models, fields


class PosOrder(models.Model):
_inherit = 'pos.order'

store_id = fields.Many2one(
string="Store",
comodel_name='res.store',
compute='_compute_store_id',
store=True,
)

@api.depends('location_id')
def _compute_store_id(self):
for record in self:
warehouse_id = record.location_id.get_warehouse()
if warehouse_id:
record.store_id = warehouse_id.store_id
20 changes: 20 additions & 0 deletions pos_multi_store/security/multi_store_security.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0"?>
<odoo>
<data noupdate="1">
<record id="pos_config_store_rule" model="ir.rule">
<field name="name">Pos Config multi-store</field>
<field name="model_id" ref="point_of_sale.model_pos_config"/>
<field name="global" eval="True"/>
<field name="perm_read" eval="False"/>
<field name="domain_force">['|',('store_id','=',False),('store_id','child_of',[user.store_id.id])]</field>
</record>
<record id="pos_order_store_rule" model="ir.rule">
<field name="name">Pos Order multi-store</field>
<field name="model_id" ref="point_of_sale.model_pos_order"/>
<field name="global" eval="True"/>
<field name="perm_read" eval="False"/>
<field name="domain_force">['|',('store_id','=',False),('store_id','child_of',[user.store_id.id])]</field>
</record>
</data>
</odoo>

41 changes: 41 additions & 0 deletions pos_multi_store/views/pos_order_view.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0"?>
<odoo>

<!-- Sale Order Search -->
<record id="view_pos_order_filter" model="ir.ui.view">
<field name="name">pos.order.filter</field>
<field name="model">pos.order</field>
<field name="inherit_id" ref="point_of_sale.view_pos_order_filter"/>
<field name="arch" type="xml">
<field name="config_id" position="after">
<field name="store_id" groups="base_multi_store.group_multi_store"/>
</field>
<filter name="order_month" position="after">
<filter name="by_store" string="Store" context="{'group_by':'store_id'}" groups="base_multi_store.group_multi_store"/>
</filter>
</field>
</record>

<!-- model.name inherit form view -->
<record id="view_id" model="ir.ui.view">
<field name="name">pos.config.view.form</field>
<field name="model">pos.config</field>
<field name="inherit_id" ref="point_of_sale.pos_config_view_form"/>
<field name="arch" type="xml">
<!-- Add your xpath here -->
<div id="inventory_location" position="inside">
<div class="col-12 col-lg-6 o_setting_box" groups="base_multi_store.group_multi_store">
<div class="o_setting_right_pane">
<label for="store_id"/>
<div class="text-muted">
Store related to the location
</div>
<div>
<field name="store_id" readonly="1"/>
</div>
</div>
</div>
</div>
</field>
</record>
</odoo>