This question has been flagged
2 Replies
4747 Views

I just installed odoo v8-5d60c1c and I installed the module: product_manufacturer.zip

Nothing showed up in the procurement section of the products.

When I looked at some source code, I've found this in mrp/res_config.py:
#FIXME: Should be removed as module product_manufacturer has been removed

So, what is the alternative now ? How do I get manufacturers on my products?
(I have a v7 database with 1400 products with defined manufacturers that I want to export and import in v8)

Avatar
Discard
Best Answer

Have you checked out Products->[select individual product]->Procurements Tab -> Suppliers?

You can even add the suppliers at the same time the products are added, in your CSV file.

Here is a Slideshare presentation on how to import, including the One2many fields to get the suppliers added in to the same CSV file that holds the products. (See slide #12 specifically)

 

#EDIT STARTS HERE:

#I'm posting in my original answer to allow better formatting than I got in my comment.
#I didn't bother posting this to github because I don't intend to create a Pull Request.

##############################################################################
#
#    OpenERP, Open Source Management Solution
#    Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#    Modified by Michael Watchorn 2014
#
#    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 import fields, models

class product_product(models.Model):
    _inherit = 'product.product'
    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')

class product_attribute(models.Model):
    _name = "product.manufacturer.attribute"
    _description = "Product attributes"
    name = fields.Char('Attribute', size=64, required=True)
    value = fields.Char('Value', size=64)
    product_id = fields.Many2one('product.product', 'Product', ondelete='cascade')

#END OF CHANGES

None of these changes are required per se. The old osv is still usable. Here's the link to the new API document:

https://media.readthedocs.org/pdf/odoo-new-api-guide-line/latest/odoo-new-api-guide-line.pdf

Avatar
Discard
Author Best Answer

Hey Michael,

I already have suppliers on my products. But I also need Manufacturers.

Generally, there is only one manufacturer for a certain product, but there are multiple suppliers.
(Samsung is a manufacturer of a cellphone, but amazon, ebay, etc.. are all possible suppliers)
 

I know how to import products and all that, i'm just worried that all my manufacturer info is lost with v8, since this module doesnt officially exist anymore.

I'm thinking of looking at the module, and adapt it myself for V8

Avatar
Discard

Weird indeed. I installed it and found the same problem. I ported the python to use th V8 API, and tried moving the XML about, and had no luck with any of it. Interestingly there are no errors reported either. It installs without a hitch. I checked and the XML is listed as a data file, so I'm out of ideas at the moment.

Author

It seems that the fields are there when you check the product variants. All modules that use product.product as a model will show up ONLY under product variants it seems. Since i'm not going to use variants, I think I need to change product.product to product.template. What did you exactly do to the module when you say "port to V8 api"?

############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 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 openerp import fields, models class product_product(models.Model): _inherit = 'product.product' 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') class product_attribute(models.Model): _name = "product.manufacturer.attribute" _description = "Product attributes" name = fields.Char('Attribute', size=64, required=True) value = fields.Char('Value', size=64) product_id = fields.Many2one('product.product', 'Product', ondelete='cascade') #END OF CHANGES None of these changes are required per-se. The old osv is still usable. Here's the link to the new API document: https://media.readthedocs.org/pdf/odoo-new-api-guide-line/latest/odoo-new-api-guide-line.pdf

That didn't work as intended. Please refer the edit to my original answer.