Community mailing list archives

community@mail.odoo.com

Re: Module brand

by
richard
- 01/01/2015 17:41:57
I installed  quikly on Odoo 8 and work, just a problem in the product.

In partner, we have a checbox for customer, suppliers and we can have also for brand/manufacturer.

there that i do for my application. Just I ma newbies and try to understand how to work odoo in this case.

For me brand=manufacturer in my application 

from openerp.osv import orm, fields
from openerp.tools.translate import _

class clicshopping_manufacturer(orm.Model):
    _name = 'clicshopping.manufacturer'
    _columns = {
        'clicshopping_manufacturers_id': fields.char('Brand manufacturer Id', size=5, help="Id manufacturer Brand table of ClicShopping must be unique"),
        'clicshopping_manufacturers_name': fields.char('Brand Name', size=70, help='Name of brand manufacturer.'),
        'clicshopping_manufacturers_url': fields.char('Brand Url', size=70, help='Url of brand manufacturer.'),
        'clicshopping_partner_id': fields.many2one('res.partner',  'Partner',  help='Select a partner for this brand if it exists.',  ondelete='restrict'),
        'clicshopping_manufacturers_image': fields.binary('brand logo'),
'clicshopping_manufacturers_status': fields.boolean('Brand Manufacturer Status',  default='1', help="If a manufacturer brand is not active, it will not be displayed in the catalog"),
        'clicshopping_manufacturer_description': fields.text('Description', translate=True),
'clicshopping_manufacturer_seo_title': fields.char('Brand manufacturer Seo title', translate=True, size=70, help="If it empty, default in ClicSshopping will be taken"),
'clicshopping_manufacturer_seo_description': fields.char('Brand manufacturer Seo Description', translate=True, size=150, help="If it empty, default in ClicSshopping will be taken"),
'clicshopping_manufacturer_seo_keyword': fields.text('Brand manufacturer Seo Keywords', translate=True, help="If it empty, default in ClicSshopping will be taken"),
    }


class product_template(orm.Model):
    _inherit = 'product.template'
    _columns = {
        'clicshopping_product_manufacturer_id': fields.many2one('clicshopping.manufacturer', 'Brand',  help='Select a brand manufacturer for this product.',  ondelete='restrict')
    }


---------------------------------------------------

<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>

        <record id="clicshopping_manufacturer_search_form_view" model="ir.ui.view">
            <field name="name">clicshopping.manufacturer.search.form</field>
            <field name="model">clicshopping.manufacturer</field>
            <field name="arch" type="xml">
              <search string="ClicShopping Product Brand">
                 <field name="clicshopping_manufacturers_name"/>
                 <field name="clicshopping_partner_id"/>
              </search>
            </field>
        </record>

        <record model="ir.ui.view" id="view_clicshopping_manufacturer_form">
            <field name="name">clicshopping.manufacturer.form</field>
            <field name="model">clicshopping.manufacturer</field>
            <field name="arch" type="xml">
                <form string="Product Brand" version="7.0">
                  <sheet>
                      <field name="clicshopping_manufacturers_image" widget="image" class="oe_avatar oe_left"/>
                      <div class="oe_title">
                        <div class="oe_edit_only">
                          <label for="name" string="Brand Name"/>
                        </div>
                        <h1>
                          <field name="clicshopping_manufacturers_name"/>
                        </h1>
                      </div>
                      <group>
                        <field name="clicshopping_partner_id"/>
                      </group>
                      <group string="Brand Description">
                        <field name="clicshopping_manufacturer_description" nolabel="1"/>
                      </group>
                      <group string="Brand SEO">
                        <field name="clicshopping_manufacturer_seo_title"/>
                        <field name="clicshopping_manufacturer_seo_description"/>
                        <field name="clicshopping_manufacturer_seo_keyword"/>
                      </group>
                  </sheet>
                </form>
            </field>
        </record>

        <record model="ir.ui.view" id="view_clicshopping_manufacturer_tree">
          <field name="name">clicshopping.manufacturer.tree</field>
          <field name="model">clicshopping.manufacturer</field>
          <field name="arch" type="xml">
            <tree string="clicshopping.manufacturer">
              <field name="clicshopping_manufacturers_name"/>
              <field name="clicshopping_manufacturer_description"/>
              <field name="clicshopping_partner_id"/>
            </tree>
          </field>
        </record>



      <record  model="ir.ui.view" id="product_template_search_view">
        <field name="name">product.template.search</field>
        <field name="model">product.template</field>
        <field name="inherit_id" ref="product.product_template_search_view"/>
        <field name="arch" type="xml">
          <field name="categ_id" position="after">
            <field name="clicshopping_product_manufacturer_id"/>
          </field>
          <group string='Group by...' position="inside">
            <filter string="Brand" name="groupby_brand" domain="[]" context="{'group_by' : 'clicshopping_product_manufacturer_id'}"/>
          </group>
        </field>
      </record>


<!-- pb here -->


      <record model="ir.ui.view" id="template_product_form_view">
        <field name="inherit_id" ref="product.product_template_form_view"/>
        <field name="model">product.template</field>
        <field name="priority">5</field>
        <field name="inherit_id" ref="product.product_template_form_view"/>

           <field name="arch" type="xml">
                <div name="options" position="before">
                    <label for="clicshopping_product_manufacturer_id" />
                    <field name="clicshopping_product_manufacturer_id"/>  ===> response in the fields search --- clicshopping.manufacturer,1 (test is correct answer)
               </div>
           </field>
        </record>

<!-- end  pb here -->

        <record model="ir.ui.view" id="product_template_form_clicshopping_manufacturer_add">
          <field name="name">product.template.product.form</field>
          <field name="model">product.template</field>
          <field name="inherit_id" ref="product.product_template_form_view" />
          <field name="arch" type="xml">
            <field name="categ_id" position="after"  >
              <field name="clicshopping_product_manufacturer_id" />
            </field>
          </field>
        </record>

        <record model="ir.actions.act_window" id="action_clicshopping_manufacturer">
            <field name="name">Brand</field>
            <field name="res_model">clicshopping.manufacturer</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form</field>
        </record>

        <menuitem name="Brand management" id="menu_clicshopping_manufacturer" action="action_clicshopping_manufacturer" parent="product.prod_config_main"/>

    </data>
</openerp>






------------------------
Cordialement,
Loïc Richard

Découvrez ClicShopping, la première solution de social ecommerce openSource à intégrer l'achat compulsif !! Et maintenant qui a une relation avec Odoo (ERP)

Discover ClicShopping, first open source social solution  to integrate the compulsive purchase. And know a relation with Odoo (ERP)

2015-01-01 17:17 GMT-05:00 Gunnar Wagner <gunnar.wagner@irisgermanica.com>:

On 1/1/2015 10:52 PM, Loïc Richard wrote:
<blockquote cite="mid:CAKAiKMEu1WrL-Fev0CwyZ9xjR2L3HnyD_ct_1Ni5KcMekebutA@mail.gmail.com" type="cite">
Ok, I have tested,  work fine for the moment, but I miss somthething like  a checkbox in partner (like supplier)
so, you are using 7.0, right?

I think there are 2 basic things missing in the existing module which might be not too difficult to add (I am a complete non developer so that is said with not much understanding of the technical side)

1.) an entry in the partner or Customer Form view. I think that needs to be more then a checkbox (not 100% sure what you exactly mean by that). A Customer can have more then one brand. So all brands that are logically tied to a customer should be listed in the Customers Form view
2.) a possibility to sort or filter you products by brand. I could imagine that could be an advanced search in products/product variants

if you are able to write such a code that would be the way to start from my perspective

best ...Gunnar





<blockquote cite="mid:CAKAiKMEu1WrL-Fev0CwyZ9xjR2L3HnyD_ct_1Ni5KcMekebutA@mail.gmail.com" type="cite">
2015-01-01 5:57 GMT-05:00 Gunnar Wagner <gunnar.wagner@irisgermanica.com>:

On 1/1/2015 5:27 PM, Loïc Richard wrote:
<blockquote cite="mid:CAKAiKMGUdJhaZWMUvDYuDwJyxSCBYwXFRXO3LNU2TSC3kfd5fA@mail.gmail.com" type="cite">

Is it official module where  can found it

https://github.com/OCA/product-attribute/tree/7.0/product_brand

as mentioned it is not officially ported to 8.0 yet. I have a working version for v8 (that was made by someone else) though and I am trying to have them making a PR to the OCA, so the port can be included into the 8.0 branch
if you want to develop for 8.0 then you'll have to wait for that. I think it will take about 2 weeks to get to the status where a PR has been made. I have no experience how long it takes until such a PR is being actually pulled and the Module will be available officially for 8.0.

I guess a method to start working on that would be to:

1) wait for the 8.0 port to be available
2) fork https://github.com/OCA/product-attribute into your own github
3) make a new branch
4) work on it
5) make a pull request to the original OCA repository when you are done




<blockquote cite="mid:CAKAiKMGUdJhaZWMUvDYuDwJyxSCBYwXFRXO3LNU2TSC3kfd5fA@mail.gmail.com" type="cite">
Le 1 janv. 2015 03:27, "gunnar wagner" <gunnar.wagner@irisgermanica.com> a écrit :

How about building that on the existing product_brand.
You don't have to start from scratch, product_brand users can benefit from your enhancments and you strenghten the OCA modules set

--

Gunnar Wagner



"Loïc Richard" <loic.richard1@free.fr> wrote:
I decided to create my own  system with relation partner.  It will be include soon in new opensource module for ClisShopping social ecommerce solution.


------------------------
Cordialement,
loïc Richard

2014-12-31 22:27 GMT-05:00 gunnar wagner <gunnar.wagner@irisgermanica.com>:

There is a module called product_brand in the OCA/product-attribute repository. It is pretty basic though. What version are you on? 7? 8? It is not ported to 8 officially yet. I have a working version from someone. I am trying to motivate them to do a PR to OCA but this is still pending due to them being inexperienced with git and odoo procedures. I guess the PR will be done in 1-2weeks

--

Gunnar Wagner



"Loïc Richard" <loic.richard1@free.fr> wrote:
Hello,

Where  can I found a module who can make a brand product (like supplier)

Tk
------------------------
Cordialement,
loïc Richard

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe


_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe


--

Gunnar Wagner | Iris Germanica Ltd. | JinQian Gong Lu 385, 8-201 | FengXian Qu, 201404 Shanghai | P.R. CHINA
+86 159 0094 1702 | +49 (0)176 7808 9090 | skype: professorgunrad | www.fashionsupermarket.net

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe


_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe


--

Gunnar Wagner | Iris Germanica Ltd. | JinQian Gong Lu 385, 8-201 | FengXian Qu, 201404 Shanghai | P.R. CHINA
+86 159 0094 1702 | +49 (0)176 7808 9090 | skype: professorgunrad | www.fashionsupermarket.net

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe