diff --git a/sale_stock_operating_unit/README.rst b/sale_stock_operating_unit/README.rst index ad0150cc14..435b6d21eb 100644 --- a/sale_stock_operating_unit/README.rst +++ b/sale_stock_operating_unit/README.rst @@ -14,13 +14,13 @@ Operating Unit in Sales Stock :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html :alt: License: LGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Foperating--unit-lightgray.png?logo=github - :target: https://github.com/OCA/operating-unit/tree/15.0/sale_stock_operating_unit + :target: https://github.com/OCA/operating-unit/tree/16.0/sale_stock_operating_unit :alt: OCA/operating-unit .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/operating-unit-15-0/operating-unit-15-0-sale_stock_operating_unit + :target: https://translation.odoo-community.org/projects/operating-unit-16-0/operating-unit-16-0-sale_stock_operating_unit :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/213/15.0 + :target: https://runbot.odoo-community.org/runbot/213/16.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| @@ -59,7 +59,7 @@ Bug Tracker Bugs are tracked on `GitHub 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 `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -78,6 +78,7 @@ Contributors * Eficent Business and IT Consulting Services S.L. * Serpent Consulting Services Pvt. Ltd. * Alejandro Padrón +* Alan Ramos Maintainers ~~~~~~~~~~~ @@ -92,6 +93,6 @@ 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/operating-unit `_ project on GitHub. +This module is part of the `OCA/operating-unit `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/sale_stock_operating_unit/__manifest__.py b/sale_stock_operating_unit/__manifest__.py index d85680de17..09d328cbfc 100644 --- a/sale_stock_operating_unit/__manifest__.py +++ b/sale_stock_operating_unit/__manifest__.py @@ -7,7 +7,7 @@ "name": "Operating Unit in Sales Stock", "summary": "An operating unit (OU) is an organizational entity part of a " "company", - "version": "15.0.1.0.0", + "version": "16.0.1.0.0", "author": "Eficent, Serpent Consulting Services Pvt. Ltd., " "Odoo Community Association (OCA)", "license": "LGPL-3", diff --git a/sale_stock_operating_unit/models/sale_order.py b/sale_stock_operating_unit/models/sale_order.py index a54dca31a3..d9f75ad5c2 100644 --- a/sale_stock_operating_unit/models/sale_order.py +++ b/sale_stock_operating_unit/models/sale_order.py @@ -2,7 +2,7 @@ # Jordi Ballester Alomar # Copyright 2015-19 Serpent Consulting Services Pvt. Ltd. - Sudhir Arya # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). -from odoo import SUPERUSER_ID, _, api, fields, models +from odoo import _, api, fields, models from odoo.exceptions import ValidationError @@ -11,14 +11,14 @@ class SaleOrder(models.Model): @api.model def _default_warehouse_id(self): - res = super(SaleOrder, self)._default_warehouse_id() + res = super()._default_warehouse_id() team = self._get_default_team() warehouses = self.env["stock.warehouse"].search( [ ( "operating_unit_id", "=", - team.with_user(SUPERUSER_ID).operating_unit_id.id, + team.sudo().operating_unit_id.id, ) ], limit=1, @@ -32,8 +32,7 @@ def _default_warehouse_id(self): ) @api.onchange("team_id") - def onchange_team_id(self): - res = super(SaleOrder, self).onchange_team_id() + def _onchange_team_id(self): if ( self.team_id and self.team_id.operating_unit_id @@ -46,10 +45,8 @@ def onchange_team_id(self): if warehouses: self.warehouse_id = warehouses[0] - return res - @api.onchange("operating_unit_id") - def onchange_operating_unit_id(self): + def _onchange_operating_unit_id(self): if ( self.operating_unit_id and self.operating_unit_id.id != self.warehouse_id.operating_unit_id.id @@ -61,7 +58,7 @@ def onchange_operating_unit_id(self): self.warehouse_id = warehouses[0] @api.onchange("warehouse_id") - def onchange_warehouse_id(self): + def _onchange_warehouse_id(self): if self.warehouse_id: self.operating_unit_id = self.warehouse_id.operating_unit_id if ( diff --git a/sale_stock_operating_unit/models/stock_move.py b/sale_stock_operating_unit/models/stock_move.py index 77747419e2..cd0a93a083 100644 --- a/sale_stock_operating_unit/models/stock_move.py +++ b/sale_stock_operating_unit/models/stock_move.py @@ -12,7 +12,7 @@ def _get_new_picking_values(self): """ Override to add Operating Units to Picking. """ - values = super(StockMove, self)._get_new_picking_values() + values = super()._get_new_picking_values() values.update( { diff --git a/sale_stock_operating_unit/readme/CONTRIBUTORS.rst b/sale_stock_operating_unit/readme/CONTRIBUTORS.rst index 076ca13fda..b6987b7d99 100644 --- a/sale_stock_operating_unit/readme/CONTRIBUTORS.rst +++ b/sale_stock_operating_unit/readme/CONTRIBUTORS.rst @@ -1,3 +1,4 @@ * Eficent Business and IT Consulting Services S.L. * Serpent Consulting Services Pvt. Ltd. * Alejandro Padrón +* Alan Ramos diff --git a/sale_stock_operating_unit/static/description/index.html b/sale_stock_operating_unit/static/description/index.html index f976e79c6b..42bae34865 100644 --- a/sale_stock_operating_unit/static/description/index.html +++ b/sale_stock_operating_unit/static/description/index.html @@ -3,7 +3,7 @@ - + Operating Unit in Sales Stock