Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

What happened to product_manufacturer?

By
Wim Van Ertvelde
on 12/10/14, 2:22 PM 1,493 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)

0
Michael Watchorn
On 12/10/14, 4:24 PM

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

0
Wim Van Ertvelde
On 12/10/14, 5:34 PM

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

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.

Michael Watchorn
on 12/11/14, 9:20 PM

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"?

Wim Van Ertvelde
on 12/12/14, 3:36 AM

############################################################################## # # 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

Michael Watchorn
on 12/12/14, 8:54 PM

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

Michael Watchorn
on 12/12/14, 9:05 PM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 12/10/14, 2:22 PM
Seen: 1493 times
Last updated: 3/16/15, 8:10 AM