[ADD] stock_picking_zip module
This commit is contained in:
1
stock_picking_zip/__init__.py
Normal file
1
stock_picking_zip/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from . import stock
|
||||
26
stock_picking_zip/__openerp__.py
Normal file
26
stock_picking_zip/__openerp__.py
Normal file
@@ -0,0 +1,26 @@
|
||||
# coding: utf-8
|
||||
# © 2016 David BEAL
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
{
|
||||
'name': 'Stock Picking Zip',
|
||||
'summary': "Allow to group picking list by zip code",
|
||||
'version': '8.0.0.0.1',
|
||||
'category': 'stock',
|
||||
'author': 'Akretion',
|
||||
'description': """
|
||||
Allow to group picking list by zip code
|
||||
|
||||
|
||||
Author: David BEAL
|
||||
""",
|
||||
'depends': [
|
||||
'stock',
|
||||
],
|
||||
'website': 'http://www.akretion.com/',
|
||||
'data': [
|
||||
'stock_view.xml',
|
||||
],
|
||||
'installable': True,
|
||||
'license': 'AGPL-3',
|
||||
}
|
||||
39
stock_picking_zip/i18n/fr.po
Normal file
39
stock_picking_zip/i18n/fr.po
Normal file
@@ -0,0 +1,39 @@
|
||||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * stock_picking_zip
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 8.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2016-09-21 10:46+0000\n"
|
||||
"PO-Revision-Date: 2016-09-21 12:47+0200\n"
|
||||
"Last-Translator: <>\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: \n"
|
||||
"Language: fr\n"
|
||||
"X-Generator: Poedit 1.8.7.1\n"
|
||||
|
||||
#. module: stock_picking_zip
|
||||
#: view:stock.picking:stock_picking_zip.view_picking_internal_search
|
||||
msgid "Group By"
|
||||
msgstr "Grouper par"
|
||||
|
||||
#. module: stock_picking_zip
|
||||
#: model:ir.model,name:stock_picking_zip.model_stock_picking
|
||||
msgid "Picking List"
|
||||
msgstr "Liste de livraison"
|
||||
|
||||
#. module: stock_picking_zip
|
||||
#: help:stock.picking,short_zip:0
|
||||
msgid "Troncated zip code to a limited chars number allowing group by"
|
||||
msgstr "Code postal tronqué permettant de faire des regroupements"
|
||||
|
||||
#. module: stock_picking_zip
|
||||
#: view:stock.picking:stock_picking_zip.view_picking_internal_search
|
||||
#: field:stock.picking,short_zip:0
|
||||
msgid "Zip"
|
||||
msgstr "Code P."
|
||||
38
stock_picking_zip/i18n/stock_picking_zip.pot
Normal file
38
stock_picking_zip/i18n/stock_picking_zip.pot
Normal file
@@ -0,0 +1,38 @@
|
||||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * stock_picking_zip
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 8.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2016-09-21 10:46+0000\n"
|
||||
"PO-Revision-Date: 2016-09-21 10:46+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_picking_zip
|
||||
#: view:stock.picking:stock_picking_zip.view_picking_internal_search
|
||||
msgid "Group By"
|
||||
msgstr ""
|
||||
|
||||
#. module: stock_picking_zip
|
||||
#: model:ir.model,name:stock_picking_zip.model_stock_picking
|
||||
msgid "Picking List"
|
||||
msgstr ""
|
||||
|
||||
#. module: stock_picking_zip
|
||||
#: help:stock.picking,short_zip:0
|
||||
msgid "Troncated zip code to a limited chars number allowing group by"
|
||||
msgstr ""
|
||||
|
||||
#. module: stock_picking_zip
|
||||
#: view:stock.picking:stock_picking_zip.view_picking_internal_search
|
||||
#: field:stock.picking,short_zip:0
|
||||
msgid "Zip"
|
||||
msgstr ""
|
||||
|
||||
24
stock_picking_zip/stock.py
Normal file
24
stock_picking_zip/stock.py
Normal file
@@ -0,0 +1,24 @@
|
||||
# coding: utf-8
|
||||
# © 2016 David BEAL @ Akretion <david.beal@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from openerp import models, fields, api
|
||||
|
||||
|
||||
class StockPicking(models.Model):
|
||||
_inherit = 'stock.picking'
|
||||
|
||||
short_zip = fields.Char(
|
||||
string='Zip', compute='_compute_short_zip', store=True,
|
||||
help="Troncated zip code to a limited chars number allowing group by")
|
||||
|
||||
def _set_short_zip_size(self):
|
||||
""" if zip is 69100, then short zip is 69 """
|
||||
return 2
|
||||
|
||||
@api.depends('partner_id')
|
||||
@api.multi
|
||||
def _compute_short_zip(self):
|
||||
for rec in self:
|
||||
if rec.partner_id and rec.partner_id.zip:
|
||||
rec.short_zip = rec.partner_id.zip[:self._set_short_zip_size()]
|
||||
30
stock_picking_zip/stock_view.xml
Normal file
30
stock_picking_zip/stock_view.xml
Normal file
@@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
|
||||
<record id="vpicktree" model="ir.ui.view">
|
||||
<field name="model">stock.picking</field>
|
||||
<field name="inherit_id" ref="stock.vpicktree"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="partner_id" position="after">
|
||||
<field name="short_zip"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_picking_internal_search" model="ir.ui.view">
|
||||
<field name="model">stock.picking</field>
|
||||
<field name="inherit_id" ref="stock.view_picking_internal_search"/>
|
||||
<field name="arch" type="xml">
|
||||
<group string="Group By" position="inside">
|
||||
<filter string="Zip" domain="[]" context="{'group_by':'short_zip'}"/>
|
||||
</group>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
Reference in New Issue
Block a user