Skip to content

Commit

Permalink
[8.0.1.0.0] stock_picking_wave_interval
Browse files Browse the repository at this point in the history
  • Loading branch information
andhit-r committed Jan 27, 2018
1 parent 439658a commit 39a8eb3
Show file tree
Hide file tree
Showing 7 changed files with 159 additions and 0 deletions.
48 changes: 48 additions & 0 deletions stock_picking_wave_interval/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3

=====================
Picking Wave Interval
=====================

This module adds (1) date start, and (2) date end on picking wave

Installation
============

To install this module, you need to:

1. Clone the branch 8.0 of the repository https://github.com/open-synergy/opnsynid-stock-logistics-workflow
2. Add the path to this repository in your configuration (addons-path)
3. Update the module list
4. Go to menu *Setting -> Modules -> Local Modules*
5. Search For *Picking Wave Interval*
6. Install the module

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

Bugs are tracked on `GitHub Issues
<https://github.com/open-synergy/opnsynid-stock-logistics-workflow/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.


Credits
=======

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

* Michael Viriyananda <viriyananda.michael@gmail.com>

Maintainer
----------

.. image:: https://opensynergy-indonesia.com/logo.png
:alt: OpenSynergy Indonesia
:target: https://opensynergy-indonesia.com

This module is maintained by the OpenSynergy Indonesia.
5 changes: 5 additions & 0 deletions stock_picking_wave_interval/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2018 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import models
19 changes: 19 additions & 0 deletions stock_picking_wave_interval/__openerp__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
# Copyright 2018 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Picking Wave Interval",
"version": "8.0.1.0.0",
"summary": "Add start date and end date on picking wave",
"category": "Stock Management",
"website": "https://opensynergy-indonesia.com",
"author": "OpenSynergy Indonesia",
"license": "AGPL-3",
"installable": True,
"depends": [
"stock_picking_wave",
],
"data": [
"views/stock_picking_wave_view.xml",
],
}
5 changes: 5 additions & 0 deletions stock_picking_wave_interval/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2018 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import stock_picking_wave
50 changes: 50 additions & 0 deletions stock_picking_wave_interval/models/stock_picking_wave.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# -*- coding: utf-8 -*-
# Copyright 2018 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from openerp import models, fields, api
from openerp.exceptions import Warning as UserError
from openerp.tools.translate import _


class StockPickingWave(models.Model):
_inherit = "stock.picking.wave"

date_start = fields.Datetime(
string="Date Start",
readonly=True,
states={
"draft": [
("readonly", False),
],
},
)
date_end = fields.Datetime(
string="Date End",
readonly=True,
states={
"draft": [
("readonly", False),
],
},
)

@api.constrains(
"date_start", "date_end")
def _check_wave_interval(self):
strWarning1 = _(
"Date End must be greater than Date Start")
strWarning2 = _(
"Date Start required")
strWarning3 = _(
"Date End required")

if self.date_start and not self.date_end:
raise UserError(strWarning3)

if not self.date_start and self.date_end:
raise UserError(strWarning2)

if self.date_start and self.date_end:
if self.date_start > self.date_end:
raise UserError(strWarning1)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 32 additions & 0 deletions stock_picking_wave_interval/views/stock_picking_wave_view.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="stock_picking_wave_view_form" model="ir.ui.view">
<field name="name">Stock Picking Wave Form</field>
<field name="model">stock.picking.wave</field>
<field name="inherit_id" ref="stock_picking_wave.view_picking_wave_form"/>
<field name="arch" type="xml">
<data>
<xpath expr="//field[@name='user_id']" position="after">
<field name="date_start"/>
<field name="date_end"/>
</xpath>
</data>
</field>
</record>

<record id="stock_picking_wave_view_tree" model="ir.ui.view">
<field name="name">Stock Picking Wave Tree</field>
<field name="model">stock.picking.wave</field>
<field name="inherit_id" ref="stock_picking_wave.view_picking_wave_tree"/>
<field name="arch" type="xml">
<data>
<xpath expr="//field[@name='user_id']" position="after">
<field name="date_start"/>
<field name="date_end"/>
</xpath>
</data>
</field>
</record>
</data>
</openerp>

0 comments on commit 39a8eb3

Please sign in to comment.