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
96 changes: 96 additions & 0 deletions stock_request_partner/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

=====================
Stock Request Partner
=====================

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

.. |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/license-LGPL--3-blue.png
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fstock--logistics--request-lightgray.png?logo=github
:target: https://github.com/OCA/stock-logistics-request/tree/19.0/stock_request_partner
:alt: OCA/stock-logistics-request
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/stock-logistics-request-19-0/stock-logistics-request-19-0-stock_request_partner
: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/stock-logistics-request&target_branch=19.0
:alt: Try me on Runboat

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

This module was written to allow to define partner in stock request and
pass the partner to the related pickings.

**Table of contents**

.. contents::
:local:

Usage
=====

## Creation

- Go to 'Stock Requests / Stock Requests' and create a new Request.
- Indicate a partner, product, quantity and location.
- Press 'Confirm'.

In case that transfers are created, if the partner is set, a procurement
group will be created automatically with the related partner and it will
be propagated to the related transfers.

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/stock-logistics-request/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/stock-logistics-request/issues/new?body=module:%20stock_request_partner%0Aversion:%2019.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
-------

* Jarsa

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

- `Jarsa <https://www.jarsa.com.mx>`__

- Alan Ramos <alan.ramos@jarsa.com.mx>

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/stock-logistics-request <https://github.com/OCA/stock-logistics-request/tree/19.0/stock_request_partner>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
4 changes: 4 additions & 0 deletions stock_request_partner/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright 2020 Jarsa Sistemas, S.A. de C.V.
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).

from . import models
17 changes: 17 additions & 0 deletions stock_request_partner/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright 2020 Jarsa Sistemas, S.A. de C.V.
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).

{
"name": "Stock Request Partner",
"summary": "Allow to define partner in Stock Request",
"version": "19.0.1.0.0",
"license": "LGPL-3",
"website": "https://github.com/OCA/stock-logistics-request",
"author": "Jarsa, Odoo Community Association (OCA)",
"category": "Warehouse Management",
"depends": ["stock_request"],
"data": [
"views/stock_request_views.xml",
"views/stock_request_order_views.xml",
],
}
57 changes: 57 additions & 0 deletions stock_request_partner/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_request_partner
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-05-15 19:34+0000\n"
"Last-Translator: Francesco Foresti <francesco.foresti@ooops404.com>\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.14.1\n"

#. module: stock_request_partner
#: model:ir.model.fields,field_description:stock_request_partner.field_stock_request__display_name
#: model:ir.model.fields,field_description:stock_request_partner.field_stock_request_order__display_name
msgid "Display Name"
msgstr "Nome visualizzato"

#. module: stock_request_partner
#: model:ir.model.fields,field_description:stock_request_partner.field_stock_request__id
#: model:ir.model.fields,field_description:stock_request_partner.field_stock_request_order__id
msgid "ID"
msgstr "ID"

#. module: stock_request_partner
#: model:ir.model.fields,field_description:stock_request_partner.field_stock_request____last_update
#: model:ir.model.fields,field_description:stock_request_partner.field_stock_request_order____last_update
msgid "Last Modified on"
msgstr "Ultima modifica il"

#. module: stock_request_partner
#: model:ir.model.fields,field_description:stock_request_partner.field_stock_request__partner_id
#: model:ir.model.fields,field_description:stock_request_partner.field_stock_request_order__partner_id
msgid "Partner"
msgstr "Partner"

#. module: stock_request_partner
#: code:addons/stock_request_partner/models/stock_request.py:0
#, python-format
msgid "Partner must be equal to the order"
msgstr "Il partner deve essere lo stesso dell'ordine"

#. module: stock_request_partner
#: model:ir.model,name:stock_request_partner.model_stock_request
msgid "Stock Request"
msgstr "Richiesta di magazzino"

#. module: stock_request_partner
#: model:ir.model,name:stock_request_partner.model_stock_request_order
msgid "Stock Request Order"
msgstr "Ordine richiesta di magazzino"
54 changes: 54 additions & 0 deletions stock_request_partner/i18n/stock_request_partner.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_request_partner
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.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: stock_request_partner
#: model:ir.model.fields,field_description:stock_request_partner.field_stock_request__display_name
#: model:ir.model.fields,field_description:stock_request_partner.field_stock_request_order__display_name
msgid "Display Name"
msgstr ""

#. module: stock_request_partner
#: model:ir.model.fields,field_description:stock_request_partner.field_stock_request__id
#: model:ir.model.fields,field_description:stock_request_partner.field_stock_request_order__id
msgid "ID"
msgstr ""

#. module: stock_request_partner
#: model:ir.model.fields,field_description:stock_request_partner.field_stock_request____last_update
#: model:ir.model.fields,field_description:stock_request_partner.field_stock_request_order____last_update
msgid "Last Modified on"
msgstr ""

#. module: stock_request_partner
#: model:ir.model.fields,field_description:stock_request_partner.field_stock_request__partner_id
#: model:ir.model.fields,field_description:stock_request_partner.field_stock_request_order__partner_id
msgid "Partner"
msgstr ""

#. module: stock_request_partner
#: code:addons/stock_request_partner/models/stock_request.py:0
#, python-format
msgid "Partner must be equal to the order"
msgstr ""

#. module: stock_request_partner
#: model:ir.model,name:stock_request_partner.model_stock_request
msgid "Stock Request"
msgstr ""

#. module: stock_request_partner
#: model:ir.model,name:stock_request_partner.model_stock_request_order
msgid "Stock Request Order"
msgstr ""
5 changes: 5 additions & 0 deletions stock_request_partner/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright 2020 Jarsa Sistemas, S.A. de C.V.
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).

from . import stock_request
from . import stock_request_order
25 changes: 25 additions & 0 deletions stock_request_partner/models/stock_request.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright 2020 Jarsa Sistemas, S.A. de C.V.
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).

from odoo import api, fields, models
from odoo.exceptions import ValidationError


class StockRequest(models.Model):
_inherit = "stock.request"

partner_id = fields.Many2one(
"res.partner",
)

def _prepare_procurement_values(self, reference_ids=False):
res = super()._prepare_procurement_values(reference_ids=reference_ids)
if self.partner_id:
res["partner_id"] = self.partner_id.id
return res

@api.constrains("order_id", "partner_id")
def check_order_partner_id(self):
for rec in self:
if rec.order_id and rec.order_id.partner_id != rec.partner_id:
raise ValidationError(self.env._("Partner must be equal to the order"))
21 changes: 21 additions & 0 deletions stock_request_partner/models/stock_request_order.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2020 Jarsa Sistemas, S.A. de C.V.
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).

from odoo import api, fields, models


class StockRequestOrder(models.Model):
_inherit = "stock.request.order"

partner_id = fields.Many2one(
"res.partner",
)

@api.onchange("partner_id")
def _onchange_partner_id(self):
if self.partner_id:
self.stock_request_ids.update(
{
"partner_id": self.partner_id,
}
)
3 changes: 3 additions & 0 deletions stock_request_partner/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 stock_request_partner/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- [Jarsa](https://www.jarsa.com.mx)
- Alan Ramos \<<alan.ramos@jarsa.com.mx>\>
2 changes: 2 additions & 0 deletions stock_request_partner/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This module was written to allow to define partner in stock request and
pass the partner to the related pickings.
9 changes: 9 additions & 0 deletions stock_request_partner/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
\## Creation

- Go to 'Stock Requests / Stock Requests' and create a new Request.
- Indicate a partner, product, quantity and location.
- Press 'Confirm'.

In case that transfers are created, if the partner is set, a procurement
group will be created automatically with the related partner and it will
be propagated to the related transfers.
Binary file added stock_request_partner/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading