Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MIG]Migrate stock_picking_customer_ref #476

Merged
merged 11 commits into from
Feb 6, 2019
Next Next commit
[ADD] stock_picking_customer_ref
alfredo authored and bizzappdev committed Nov 25, 2018
commit 5c9e710d07ab3c9bd7765b181e7742ee683c22ee
15 changes: 15 additions & 0 deletions stock_picking_customer_ref/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Stock picking customer reference
================================

This module displays in the pickings, the sale reference/description, also
allows you to filter and search for this new field.

Credits
=======

Contributors
------------
* Pedro M. Baeza <[email protected]
* Ana Juaristi <[email protected]>
* Mikel Arregi <[email protected]>
* Alfredo de la Fuente <[email protected]>
5 changes: 5 additions & 0 deletions stock_picking_customer_ref/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in root directory
##############################################################################
from . import models
34 changes: 34 additions & 0 deletions stock_picking_customer_ref/__openerp__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c)
# 2015 Serv. Tec. Avanzados - Pedro M. Baeza (http://www.serviciosbaeza.com)
# 2015 AvanzOsc (http://www.avanzosc.es)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
{
'name': "Stock Picking Customer Ref",
'version': "1.0",
"author": "OdooMRP team",
'website': "http://www.odoomrp.com",
'category': 'Warehouse Management',
"depends": ["sale",
"stock",
"sale_stock"
],
'data': ["views/stock_picking_view.xml"],
"installable": True,
}
37 changes: 37 additions & 0 deletions stock_picking_customer_ref/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_picking_customer_ref
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-03-03 15:53+0000\n"
"PO-Revision-Date: 2015-03-03 16:54+0100\n"
"Last-Translator: Alfredo <[email protected]>\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"

#. module: stock_picking_customer_ref
#: view:stock.picking:stock_picking_customer_ref.view_picking_internal_search_inh_customerinfo
msgid "Client order reference"
msgstr "Referencia pedido cliente"

#. module: stock_picking_customer_ref
#: view:stock.picking:stock_picking_customer_ref.view_picking_internal_search_inh_customerinfo
msgid "Origin"
msgstr "Origen"

#. module: stock_picking_customer_ref
#: model:ir.model,name:stock_picking_customer_ref.model_stock_picking
msgid "Picking List"
msgstr "Albarán"

#. module: stock_picking_customer_ref
#: field:stock.picking,client_order_ref:0
msgid "Sale Reference/Description"
msgstr "Referencia/Descripción venta"

37 changes: 37 additions & 0 deletions stock_picking_customer_ref/i18n/stock_picking_customer_ref.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_picking_customer_ref
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-03-03 15:53+0000\n"
"PO-Revision-Date: 2015-03-03 15:53+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_customer_ref
#: view:stock.picking:stock_picking_customer_ref.view_picking_internal_search_inh_customerinfo
msgid "Client order reference"
msgstr ""

#. module: stock_picking_customer_ref
#: view:stock.picking:stock_picking_customer_ref.view_picking_internal_search_inh_customerinfo
msgid "Origin"
msgstr ""

#. module: stock_picking_customer_ref
#: model:ir.model,name:stock_picking_customer_ref.model_stock_picking
msgid "Picking List"
msgstr ""

#. module: stock_picking_customer_ref
#: field:stock.picking,client_order_ref:0
msgid "Sale Reference/Description"
msgstr ""

5 changes: 5 additions & 0 deletions stock_picking_customer_ref/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in root directory
##############################################################################
from . import stock_picking
23 changes: 23 additions & 0 deletions stock_picking_customer_ref/models/stock_picking.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in root directory
##############################################################################
from openerp import fields, models, api


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

@api.one
@api.depends('group_id', 'sale_id', 'sale_id.client_order_ref')
def _calculate_client_order_ref(self):
sale_obj = self.env['sale.order']
self.client_order_ref = ''
if self.group_id:
cond = [('procurement_group_id', '=', self.group_id.id)]
sale = sale_obj.search(cond, limit=1)
self.client_order_ref = sale.client_order_ref

client_order_ref = fields.Char(
string="Sale Reference/Description",
compute="_calculate_client_order_ref", store=True)
37 changes: 37 additions & 0 deletions stock_picking_customer_ref/views/stock_picking_view.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<openerp>
<data>
<record model="ir.ui.view" id="vpicktree_inh_customerinfo">
<field name="name">vpicktree.inh.customerinfo</field>
<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="client_order_ref" />
</field>
</field>
</record>
<record model="ir.ui.view" id="view_picking_form_inh_customerinfo">
<field name="name">view.picking.form.inh.customerinfo</field>
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.view_picking_form" />
<field name="arch" type="xml">
<field name="group_id" position="after">
<field name="client_order_ref" attrs="{'invisible':[('client_order_ref', '=', False)]}" />
</field>
</field>
</record>
<record model="ir.ui.view" id="view_picking_internal_search_inh_customerinfo">
<field name="name">view.picking.internal.search.inh.customerinfo</field>
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.view_picking_internal_search" />
<field name="arch" type="xml">
<field name="partner_id" position="after">
<field name="client_order_ref" />
</field>
<filter string="Origin" position="before">
<filter string="Client order reference" domain="[]" context="{'group_by':'client_order_ref'}"/>
</filter>
</field>
</record>
</data>
</openerp>