-
-
Notifications
You must be signed in to change notification settings - Fork 654
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
[ADD] product_customer_code_picking module v.7.0 #2
Changes from all commits
8fce27d
0b9cb10
d764c3d
4f5a279
b856c5e
55ff3dd
8316ec7
fc65e0a
e226a6d
6538923
20ccc37
e21e5ea
eb5d66d
3b6331f
6500715
3ea6bfc
0e74e68
2ed05aa
82ab210
1980c73
c506552
9d39539
9ad6f38
a32321f
7f53727
9954751
bd42b80
8ca8423
8dddffa
447243e
f20a8bc
248de45
baac3c1
a2ea807
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# -*- coding: utf-8 -*- | ||
############################################################################## | ||
# | ||
# Copyright (C) 2013 Agile Business Group sagl (<http://www.agilebg.com>) | ||
# Author: Nicola Malcontenti <nicola.malcontenti@agilebg.com> | ||
# | ||
# 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/>. | ||
# | ||
############################################################################## | ||
from . import stock_picking |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# -*- coding: utf-8 -*- | ||
############################################################################## | ||
# | ||
# Copyright (C) 2013 Agile Business Group sagl (<http://www.agilebg.com>) | ||
# Author: Nicola Malcontenti <nicola.malcontenti@agilebg.com> | ||
# | ||
# 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": "Product Customer code for stock picking", | ||
"version": "1.0", | ||
"author": "Agile Business Group", | ||
"website": "http://www.agilebg.com", | ||
"license": 'AGPL-3', | ||
"category": "Stock", | ||
"depends": [ | ||
'base', | ||
'product', | ||
'stock', | ||
'product_customer_code' | ||
], | ||
"description": """ | ||
This module makes the product customer code visible in the stock moves | ||
of a picking. | ||
|
||
Contributors | ||
------------ | ||
* Nicola Malcontenti <nicola.malcontenti@agilebg.com> | ||
* Alex Comba <alex.comba@agilebg.com> | ||
* Lorenzo Battistini <lorenzo.battistini@agilebg.com> | ||
""", | ||
"demo": [], | ||
"data": [ | ||
'stock_picking_view.xml', | ||
], | ||
"installable": True, | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Translation of OpenERP Server. | ||
# This file contains the translation of the following modules: | ||
# * product_customer_code_picking | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: OpenERP Server 7.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2014-01-15 14:28+0000\n" | ||
"PO-Revision-Date: 2014-01-15 15:29+0100\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: it\n" | ||
"X-Generator: Poedit 1.6.2\n" | ||
|
||
#. module: product_customer_code_picking | ||
#: field:stock.move,product_customer_code:0 | ||
msgid "Product Customer Code" | ||
msgstr "Codice Prodotto Cliente" | ||
|
||
#. module: product_customer_code_picking | ||
#: model:ir.model,name:product_customer_code_picking.model_stock_move | ||
msgid "Stock Move" | ||
msgstr "Movimento di magazzino" | ||
|
||
#. module: product_customer_code_picking | ||
#: model:ir.model,name:product_customer_code_picking.model_stock_picking | ||
msgid "Picking List" | ||
msgstr "Documento di trasporto" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Translation of OpenERP Server. | ||
# This file contains the translation of the following modules: | ||
# * product_customer_code_picking | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: OpenERP Server 7.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2014-01-15 14:28+0000\n" | ||
"PO-Revision-Date: 2014-01-15 14:28+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: product_customer_code_picking | ||
#: field:stock.move,product_customer_code:0 | ||
msgid "Product Customer Code" | ||
msgstr "" | ||
|
||
#. module: product_customer_code_picking | ||
#: model:ir.model,name:product_customer_code_picking.model_stock_move | ||
msgid "Stock Move" | ||
msgstr "" | ||
|
||
#. module: product_customer_code_picking | ||
#: model:ir.model,name:product_customer_code_picking.model_stock_picking | ||
msgid "Picking List" | ||
msgstr "" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# -*- coding: utf-8 -*- | ||
############################################################################## | ||
# | ||
# Copyright (C) 2013 Agile Business Group sagl (<http://www.agilebg.com>) | ||
# Author: Nicola Malcontenti <nicola.malcontenti@agilebg.com> | ||
# | ||
# 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/>. | ||
# | ||
############################################################################## | ||
from openerp.osv import fields, orm | ||
|
||
|
||
class stock_move(orm.Model): | ||
_inherit = 'stock.move' | ||
|
||
def _get_product_customer_code( | ||
self, cr, uid, ids, name, args, context=None | ||
): | ||
res = {} | ||
product_customer_code_obj = self.pool['product.customer.code'] | ||
for move in self.browse(cr, uid, ids, context=context): | ||
res[move.id] = '' | ||
main_partner_id = ( | ||
move.picking_id.partner_id.commercial_partner_id.id) | ||
product = move.product_id | ||
if product and main_partner_id: | ||
code_ids = product_customer_code_obj.search(cr, uid, [ | ||
('product_id', '=', product.id), | ||
('partner_id', '=', main_partner_id), | ||
], limit=1, context=context) | ||
if code_ids: | ||
data = product_customer_code_obj.read( | ||
cr, uid, code_ids[0], | ||
['product_code'], context=context | ||
) | ||
res[move.id] = ( | ||
'product_code' in data | ||
and data['product_code'] | ||
or '' | ||
) | ||
return res | ||
|
||
_columns = { | ||
'product_customer_code': fields.function( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this field needs storing especially since you then include it in a tree view. It would seem 'product_id', 'partner_id' on the move are the important fields as well as on the customer code object. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @gdgellatly actually the involved views are There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In fact if we had the new field in the pure tree view of stock moves, we would be temped to search on that field but we couldn't because the field is not stored and has no search method. On the other hand, as @eLBati remarks, the field is not added to such a view, so we can consider that a missing feature and not a bug, which is OK by me. |
||
_get_product_customer_code, | ||
string='Product Customer Code', type='char', size=64), | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
product customer code picking for OpenERP | ||
Copyright (C) 2013 Agile Business Group sagl (<http://www.agilebg.com>). | ||
Authors, Nicola Malcontenti, nicola.malcontenti@agilebg.com | ||
The licence is in the file __openerp__.py | ||
--> | ||
<openerp> | ||
<data> | ||
|
||
<record id="view_move_picking_tree" model="ir.ui.view"> | ||
<field name="name">stock.move.product.code.tree</field> | ||
<field name="model">stock.move</field> | ||
<field name="inherit_id" ref="stock.view_move_picking_tree"/> | ||
<field eval="16" name="priority"/> | ||
<field name="arch" type="xml"> | ||
<field name="product_id" position="after"> | ||
<field name="product_customer_code" /> | ||
</field> | ||
</field> | ||
</record> | ||
|
||
<record id="view_move_picking_form" model="ir.ui.view"> | ||
<field name="name">stock.move.product.code.form</field> | ||
<field name="model">stock.move</field> | ||
<field name="inherit_id" ref="stock.view_move_picking_form"/> | ||
<field eval="16" name="priority"/> | ||
<field name="arch" type="xml"> | ||
<field name="product_id" position="after"> | ||
<field name="product_customer_code" /> | ||
</field> | ||
</field> | ||
</record> | ||
|
||
</data> | ||
</openerp> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggested description improvement:
"This module makes the product customer code visible in the stock moves of a picking. "