-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TA#61864 [ADD] stock_orderpoint_scheduled_date
- Loading branch information
Showing
18 changed files
with
273 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
Stock Orderpoint Scheduled Date | ||
=============================== | ||
|
||
.. contents:: Table of Contents | ||
|
||
Context | ||
------- | ||
|
||
This module allows user to set a scheduled date manuelly to replanish stock. | ||
|
||
Description | ||
----------- | ||
As a user with access right to `Inventory > Operations > Replanishment`, I can see a new field in the list view: | ||
|
||
.. image:: static/description/replanishment_tree_view.png | ||
|
||
You can assign in mass the Scheduled Date to a selection of records using the server action `Set Scheduled Date`: | ||
|
||
.. image:: static/description/set_scheduled_date_action.png | ||
|
||
.. image:: static/description/set_schedule_date_wizard.png | ||
|
||
Contributors | ||
------------ | ||
* Numigi (tm) and all its contributors (https://bit.ly/numigiens) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# © 2024 - today Numigi (tm) and all its contributors (https://bit.ly/numigiens) | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from . import models | ||
from . import wizard |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# © 2024 - today Numigi (tm) and all its contributors (https://bit.ly/numigiens) | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
{ | ||
"name": "Stock Orderpoint Scheduled Date", | ||
"summary": "Force Scheduled Date in Stock Orderpoint", | ||
"version": "14.0.1.0.0", | ||
"category": "stock", | ||
"website": "https://bit.ly/numigi-com", | ||
"author": "Numigi", | ||
"license": "AGPL-3", | ||
"application": False, | ||
"installable": True, | ||
"depends": ["stock"], | ||
"data": [ | ||
"security/ir.model.access.csv", | ||
"views/stock_orderpoint_views.xml", | ||
"wizard/stock_warehouse_orderpoint_schedule_date.xml" | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * stock_orderpoint_scheduled_date | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 14.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2024-04-02 20:21+0000\n" | ||
"PO-Revision-Date: 2024-04-02 20:21+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: stock_orderpoint_scheduled_date | ||
#: model_terms:ir.ui.view,arch_db:stock_orderpoint_scheduled_date.stock_warehouse_orderpoint_schedule_date_form | ||
msgid "Cancel" | ||
msgstr "Annuler" | ||
|
||
#. module: stock_orderpoint_scheduled_date | ||
#: model:ir.model.fields,field_description:stock_orderpoint_scheduled_date.field_stock_warehouse_orderpoint_schedule_date__create_uid | ||
msgid "Created by" | ||
msgstr "Créé par" | ||
|
||
#. module: stock_orderpoint_scheduled_date | ||
#: model:ir.model.fields,field_description:stock_orderpoint_scheduled_date.field_stock_warehouse_orderpoint_schedule_date__create_date | ||
msgid "Created on" | ||
msgstr "Créé le" | ||
|
||
#. module: stock_orderpoint_scheduled_date | ||
#: model:ir.model.fields,field_description:stock_orderpoint_scheduled_date.field_stock_warehouse_orderpoint__display_name | ||
#: model:ir.model.fields,field_description:stock_orderpoint_scheduled_date.field_stock_warehouse_orderpoint_schedule_date__display_name | ||
msgid "Display Name" | ||
msgstr "Nom d'affichage" | ||
|
||
#. module: stock_orderpoint_scheduled_date | ||
#: model:ir.model.fields,field_description:stock_orderpoint_scheduled_date.field_stock_warehouse_orderpoint__id | ||
#: model:ir.model.fields,field_description:stock_orderpoint_scheduled_date.field_stock_warehouse_orderpoint_schedule_date__id | ||
msgid "ID" | ||
msgstr "" | ||
|
||
#. module: stock_orderpoint_scheduled_date | ||
#: model:ir.model.fields,field_description:stock_orderpoint_scheduled_date.field_stock_warehouse_orderpoint____last_update | ||
#: model:ir.model.fields,field_description:stock_orderpoint_scheduled_date.field_stock_warehouse_orderpoint_schedule_date____last_update | ||
msgid "Last Modified on" | ||
msgstr "Dernière modification le" | ||
|
||
#. module: stock_orderpoint_scheduled_date | ||
#: model:ir.model.fields,field_description:stock_orderpoint_scheduled_date.field_stock_warehouse_orderpoint_schedule_date__write_uid | ||
msgid "Last Updated by" | ||
msgstr "" | ||
|
||
#. module: stock_orderpoint_scheduled_date | ||
#: model:ir.model.fields,field_description:stock_orderpoint_scheduled_date.field_stock_warehouse_orderpoint_schedule_date__write_date | ||
msgid "Last Updated on" | ||
msgstr "" | ||
|
||
#. module: stock_orderpoint_scheduled_date | ||
#: model:ir.model,name:stock_orderpoint_scheduled_date.model_stock_warehouse_orderpoint | ||
msgid "Minimum Inventory Rule" | ||
msgstr "Règle de stock minimum." | ||
|
||
#. module: stock_orderpoint_scheduled_date | ||
#: model:ir.model.fields,field_description:stock_orderpoint_scheduled_date.field_stock_warehouse_orderpoint_schedule_date__orderpoint_ids | ||
msgid "Order Points" | ||
msgstr "" | ||
|
||
#. module: stock_orderpoint_scheduled_date | ||
#: model:ir.model,name:stock_orderpoint_scheduled_date.model_stock_warehouse_orderpoint_schedule_date | ||
msgid "Replanishment Schedule Date wizard" | ||
msgstr "" | ||
|
||
#. module: stock_orderpoint_scheduled_date | ||
#: model:ir.model.fields,field_description:stock_orderpoint_scheduled_date.field_stock_warehouse_orderpoint__scheduled_date | ||
#: model:ir.model.fields,field_description:stock_orderpoint_scheduled_date.field_stock_warehouse_orderpoint_schedule_date__scheduled_date | ||
msgid "Scheduled Date" | ||
msgstr "Date prévue" | ||
|
||
#. module: stock_orderpoint_scheduled_date | ||
#: code:addons/stock_orderpoint_scheduled_date/models/stock_warehouse_orderpoint.py:0 | ||
#: model_terms:ir.ui.view,arch_db:stock_orderpoint_scheduled_date.stock_warehouse_orderpoint_schedule_date_form | ||
#, python-format | ||
msgid "Set Schedule Date" | ||
msgstr "Définir la date prévue" | ||
|
||
#. module: stock_orderpoint_scheduled_date | ||
#: model:ir.actions.server,name:stock_orderpoint_scheduled_date.action_set_scheduled_date | ||
msgid "Set Scheduled Date" | ||
msgstr "Définir la date prévue" | ||
|
||
#. module: stock_orderpoint_scheduled_date | ||
#: model_terms:ir.ui.view,arch_db:stock_orderpoint_scheduled_date.stock_warehouse_orderpoint_schedule_date_form | ||
msgid "Validate" | ||
msgstr "Valider" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# © 2024 - today Numigi (tm) and all its contributors (https://bit.ly/numigiens) | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from . import stock_warehouse_orderpoint |
27 changes: 27 additions & 0 deletions
27
stock_orderpoint_scheduled_date/models/stock_warehouse_orderpoint.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# © 2024 - today Numigi (tm) and all its contributors (https://bit.ly/numigiens) | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import api, models, fields, _ | ||
|
||
|
||
class stockWarehouseOrderpoint(models.Model): | ||
_inherit = "stock.warehouse.orderpoint" | ||
|
||
scheduled_date = fields.Date("Scheduled Date") | ||
|
||
@api.depends('rule_ids', 'product_id.seller_ids', | ||
'product_id.seller_ids.delay', 'scheduled_date') | ||
def _compute_lead_days(self): | ||
for orderpoint in self.with_context(bypass_delay_description=True): | ||
if not orderpoint.scheduled_date: | ||
return super(stockWarehouseOrderpoint, orderpoint)._compute_lead_days() | ||
else: | ||
orderpoint.lead_days_date = orderpoint.scheduled_date | ||
|
||
def open_set_schedule_date_wizard(self): | ||
wizard = self.env['stock.warehouse.orderpoint.schedule.date'].create({}) | ||
wizard.orderpoint_ids = self | ||
action = wizard.get_formview_action() | ||
action['target'] = 'new' | ||
action['name'] = _('Set Schedule Date') | ||
return action |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink | ||
access_stock_warehouse_orderpoint_schedule_date,access_stock_warehouse_orderpoint_schedule_date,model_stock_warehouse_orderpoint_schedule_date,stock.group_stock_manager,1,1,1,1 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+81.2 KB
stock_orderpoint_scheduled_date/static/description/replanishment_tree_view.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+285 KB
stock_orderpoint_scheduled_date/static/description/set_schedule_date_wizard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+393 KB
stock_orderpoint_scheduled_date/static/description/set_scheduled_date_action.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions
37
stock_orderpoint_scheduled_date/views/stock_orderpoint_views.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<odoo> | ||
<record id="view_warehouse_orderpoint_tree_sheduled_date" model="ir.ui.view"> | ||
<field name="name">stock.warehouse.orderpoint.tree.scheduled.date</field> | ||
<field name="model">stock.warehouse.orderpoint</field> | ||
<field name="inherit_id" ref="stock.view_warehouse_orderpoint_tree_editable"/> | ||
<field name="arch" type="xml"> | ||
<field name="product_uom_name" position="after"> | ||
<field name="scheduled_date"/> | ||
</field> | ||
</field> | ||
</record> | ||
<record id="view_warehouse_orderpoint_form_sheduled_date" model="ir.ui.view"> | ||
<field name="name">stock.warehouse.orderpoint.form.scheduled.date</field> | ||
<field name="model">stock.warehouse.orderpoint</field> | ||
<field name="inherit_id" ref="stock.view_warehouse_orderpoint_form"/> | ||
<field name="arch" type="xml"> | ||
<field name="qty_multiple" position="after"> | ||
<field name="scheduled_date"/> | ||
</field> | ||
</field> | ||
</record> | ||
|
||
<!-- Server action to assign in bulk the scheduled date --> | ||
<record id="action_set_scheduled_date" model="ir.actions.server"> | ||
<field name="name">Set Scheduled Date</field> | ||
<field name="model_id" ref="stock.model_stock_warehouse_orderpoint"/> | ||
<field name="groups_id" eval="[(4, ref('stock.group_stock_manager'))]"/> | ||
<field name="binding_model_id" ref="stock.model_stock_warehouse_orderpoint"/> | ||
<field name="type">ir.actions.server</field> | ||
<field name="state">code</field> | ||
<field name="code"> | ||
action = records.open_set_schedule_date_wizard() | ||
</field> | ||
</record> | ||
|
||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# © 2024 Numigi (tm) and all its contributors (https://bit.ly/numigiens) | ||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). | ||
|
||
from . import stock_warehouse_orderpoint_schedule_date |
25 changes: 25 additions & 0 deletions
25
stock_orderpoint_scheduled_date/wizard/stock_warehouse_orderpoint_schedule_date.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# © 2019 Numigi (tm) and all its contributors (https://bit.ly/numigiens) | ||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). | ||
|
||
from odoo import fields, models | ||
|
||
|
||
class OrderpointScheduleDate(models.TransientModel): | ||
_name = 'stock.warehouse.orderpoint.schedule.date' | ||
_description = "Replanishment Schedule Date wizard" | ||
|
||
orderpoint_ids = fields.Many2many( | ||
'stock.warehouse.orderpoint', | ||
'stock_warehouse_orderpoint_schedule_date_rel', | ||
'wizard_id', | ||
'orderpoint_id', | ||
string='Order Points', | ||
) | ||
scheduled_date = fields.Date("Scheduled Date") | ||
|
||
def validate(self): | ||
self.ensure_one() | ||
self.orderpoint_ids.write({ | ||
'scheduled_date': self.scheduled_date | ||
}) | ||
return True |
24 changes: 24 additions & 0 deletions
24
stock_orderpoint_scheduled_date/wizard/stock_warehouse_orderpoint_schedule_date.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<odoo> | ||
|
||
<record id="stock_warehouse_orderpoint_schedule_date_form" model="ir.ui.view"> | ||
<field name="name">Set Schedule Date Wizard</field> | ||
<field name="model">stock.warehouse.orderpoint.schedule.date</field> | ||
<field name="arch" type="xml"> | ||
<form string="Set Schedule Date"> | ||
<sheet> | ||
<group> | ||
<group> | ||
<field name="scheduled_date"/> | ||
</group> | ||
</group> | ||
</sheet> | ||
<footer> | ||
<button name="validate" class="oe_highlight" string="Validate" type="object"/> | ||
<button string="Cancel" class="btn-secondary" special="cancel"/> | ||
</footer> | ||
</form> | ||
</field> | ||
</record> | ||
|
||
</odoo> |