Skip to content
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
98 changes: 98 additions & 0 deletions sale_stock_warehouse_multicompany/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
=================================
sale stock warehouse multicompany
=================================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:67949d6668369459da869bf2f201763a4fb3122e67d4a284a2bba1e044d75edf
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png
:target: https://odoo-community.org/page/development-status
:alt: Alpha
.. |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-OCA%2Fmulti--company-lightgray.png?logo=github
:target: https://github.com/OCA/multi-company/tree/18.0/sale_stock_warehouse_multicompany
:alt: OCA/multi-company
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/multi-company-18-0/multi-company-18-0-sale_stock_warehouse_multicompany
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/multi-company&target_branch=18.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

Allow multiple companies to sell the stock of a shared warehouse.

The sales order will belong to the company making the sale. As such, the
taxes and related invoices will also belong to that selling company. The
generated stock moves will belong to the company owning the stock and
defined on the warehouse.

This approach also allows to use any route (like cross-docking or
drop-shipment) on the sales order line.

.. IMPORTANT::
This is an alpha version, the data model and design can change at any time without warning.
Only for development or testing purpose, do not use in production.
`More details on development status <https://odoo-community.org/page/development-status>`_

**Table of contents**

.. contents::
:local:

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

On the warehouse select the companies that are allowed to sell the
stock.

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

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

* Camptocamp
* BCIM

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

- Telmo Santos <telmo.santos@camptocamp.com>
- Jacques-Etienne Baudoux (BCIM) <je@bcim.be>
- Cyril Manuel Jeanneret <cyril.jeanneret@camptocamp.com>

Maintainers
-----------

This module is maintained by the OCA.

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

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.

This module is part of the `OCA/multi-company <https://github.com/OCA/multi-company/tree/18.0/sale_stock_warehouse_multicompany>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions sale_stock_warehouse_multicompany/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
19 changes: 19 additions & 0 deletions sale_stock_warehouse_multicompany/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2024 Camptocamp SA
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl)
{
"name": "sale stock warehouse multicompany",
"summary": "Allow multiple companies to sell the stock of a shared warehouse",
"version": "18.0.1.0.0",
"development_status": "Alpha",
"category": "Warehouse Management",
"website": "https://github.com/OCA/multi-company",
"author": "Camptocamp, BCIM, Odoo Community Association (OCA)",
"license": "AGPL-3",
"application": False,
"installable": True,
"depends": ["delivery"],
"data": [
"views/stock_warehouse_views.xml",
"views/stock_route_views.xml",
],
}
49 changes: 49 additions & 0 deletions sale_stock_warehouse_multicompany/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_stock_warehouse_multicompany
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-04-02 12:35+0000\n"
"Last-Translator: mymage <stefano.consolaro@mymage.it>\n"
"Language-Team: none\n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.17\n"

#. module: sale_stock_warehouse_multicompany
#: model:ir.model.fields,field_description:sale_stock_warehouse_multicompany.field_stock_route__company_ids
#: model:ir.model.fields,field_description:sale_stock_warehouse_multicompany.field_stock_warehouse__company_ids
msgid "Companies"
msgstr "Aziende"

#. module: sale_stock_warehouse_multicompany
#: model:ir.model,name:sale_stock_warehouse_multicompany.model_stock_route
msgid "Inventory Routes"
msgstr "Percorsi di inventario"

#. module: sale_stock_warehouse_multicompany
#: model:ir.model.fields,field_description:sale_stock_warehouse_multicompany.field_sale_order_line__route_id
msgid "Route"
msgstr "Percorso"

#. module: sale_stock_warehouse_multicompany
#: model:ir.model,name:sale_stock_warehouse_multicompany.model_sale_order
msgid "Sales Order"
msgstr "Ordine di vendita"

#. module: sale_stock_warehouse_multicompany
#: model:ir.model,name:sale_stock_warehouse_multicompany.model_sale_order_line
msgid "Sales Order Line"
msgstr "Riga ordine di vendita"

#. module: sale_stock_warehouse_multicompany
#: model:ir.model,name:sale_stock_warehouse_multicompany.model_stock_warehouse
#: model:ir.model.fields,field_description:sale_stock_warehouse_multicompany.field_sale_order__warehouse_id
msgid "Warehouse"
msgstr "Magazzino"
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_stock_warehouse_multicompany
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.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: sale_stock_warehouse_multicompany
#: model:ir.model.fields,field_description:sale_stock_warehouse_multicompany.field_stock_route__company_ids
#: model:ir.model.fields,field_description:sale_stock_warehouse_multicompany.field_stock_warehouse__company_ids
msgid "Companies"
msgstr ""

#. module: sale_stock_warehouse_multicompany
#: model:ir.model,name:sale_stock_warehouse_multicompany.model_stock_route
msgid "Inventory Routes"
msgstr ""

#. module: sale_stock_warehouse_multicompany
#: model:ir.model.fields,field_description:sale_stock_warehouse_multicompany.field_sale_order_line__route_id
msgid "Route"
msgstr ""

#. module: sale_stock_warehouse_multicompany
#: model:ir.model,name:sale_stock_warehouse_multicompany.model_sale_order
msgid "Sales Order"
msgstr ""

#. module: sale_stock_warehouse_multicompany
#: model:ir.model,name:sale_stock_warehouse_multicompany.model_sale_order_line
msgid "Sales Order Line"
msgstr ""

#. module: sale_stock_warehouse_multicompany
#: model:ir.model,name:sale_stock_warehouse_multicompany.model_stock_warehouse
#: model:ir.model.fields,field_description:sale_stock_warehouse_multicompany.field_sale_order__warehouse_id
msgid "Warehouse"
msgstr ""
4 changes: 4 additions & 0 deletions sale_stock_warehouse_multicompany/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from . import stock_warehouse
from . import sale_order
from . import sale_order_line
from . import stock_route
14 changes: 14 additions & 0 deletions sale_stock_warehouse_multicompany/models/sale_order.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright 2024 Camptocamp SA
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import fields, models


class SaleOrder(models.Model):
_inherit = "sale.order"

warehouse_id = fields.Many2one(
"stock.warehouse",
domain="[('company_ids', 'in', company_id)]",
check_company=False,
)
21 changes: 21 additions & 0 deletions sale_stock_warehouse_multicompany/models/sale_order_line.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2024 Camptocamp SA
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import fields, models


class SaleOrderLine(models.Model):
_inherit = "sale.order.line"

route_id = fields.Many2one(
"stock.route",
domain="[('company_ids', 'in', company_id),('sale_selectable','=', True)]",
check_company=False,
)

def _prepare_procurement_values(self, group_id=False):
values = super()._prepare_procurement_values(group_id=group_id)
# Procurements must be created in warehouse company
if self.order_id.warehouse_id:
values["company_id"] = self.order_id.warehouse_id.company_id
return values
21 changes: 21 additions & 0 deletions sale_stock_warehouse_multicompany/models/stock_route.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2024 Camptocamp SA
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import fields, models
from odoo.fields import Command


class StockRoute(models.Model):
_inherit = "stock.route"

company_ids = fields.Many2many(
"res.company",
string="Companies",
compute="_compute_company_ids",
store=True,
readonly=False,
)

def _compute_company_ids(self):
for route in self:
route.company_ids = [Command.set(route.company_id.ids)]
21 changes: 21 additions & 0 deletions sale_stock_warehouse_multicompany/models/stock_warehouse.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2024 Camptocamp SA
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import fields, models
from odoo.fields import Command


class Warehouse(models.Model):
_inherit = "stock.warehouse"

company_ids = fields.Many2many(
"res.company",
string="Companies",
compute="_compute_company_ids",
store=True,
readonly=False,
)

def _compute_company_ids(self):
for warehouse in self:
warehouse.company_ids = [Command.set(warehouse.company_id.ids)]
3 changes: 3 additions & 0 deletions sale_stock_warehouse_multicompany/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
2 changes: 2 additions & 0 deletions sale_stock_warehouse_multicompany/readme/CONFIGURE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
On the warehouse select the companies that are allowed to sell the
stock.
3 changes: 3 additions & 0 deletions sale_stock_warehouse_multicompany/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- Telmo Santos \<<telmo.santos@camptocamp.com>\>
- Jacques-Etienne Baudoux (BCIM) \<<je@bcim.be>\>
- Cyril Manuel Jeanneret \<<cyril.jeanneret@camptocamp.com>\>
9 changes: 9 additions & 0 deletions sale_stock_warehouse_multicompany/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Allow multiple companies to sell the stock of a shared warehouse.

The sales order will belong to the company making the sale. As such, the
taxes and related invoices will also belong to that selling company. The
generated stock moves will belong to the company owning the stock and
defined on the warehouse.

This approach also allows to use any route (like cross-docking or
drop-shipment) on the sales order line.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading