Skip to content

Commit

Permalink
Merge PR #875 into 17.0
Browse files Browse the repository at this point in the history
Signed-off-by rousseldenis
  • Loading branch information
OCA-git-bot committed Sep 4, 2024
2 parents 5ead6a9 + 2082f76 commit 8549848
Show file tree
Hide file tree
Showing 19 changed files with 826 additions and 0 deletions.
102 changes: 102 additions & 0 deletions sale_order_warehouse_from_delivery_carrier/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
==========================================
Sale Order Warehouse from Delivery Carrier
==========================================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:31d3be7a7aeddf2a3958be40ec29b0f17389652da8bcf1460e6e3369346624a7
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |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%2Fdelivery--carrier-lightgray.png?logo=github
:target: https://github.com/OCA/delivery-carrier/tree/17.0/sale_order_warehouse_from_delivery_carrier
:alt: OCA/delivery-carrier
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/delivery-carrier-17-0/delivery-carrier-17-0-sale_order_warehouse_from_delivery_carrier
: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/delivery-carrier&target_branch=17.0
:alt: Try me on Runboat

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

This module allows to set warehouse in Sales Order based on selected
shipping method.

**Table of contents**

.. contents::
:local:

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

Go to Sales -> Settings -> Shipping methods and select a shipping method

Set warehouse in the "Sales Order Warehouse" field.

Usage
=====

Create a new quotation and select a shipping method.

If selected shipping method has a sales order warehouse defined this
warehouse will be automatically set in the quotation.

**Note**: The warehouse will NOT be updated if the sales order is
already confirmed.

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/delivery-carrier/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/delivery-carrier/issues/new?body=module:%20sale_order_warehouse_from_delivery_carrier%0Aversion:%2017.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
-------

* Cetmix

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

- Cetmix <cetmix.com>

- Ivan Sokolov
- Maksim Shurupov

- Codeforward (https://www.codeforward.nl):

- Sander Lienaerts [email protected]

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/delivery-carrier <https://github.com/OCA/delivery-carrier/tree/17.0/sale_order_warehouse_from_delivery_carrier>`_ 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_order_warehouse_from_delivery_carrier/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
14 changes: 14 additions & 0 deletions sale_order_warehouse_from_delivery_carrier/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "Sale Order Warehouse from Delivery Carrier",
"version": "17.0.1.0.0",
"category": "Delivery",
"summary": "Sale Order WH from Delivery Carrier",
"depends": ["sale_stock", "delivery"],
"website": "https://github.com/OCA/delivery-carrier",
"author": "Cetmix, Odoo Community Association (OCA)",
"data": [
"views/delivery_carrier_views.xml",
],
"installable": True,
"license": "AGPL-3",
}
38 changes: 38 additions & 0 deletions sale_order_warehouse_from_delivery_carrier/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_order_warehouse_from_delivery_carrier
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-07-30 16:58+0000\n"
"Last-Translator: mymage <[email protected]>\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 5.6.2\n"

#. module: sale_order_warehouse_from_delivery_carrier
#: model:ir.model.fields,help:sale_order_warehouse_from_delivery_carrier.field_delivery_carrier__so_warehouse_id
msgid "Default warehouse for the sales order that uses this delivery carrier"
msgstr ""
"Il magazzino predefinito per gli ordini di vendita che usano questo corriere"

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

#. module: sale_order_warehouse_from_delivery_carrier
#: model:ir.model.fields,field_description:sale_order_warehouse_from_delivery_carrier.field_delivery_carrier__so_warehouse_id
msgid "Sales Order Warehouse"
msgstr "Magazzino ordine di vendita"

#. module: sale_order_warehouse_from_delivery_carrier
#: model:ir.model,name:sale_order_warehouse_from_delivery_carrier.model_delivery_carrier
msgid "Shipping Methods"
msgstr "Metodi di spedizione"
36 changes: 36 additions & 0 deletions sale_order_warehouse_from_delivery_carrier/i18n/nl.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_order_warehouse_from_delivery_carrier
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 17.0+e\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-08-06 07:52+0000\n"
"PO-Revision-Date: 2024-08-06 07:52+0000\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_order_warehouse_from_delivery_carrier
#: model:ir.model.fields,help:sale_order_warehouse_from_delivery_carrier.field_delivery_carrier__so_warehouse_id
msgid "Default warehouse for the sales order that uses this delivery carrier"
msgstr "Standaard magazijn voor de verkooporder die deze verzendwijze gebruikt"

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

#. module: sale_order_warehouse_from_delivery_carrier
#: model:ir.model.fields,field_description:sale_order_warehouse_from_delivery_carrier.field_delivery_carrier__so_warehouse_id
msgid "Sales Order Warehouse"
msgstr "Verkooporder magazijn"

#. module: sale_order_warehouse_from_delivery_carrier
#: model:ir.model,name:sale_order_warehouse_from_delivery_carrier.model_delivery_carrier
msgid "Shipping Methods"
msgstr "Verzendwijzes"
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:
# * sale_order_warehouse_from_delivery_carrier
#
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_order_warehouse_from_delivery_carrier
#: model:ir.model.fields,help:sale_order_warehouse_from_delivery_carrier.field_delivery_carrier__so_warehouse_id
msgid "Default warehouse for the sales order that uses this delivery carrier"
msgstr ""

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

#. module: sale_order_warehouse_from_delivery_carrier
#: model:ir.model.fields,field_description:sale_order_warehouse_from_delivery_carrier.field_delivery_carrier__so_warehouse_id
msgid "Sales Order Warehouse"
msgstr ""

#. module: sale_order_warehouse_from_delivery_carrier
#: model:ir.model,name:sale_order_warehouse_from_delivery_carrier.model_delivery_carrier
msgid "Shipping Methods"
msgstr ""
2 changes: 2 additions & 0 deletions sale_order_warehouse_from_delivery_carrier/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import delivery_carrier
from . import sale_order
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from odoo import fields, models


class DeliveryCarrier(models.Model):
_inherit = "delivery.carrier"

so_warehouse_id = fields.Many2one(
comodel_name="stock.warehouse",
string="Sales Order Warehouse",
help="Default warehouse for the sales order that uses this delivery carrier",
)
19 changes: 19 additions & 0 deletions sale_order_warehouse_from_delivery_carrier/models/sale_order.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from odoo import api, models


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

@api.depends("user_id", "company_id", "carrier_id")
def _compute_warehouse_id(self):
# Set warehouse by shipping method
so_with_shipping = self.browse()
for order in self:
if (
order.state == "draft"
and order.carrier_id
and order.carrier_id.so_warehouse_id
):
order.warehouse_id = order.carrier_id.so_warehouse_id
so_with_shipping |= order
return super(SaleOrder, self - so_with_shipping)._compute_warehouse_id()
3 changes: 3 additions & 0 deletions sale_order_warehouse_from_delivery_carrier/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Go to Sales -\> Settings -\> Shipping methods and select a shipping
method

Set warehouse in the "Sales Order Warehouse" field.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- Cetmix \<cetmix.com\>
- Ivan Sokolov
- Maksim Shurupov
- Codeforward (https://www.codeforward.nl):
- Sander Lienaerts <[email protected]>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This module allows to set warehouse in Sales Order based on selected
shipping method.
7 changes: 7 additions & 0 deletions sale_order_warehouse_from_delivery_carrier/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Create a new quotation and select a shipping method.

If selected shipping method has a sales order warehouse defined this
warehouse will be automatically set in the quotation.

**Note**: The warehouse will NOT be updated if the sales order is
already confirmed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 8549848

Please sign in to comment.