From cff5d130d12ac21b942a5ecd6e37f51c5b1d4864 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Wed, 23 Jun 2010 17:24:51 +0200 Subject: [PATCH] merge bzr revid: fp@tinyerp.com-20100623152451-v1ibzl70zr5my8iv --- addons/mrp/mrp.py | 15 ++- addons/product_expiry/__init__.py | 2 - .../{__terp__.py => __openerp__.py} | 2 +- addons/product_expiry/i18n/ca.po | 21 ++- addons/product_expiry/i18n/es.po | 23 +++- addons/product_expiry/i18n/fr.po | 19 ++- addons/product_expiry/product_expiry.py | 41 +++--- addons/product_expiry/report/__init__.py | 25 ---- addons/product_expiry/report/report_stock.py | 121 ------------------ .../report/report_stock_view.xml | 103 --------------- addons/product_expiry/wizard/__init__.py | 1 - addons/product_expiry/wizard/stock_partial.py | 70 ---------- .../wizard/stock_partial_view.xml | 22 ---- addons/product_manufacturer/__openerp__.py | 2 +- addons/product_manufacturer/i18n/fr_BE.po | 50 ++++---- ...anufacturer.pot => product_electronic.pot} | 50 ++++---- .../product_manufacturer.py | 19 +-- .../product_manufacturer_view.xml | 112 +++++++--------- .../security/ir.model.access.csv | 4 +- 19 files changed, 183 insertions(+), 519 deletions(-) rename addons/product_expiry/{__terp__.py => __openerp__.py} (93%) delete mode 100644 addons/product_expiry/report/__init__.py delete mode 100644 addons/product_expiry/report/report_stock.py delete mode 100644 addons/product_expiry/report/report_stock_view.xml delete mode 100644 addons/product_expiry/wizard/__init__.py delete mode 100644 addons/product_expiry/wizard/stock_partial.py delete mode 100644 addons/product_expiry/wizard/stock_partial_view.xml rename addons/product_manufacturer/i18n/{product_manufacturer.pot => product_electronic.pot} (61%) diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index 86e7a57dd53..9f28cff4594 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -543,16 +543,21 @@ class mrp_production(osv.osv): return {'value': {'location_dest_id': src}} return {} - def product_id_change(self, cr, uid, ids, product): + def product_id_change(self, cr, uid, ids, product, context=None): """ Finds UoM of changed product. @param product: Id of changed product. @return: Dictionary of values. """ if not product: - return {} - res = self.pool.get('product.product').read(cr, uid, [product], ['uom_id'])[0] - uom = res['uom_id'] and res['uom_id'][0] - result = {'product_uom': uom} + return {'value': { + 'product_uom': False, + 'bom_id': False + }} + res = self.pool.get('product.product').browse(cr, uid, product, context=context) + result = { + 'product_uom': res.uom_id and res.uom_id.id or False, + 'bom_id': res.bom_ids and res.bom_ids[0].id or False + } return {'value': result} def bom_id_change(self, cr, uid, ids, product): diff --git a/addons/product_expiry/__init__.py b/addons/product_expiry/__init__.py index 3b5500415c2..de4fe83ab83 100644 --- a/addons/product_expiry/__init__.py +++ b/addons/product_expiry/__init__.py @@ -19,7 +19,5 @@ ############################################################################## import product_expiry -import wizard -import report # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/product_expiry/__terp__.py b/addons/product_expiry/__openerp__.py similarity index 93% rename from addons/product_expiry/__terp__.py rename to addons/product_expiry/__openerp__.py index 2e44f2c6462..1d0b9356efe 100644 --- a/addons/product_expiry/__terp__.py +++ b/addons/product_expiry/__openerp__.py @@ -31,7 +31,7 @@ - removal date - alert date Used, for example, in food industries.''', - "update_xml" : ["product_expiry_view.xml", "report/report_stock_view.xml", "wizard/stock_partial_view.xml"], + "update_xml" : ["product_expiry_view.xml"], "active": False, "installable": True } diff --git a/addons/product_expiry/i18n/ca.po b/addons/product_expiry/i18n/ca.po index 0ed0bfcab10..c4acce0421f 100644 --- a/addons/product_expiry/i18n/ca.po +++ b/addons/product_expiry/i18n/ca.po @@ -8,13 +8,13 @@ msgstr "" "Project-Id-Version: openobject-addons\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2009-06-30 15:09+0000\n" -"PO-Revision-Date: 2010-06-21 15:56+0000\n" +"PO-Revision-Date: 2010-01-10 22:56+0000\n" "Last-Translator: FULL NAME \n" "Language-Team: Catalan \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-06-22 04:20+0000\n" +"X-Launchpad-Export-Date: 2010-04-24 04:01+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: product_expiry @@ -161,3 +161,20 @@ msgstr "" #: field:product.product,alert_time:0 msgid "Product alert time" msgstr "Data alerta producte" + +#~ msgid "Alert date" +#~ msgstr "Data alarma" + +#~ msgid "" +#~ "Track different dates on products and lots. Used, for exampel, in food " +#~ "industries: expiry date, alert date, date of removal, eso." +#~ msgstr "" +#~ "Gestiona diferents dates per a productes i lots. Utilitzat, per exemple, en " +#~ "la indústria alimentària: Data de caducitat, data d'alarma, data " +#~ "d'eliminació, ..." + +#~ msgid "DLUO" +#~ msgstr "Data caducitat" + +#~ msgid "Removal date" +#~ msgstr "Data eliminació" diff --git a/addons/product_expiry/i18n/es.po b/addons/product_expiry/i18n/es.po index 72a3aeec0e2..537d7ce26ef 100644 --- a/addons/product_expiry/i18n/es.po +++ b/addons/product_expiry/i18n/es.po @@ -8,13 +8,13 @@ msgstr "" "Project-Id-Version: openobject-addons\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2009-06-30 15:09+0000\n" -"PO-Revision-Date: 2010-06-21 15:56+0000\n" -"Last-Translator: FULL NAME \n" +"PO-Revision-Date: 2010-04-29 04:43+0000\n" +"Last-Translator: Rhubeni Lopes de Andrade \n" "Language-Team: Spanish \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-06-22 04:20+0000\n" +"X-Launchpad-Export-Date: 2010-04-30 03:57+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: product_expiry @@ -161,3 +161,20 @@ msgstr "" #: field:product.product,alert_time:0 msgid "Product alert time" msgstr "Fecha alerta producto" + +#~ msgid "Alert date" +#~ msgstr "Fecha alarma" + +#~ msgid "" +#~ "Track different dates on products and lots. Used, for exampel, in food " +#~ "industries: expiry date, alert date, date of removal, eso." +#~ msgstr "" +#~ "Gestiona distintas fechas para productos y lotes. Utilizado, por ejemplo, en " +#~ "industria alimentaria: Fecha de caducidad, fecha de alarma, fecha de " +#~ "eliminación, ..." + +#~ msgid "DLUO" +#~ msgstr "Fecha caducidad" + +#~ msgid "Removal date" +#~ msgstr "Fecha eliminación" diff --git a/addons/product_expiry/i18n/fr.po b/addons/product_expiry/i18n/fr.po index 45cf454a094..13a3e127700 100644 --- a/addons/product_expiry/i18n/fr.po +++ b/addons/product_expiry/i18n/fr.po @@ -1,20 +1,19 @@ -# French translation for openobject-addons -# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010 -# This file is distributed under the same license as the openobject-addons package. -# FIRST AUTHOR , 2010. +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * product_expiry # msgid "" msgstr "" -"Project-Id-Version: openobject-addons\n" -"Report-Msgid-Bugs-To: FULL NAME \n" +"Project-Id-Version: OpenERP Server 5.0.1\n" +"Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-06-30 15:09+0000\n" -"PO-Revision-Date: 2010-06-21 15:56+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: French \n" +"PO-Revision-Date: 2010-01-04 18:19+0000\n" +"Last-Translator: Fabien (Open ERP) \n" +"Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-06-22 04:20+0000\n" +"X-Launchpad-Export-Date: 2010-04-24 04:01+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: product_expiry diff --git a/addons/product_expiry/product_expiry.py b/addons/product_expiry/product_expiry.py index ad9b8252d49..72f18412af4 100644 --- a/addons/product_expiry/product_expiry.py +++ b/addons/product_expiry/product_expiry.py @@ -21,21 +21,10 @@ import datetime from osv import fields, osv import pooler -import time class stock_production_lot(osv.osv): _name = 'stock.production.lot' _inherit = 'stock.production.lot' - def name_get(self, cr, uid, ids, context=None): - if not len(ids): - return [] - result = [] - for line in self.browse(cr, uid, ids, context): - if line.life_date: - result.append((line.id, (line.name or '')+' ('+line.life_date+')')) - else: - result.append((line.id, line.name)) - return result def _get_date(dtype): """Return a function to compute the limit date for this type""" @@ -52,24 +41,36 @@ class stock_production_lot(osv.osv): # set date to False when no expiry time specified on the product date = duration and (datetime.datetime.today() + datetime.timedelta(days=duration)) - return date and date.strftime('%Y-%m-%d') + return date and date.strftime('%Y-%m-%d %H:%M:%S') return calc_date _columns = { - 'life_date': fields.date('End of Life Date', + 'life_date': fields.datetime('End of Life Date', help='The date the lot may become dangerous and should not be consumed.'), - 'use_date': fields.date('Best before Date', + 'use_date': fields.datetime('Best before Date', help='The date the lot starts deteriorating without becoming dangerous.'), - 'removal_date': fields.date('Removal Date', + 'removal_date': fields.datetime('Removal Date', help='The date the lot should be removed.'), - 'alert_date': fields.date('Alert Date'), + 'alert_date': fields.datetime('Alert Date'), } + # Assign dates according to products data + def create(self, cr, uid, vals, context=None): + newid = super(stock_production_lot, self).create(cr, uid, vals, context=context) + obj = self.browse(cr, uid, newid, context=context) + towrite = [] + for f in ('life_date','use_date','removal_date','alert_date'): + if not getattr(obj, f): + towrite.append(f) + context = context or {} + context['product_id'] = obj.product_id.id + self.write(cr, uid, [obj.id], self.default_get(cr, uid, towrite, context=context)) + return newid _defaults = { - # 'life_date': _get_date('life_time'), - # 'use_date': _get_date('use_time'), - # 'removal_date': _get_date('removal_time'), - # 'alert_date': _get_date('alert_time'), + 'life_date': _get_date('life_time'), + 'use_date': _get_date('use_time'), + 'removal_date': _get_date('removal_time'), + 'alert_date': _get_date('alert_time'), } stock_production_lot() diff --git a/addons/product_expiry/report/__init__.py b/addons/product_expiry/report/__init__.py deleted file mode 100644 index a6006ed47b3..00000000000 --- a/addons/product_expiry/report/__init__.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (). -# -# 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 . -# -############################################################################## - -import report_stock - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - diff --git a/addons/product_expiry/report/report_stock.py b/addons/product_expiry/report/report_stock.py deleted file mode 100644 index bef64eaffa6..00000000000 --- a/addons/product_expiry/report/report_stock.py +++ /dev/null @@ -1,121 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (). -# -# 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 . -# -############################################################################## - -from osv import osv, fields -from tools.translate import _ -import tools -from tools.sql import drop_view_if_exists - -class stock_report_prodlots(osv.osv): - _name = "stock.report.prodlots1" - _description = "Stock report by production lots" - _auto = False - _columns = { - 'name': fields.float('Quantity', readonly=True), - 'location_id': fields.many2one('stock.location', 'Location', readonly=True, select=True), - 'product_id': fields.many2one('product.product', 'Product', readonly=True, select=True), - 'prodlot_id': fields.many2one('stock.production.lot', 'Production lot', readonly=True, select=True), - 'life_date': fields.date('End of Life Date', - help='The date the lot may become dangerous and should not be consumed.'), - 'use_date': fields.date('Best before Date', - help='The date the lot starts deteriorating without becoming dangerous.'), - 'removal_date': fields.date('Removal Date', - help='The date the lot should be removed.'), - 'alert_date': fields.date('Alert Date'), - - } - - def init(self, cr): - drop_view_if_exists(cr, 'stock_report_prodlots1') - cr.execute(""" - create or replace view stock_report_prodlots1 as ( - select max(id) as id, - location_id, - product_id, - prodlot_id, - life_date, - use_date, - removal_date, - alert_date, - sum(qty) as name - from ( - select -max(sm.id) as id, - sm.location_id, - sm.product_id, - sm.prodlot_id, - spl.life_date, - spl.use_date, - spl.removal_date, - spl.alert_date, - -sum(sm.product_qty /uo.factor) as qty - from stock_move as sm - left join stock_location sl - on (sl.id = sm.location_id) - left join stock_production_lot spl - on (sm.prodlot_id=spl.id) - left join product_uom uo - on (uo.id=sm.product_uom) - where state = 'done' - group by sm.location_id, sm.product_id, sm.product_uom, sm.prodlot_id, - spl.life_date, - spl.use_date, - spl.removal_date, - spl.alert_date - - union all - select max(sm.id) as id, - sm.location_dest_id as location_id, - sm.product_id, - sm.prodlot_id, - spl.life_date, - spl.use_date, - spl.removal_date, - spl.alert_date, - sum(sm.product_qty /uo.factor) as qty - from stock_move as sm - left join stock_location sl - on (sl.id = sm.location_dest_id) - left join stock_production_lot spl - on (sm.prodlot_id=spl.id) - left join product_uom uo - on (uo.id=sm.product_uom) - where sm.state = 'done' - group by sm.location_dest_id, sm.product_id, sm.product_uom, sm.prodlot_id, - spl.life_date, - spl.use_date, - spl.removal_date, - spl.alert_date - - ) as report - group by location_id, product_id, prodlot_id, - life_date, - use_date, - removal_date, - alert_date - )""") - - def unlink(self, cr, uid, ids, context={}): - raise osv.except_osv(_('Error !'), _('You cannot delete any record!')) - - -stock_report_prodlots() - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/product_expiry/report/report_stock_view.xml b/addons/product_expiry/report/report_stock_view.xml deleted file mode 100644 index 68198e87dd3..00000000000 --- a/addons/product_expiry/report/report_stock_view.xml +++ /dev/null @@ -1,103 +0,0 @@ - - - - - - stock.report.prodlots.filter - stock.report.prodlots1 - search - - - - - - - - - - - - - - - - - - - - - - - - - - - stock.report.prodlots.view - stock.report.prodlots1 - form - -
- - - - - - - - - - -
- - - stock.report.prodlots.view - stock.report.prodlots1 - tree - - - - - - - - - - - - - - - - stock.report.prodlots.view - stock.report.prodlots1 - graph - - - - - - - - - - - Inventory by Location - ir.actions.act_window - stock.report.prodlots1 - form - tree,form - {'full':'1','search_default_internal_locations':1} - - - - - - -
-
diff --git a/addons/product_expiry/wizard/__init__.py b/addons/product_expiry/wizard/__init__.py deleted file mode 100644 index 2b1b55ed6e0..00000000000 --- a/addons/product_expiry/wizard/__init__.py +++ /dev/null @@ -1 +0,0 @@ -import stock_partial diff --git a/addons/product_expiry/wizard/stock_partial.py b/addons/product_expiry/wizard/stock_partial.py deleted file mode 100644 index 6af52951613..00000000000 --- a/addons/product_expiry/wizard/stock_partial.py +++ /dev/null @@ -1,70 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (). -# -# 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 . -# -############################################################################## - -from osv import fields, osv -from service import web_services -from tools.misc import UpdateableStr, UpdateableDict -from tools.translate import _ -import netsvc -import pooler -import time -import datetime, time -import wizard - -class stock_production_lot(osv.osv): - _inherit = "stock.production.lot" - def create(self, cr, uid, vals, context={}): - new_id = super(stock_production_lot, self).create(cr, uid, vals, context=context) - prodlot_obj = self.pool.get('stock.production.lot') - prod = prodlot_obj.browse(cr, uid, new_id, context=context) - res = {} - current_date = time.strftime('%Y-%m-%d %H:%M:%S') - if not prod.life_date: - date_life = (datetime.datetime.strptime(current_date, '%Y-%m-%d %H:%M:%S') + datetime.timedelta(days=prod.product_id.life_time)) - res['life_date'] = date_life.strftime('%Y-%m-%d') - if not prod.use_date: - date_use = (datetime.datetime.strptime(current_date, '%Y-%m-%d %H:%M:%S') + datetime.timedelta(days=prod.product_id.use_time)) - res['use_date'] = date_use.strftime('%Y-%m-%d') - if not prod.removal_date: - date_removal = (datetime.datetime.strptime(current_date, '%Y-%m-%d %H:%M:%S') + datetime.timedelta(days=prod.product_id.removal_time)) - res['removal_date'] = date_removal.strftime('%Y-%m-%d') - if not prod.alert_date: - date_alert = (datetime.datetime.strptime(current_date, '%Y-%m-%d %H:%M:%S') + datetime.timedelta(days=prod.product_id.alert_time)) - res['alert_date'] = date_alert.strftime('%Y-%m-%d') - prodlot_obj.write(cr, uid, [prod.id], res) - return new_id -stock_production_lot() - -class stock_move_split_lines_exist(osv.osv_memory): - _inherit = "stock.move.split.lines" - _columns = { - 'date': fields.date('Expiry Date'), - } - # TODO: use this date instead of default one - def on_change_product(self, cr, uid, ids, product_id): - if not product_id: - return {'value':{'date': False}} - day_life = self.pool.get('product.product').browse(cr, uid, product_id).life_time - date_life = (datetime.datetime.now() + datetime.timedelta(days=day_life)) - return {'value': - {'date': date_life.strftime('%Y-%m-%d')} - } -stock_move_split_lines_exist() diff --git a/addons/product_expiry/wizard/stock_partial_view.xml b/addons/product_expiry/wizard/stock_partial_view.xml deleted file mode 100644 index b42ea07ba40..00000000000 --- a/addons/product_expiry/wizard/stock_partial_view.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - Split in lots - stock.move.split - form - - - - - - - - - - - - - - diff --git a/addons/product_manufacturer/__openerp__.py b/addons/product_manufacturer/__openerp__.py index 5d7e8922520..e6a1a919865 100644 --- a/addons/product_manufacturer/__openerp__.py +++ b/addons/product_manufacturer/__openerp__.py @@ -21,7 +21,7 @@ "name" : "Products Attributes & Manufacturers", "version" : "1.0", "author" : "Tiny", - "category" : "Enterprise Specific Modules/Industries", + "category" : "Enterprise Specific Modules/Manufacturer Industries", "depends" : ["base", "account", "product", "stock"], "init_xml" : [], "demo_xml" : [], diff --git a/addons/product_manufacturer/i18n/fr_BE.po b/addons/product_manufacturer/i18n/fr_BE.po index 2fc936e9dfc..11351ba679d 100644 --- a/addons/product_manufacturer/i18n/fr_BE.po +++ b/addons/product_manufacturer/i18n/fr_BE.po @@ -1,6 +1,6 @@ # Translation of OpenERP Server. # This file contains the translation of the following modules: -# * product_electronic +# * product_manufacturer # msgid "" msgstr "" @@ -15,88 +15,88 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: \n" -#. module: product_electronic -#: model:ir.module.module,description:product_electronic.module_meta_information +#. module: product_manufacturer +#: model:ir.module.module,description:product_manufacturer.module_meta_information msgid "A module that add manufacturers and attributes on the product form" msgstr "" -#. module: product_electronic +#. module: product_manufacturer #: field:product.product,manufacturer_pref:0 msgid "Manufacturer product code" msgstr "" -#. module: product_electronic +#. module: product_manufacturer #: constraint:ir.ui.view:0 msgid "Invalid XML for View Architecture!" msgstr "" -#. module: product_electronic -#: view:product.electronic.attribute:0 +#. module: product_manufacturer +#: view:product.manufacturer.attribute:0 msgid "Product Template Name" msgstr "" -#. module: product_electronic +#. module: product_manufacturer #: constraint:ir.model:0 msgid "The Object name must start with x_ and not contain any special character !" msgstr "" -#. module: product_electronic -#: model:ir.model,name:product_electronic.model_product_electronic_attribute +#. module: product_manufacturer +#: model:ir.model,name:product_manufacturer.model_product_electronic_attribute msgid "Product attributes" msgstr "" -#. module: product_electronic +#. module: product_manufacturer #: view:product.product:0 msgid "Manufacturing data" msgstr "" -#. module: product_electronic +#. module: product_manufacturer #: view:product.product:0 msgid "Product reference" msgstr "" -#. module: product_electronic -#: field:product.electronic.attribute,name:0 +#. module: product_manufacturer +#: field:product.manufacturer.attribute,name:0 msgid "Attribute" msgstr "" -#. module: product_electronic -#: field:product.electronic.attribute,product_id:0 +#. module: product_manufacturer +#: field:product.manufacturer.attribute,product_id:0 msgid "Product" msgstr "" -#. module: product_electronic -#: field:product.electronic.attribute,value:0 +#. module: product_manufacturer +#: field:product.manufacturer.attribute,value:0 msgid "Value" msgstr "" -#. module: product_electronic +#. module: product_manufacturer #: view:product.product:0 msgid "Manufacturing Data" msgstr "" -#. module: product_electronic +#. module: product_manufacturer #: view:product.product:0 msgid "Product name" msgstr "" -#. module: product_electronic +#. module: product_manufacturer #: view:product.product:0 #: field:product.product,attribute_ids:0 msgid "Attributes" msgstr "" -#. module: product_electronic -#: model:ir.module.module,shortdesc:product_electronic.module_meta_information +#. module: product_manufacturer +#: model:ir.module.module,shortdesc:product_manufacturer.module_meta_information msgid "Products Attributes & Manufacturers" msgstr "" -#. module: product_electronic +#. module: product_manufacturer #: field:product.product,manufacturer_pname:0 msgid "Manufacturer product name" msgstr "" -#. module: product_electronic +#. module: product_manufacturer #: field:product.product,manufacturer:0 msgid "Manufacturer" msgstr "" diff --git a/addons/product_manufacturer/i18n/product_manufacturer.pot b/addons/product_manufacturer/i18n/product_electronic.pot similarity index 61% rename from addons/product_manufacturer/i18n/product_manufacturer.pot rename to addons/product_manufacturer/i18n/product_electronic.pot index 2fc936e9dfc..11351ba679d 100644 --- a/addons/product_manufacturer/i18n/product_manufacturer.pot +++ b/addons/product_manufacturer/i18n/product_electronic.pot @@ -1,6 +1,6 @@ # Translation of OpenERP Server. # This file contains the translation of the following modules: -# * product_electronic +# * product_manufacturer # msgid "" msgstr "" @@ -15,88 +15,88 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: \n" -#. module: product_electronic -#: model:ir.module.module,description:product_electronic.module_meta_information +#. module: product_manufacturer +#: model:ir.module.module,description:product_manufacturer.module_meta_information msgid "A module that add manufacturers and attributes on the product form" msgstr "" -#. module: product_electronic +#. module: product_manufacturer #: field:product.product,manufacturer_pref:0 msgid "Manufacturer product code" msgstr "" -#. module: product_electronic +#. module: product_manufacturer #: constraint:ir.ui.view:0 msgid "Invalid XML for View Architecture!" msgstr "" -#. module: product_electronic -#: view:product.electronic.attribute:0 +#. module: product_manufacturer +#: view:product.manufacturer.attribute:0 msgid "Product Template Name" msgstr "" -#. module: product_electronic +#. module: product_manufacturer #: constraint:ir.model:0 msgid "The Object name must start with x_ and not contain any special character !" msgstr "" -#. module: product_electronic -#: model:ir.model,name:product_electronic.model_product_electronic_attribute +#. module: product_manufacturer +#: model:ir.model,name:product_manufacturer.model_product_electronic_attribute msgid "Product attributes" msgstr "" -#. module: product_electronic +#. module: product_manufacturer #: view:product.product:0 msgid "Manufacturing data" msgstr "" -#. module: product_electronic +#. module: product_manufacturer #: view:product.product:0 msgid "Product reference" msgstr "" -#. module: product_electronic -#: field:product.electronic.attribute,name:0 +#. module: product_manufacturer +#: field:product.manufacturer.attribute,name:0 msgid "Attribute" msgstr "" -#. module: product_electronic -#: field:product.electronic.attribute,product_id:0 +#. module: product_manufacturer +#: field:product.manufacturer.attribute,product_id:0 msgid "Product" msgstr "" -#. module: product_electronic -#: field:product.electronic.attribute,value:0 +#. module: product_manufacturer +#: field:product.manufacturer.attribute,value:0 msgid "Value" msgstr "" -#. module: product_electronic +#. module: product_manufacturer #: view:product.product:0 msgid "Manufacturing Data" msgstr "" -#. module: product_electronic +#. module: product_manufacturer #: view:product.product:0 msgid "Product name" msgstr "" -#. module: product_electronic +#. module: product_manufacturer #: view:product.product:0 #: field:product.product,attribute_ids:0 msgid "Attributes" msgstr "" -#. module: product_electronic -#: model:ir.module.module,shortdesc:product_electronic.module_meta_information +#. module: product_manufacturer +#: model:ir.module.module,shortdesc:product_manufacturer.module_meta_information msgid "Products Attributes & Manufacturers" msgstr "" -#. module: product_electronic +#. module: product_manufacturer #: field:product.product,manufacturer_pname:0 msgid "Manufacturer product name" msgstr "" -#. module: product_electronic +#. module: product_manufacturer #: field:product.product,manufacturer:0 msgid "Manufacturer" msgstr "" diff --git a/addons/product_manufacturer/product_manufacturer.py b/addons/product_manufacturer/product_manufacturer.py index d77ab518efe..969b4ce69cf 100644 --- a/addons/product_manufacturer/product_manufacturer.py +++ b/addons/product_manufacturer/product_manufacturer.py @@ -24,26 +24,13 @@ class product_product(osv.osv): _inherit = 'product.product' _name = 'product.product' _columns = { + 'manufacturer' : fields.many2one('res.partner', 'Manufacturer'), + 'manufacturer_pname' : fields.char('Manufacturer Product Name', size=64), + 'manufacturer_pref' : fields.char('Manufacturer Product Code', size=64), 'attribute_ids': fields.one2many('product.manufacturer.attribute', 'product_id', 'Attributes'), - 'manufacturer_ids': fields.one2many('res.partner.manufacturer', 'product_id', 'Manufacturers'), } product_product() -class res_partner_manufacturer(osv.osv): - _name = 'res.partner.manufacturer' - _rec_name = 'manufacturer_id' - _columns = { - 'manufacturer_id' : fields.many2one('res.partner', 'Manufacturer'), - 'country_id' : fields.many2one('res.country', 'Country'), - 'authorized' : fields.boolean('Authorized'), - 'product_id': fields.many2one('product.product', 'Product', ondelete='cascade'), - } - _defaults = { - 'authorized': lambda *a: True, - } - -res_partner_manufacturer() - class product_attribute(osv.osv): _name = "product.manufacturer.attribute" _description = "Product attributes" diff --git a/addons/product_manufacturer/product_manufacturer_view.xml b/addons/product_manufacturer/product_manufacturer_view.xml index cfd7f23ae8d..1d1f952cd4d 100644 --- a/addons/product_manufacturer/product_manufacturer_view.xml +++ b/addons/product_manufacturer/product_manufacturer_view.xml @@ -1,72 +1,56 @@ - + - - product.normal.form - product.product - - form - - - - - + + product.normal.form + product.product + + form + + + + + + + + - - - - - - + + + + + + + + + + + - - product.manufacturer.attribute.tree - product.manufacturer.attribute - tree - - - - - - - - - product.manufacturer.attribute.form - product.manufacturer.attribute - form - -
- - - - -
+ + product.manufacturer.attribute.tree + product.manufacturer.attribute + tree + + + + + + + + + product.manufacturer.attribute.form + product.manufacturer.attribute + form + +
+ + + + +
- - res.partner.manufacturer.tree - res.partner.manufacturer - tree - - - - - - - - - - res.partner.manufacturer.form - res.partner.manufacturer - form - -
- - - - - -
-
+
diff --git a/addons/product_manufacturer/security/ir.model.access.csv b/addons/product_manufacturer/security/ir.model.access.csv index 1d3f9af7a2b..6f07fb1dc94 100644 --- a/addons/product_manufacturer/security/ir.model.access.csv +++ b/addons/product_manufacturer/security/ir.model.access.csv @@ -1,5 +1,3 @@ "id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" -"access_product_manufacturer_attribute","product.manufacturer.attribute","model_product_manufacturer_attribute",,1,0,0,0 +"access_product_manufacturer_attribute","product.manufacturer.attribute","model_product_manufacturer_attribute",base.group_user,1,0,0,0 "access_product_manufacturer_attribute_manager","product.manufacturer.attribute","model_product_manufacturer_attribute","product.group_product_manager",1,1,1,1 -"access_partner_manufacturer","res.partner.manufacturer","model_res_partner_manufacturer",,1,0,0,0 -"access_partner_manufacturer_manager","res.partner.manufacturer","model_res_partner_manufacturer","product.group_product_manager",1,1,1,1