-
-
Notifications
You must be signed in to change notification settings - Fork 171
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by bguillot
- Loading branch information
Showing
20 changed files
with
242 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"name": "Partner Brand", | ||
"summary": "Define registered mark in partners according to brand settings", | ||
"version": "16.0.1.0.0", | ||
"author": "Odoo Community Association (OCA), Akretion", | ||
"development_status": "Alpha", | ||
"category": "Product", | ||
"maintainers": ["bealdav"], | ||
"website": "https://github.com/OCA/brand", | ||
"license": "AGPL-3", | ||
"depends": [ | ||
"brand", | ||
"contacts", | ||
], | ||
"data": [ | ||
"views/partner.xml", | ||
], | ||
"demo": [ | ||
"data/res_brand_demo.xml", | ||
"data/res_partner_demo.xml", | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?xml version="1.0" ?> | ||
<odoo> | ||
|
||
<record id="carrefour" model="res.brand"> | ||
<field name="name">Carrefour</field> | ||
<field | ||
name="image_1920" | ||
type="base64" | ||
file="partner_brand/static/description/carrouf.png" | ||
/> | ||
</record> | ||
|
||
<record id="walmart" model="res.brand"> | ||
<field name="name">Walmart</field> | ||
<field | ||
name="image_1920" | ||
type="base64" | ||
file="partner_brand/static/description/walmart.png" | ||
/> | ||
</record> | ||
|
||
|
||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?xml version="1.0" ?> | ||
<odoo> | ||
|
||
<record id="carrefour_lyon" model="res.partner"> | ||
<field name="name">Carrefour Lyon</field> | ||
<field name="company_type">company</field> | ||
<field name="brand_id" ref="carrefour" /> | ||
<field | ||
name="image_1920" | ||
type="base64" | ||
file="partner_brand/static/description/lyon.jpg" | ||
/> | ||
</record> | ||
<record id="carrefour_bordeaux" model="res.partner"> | ||
<field name="name">Carrefour Bordeaux</field> | ||
<field name="company_type">company</field> | ||
<field name="brand_id" ref="carrefour" /> | ||
</record> | ||
|
||
<record id="walmart_austin" model="res.partner"> | ||
<field name="name">Walmart Austin</field> | ||
<field name="company_type">company</field> | ||
<field name="brand_id" ref="walmart" /> | ||
<field | ||
name="image_1920" | ||
type="base64" | ||
file="partner_brand/static/description/walmart.jpg" | ||
/> | ||
</record> | ||
<record id="walmart_miami" model="res.partner"> | ||
<field name="name">Walmart Miami</field> | ||
<field name="company_type">company</field> | ||
<field name="brand_id" ref="walmart" /> | ||
</record> | ||
|
||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * partner_brand | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 16.0+e\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: \n" | ||
"PO-Revision-Date: \n" | ||
"Last-Translator: \n" | ||
"Language-Team: \n" | ||
"Language: fr_FR\n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: 8bit\n" | ||
"Plural-Forms: nplurals=2; plural=(n > 1);\n" | ||
"X-Generator: Poedit 3.0.1\n" | ||
|
||
#. module: partner_brand | ||
#: model_terms:ir.ui.view,arch_db:partner_brand.res_partner_kanban_view | ||
msgid "" | ||
"<span title=\"This company is linked to a brand\" attrs=\"{'invisible': " | ||
"[('brand_logo', '=', False)]}\">® &nbsp;</span>" | ||
msgstr "" | ||
"<span title=\"Cette société est lié à une marque\" " | ||
"attrs=\"{'invisible': [('brand_logo', '=', False)]}\">® &nbsp;</" | ||
"span>" | ||
|
||
#. module: partner_brand | ||
#: model:ir.model.fields,field_description:partner_brand.field_res_brand__brand_id | ||
#: model:ir.model.fields,field_description:partner_brand.field_res_partner__brand_id | ||
#: model:ir.model.fields,field_description:partner_brand.field_res_users__brand_id | ||
#: model_terms:ir.ui.view,arch_db:partner_brand.view_res_partner_filter | ||
msgid "Brand" | ||
msgstr "Marque" | ||
|
||
#. module: partner_brand | ||
#: model:ir.model.fields,field_description:partner_brand.field_res_brand__brand_logo | ||
#: model:ir.model.fields,field_description:partner_brand.field_res_partner__brand_logo | ||
#: model:ir.model.fields,field_description:partner_brand.field_res_users__brand_logo | ||
msgid "Brand logo" | ||
msgstr "Logo de marque" | ||
|
||
#. module: partner_brand | ||
#: model:ir.ui.menu,name:partner_brand.res_brand_menu | ||
msgid "Brands" | ||
msgstr "Marque" | ||
|
||
#. module: partner_brand | ||
#: model:ir.model,name:partner_brand.model_res_partner | ||
msgid "Contact" | ||
msgstr "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import partner |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# © 2023 David BEAL @ Akretion | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
from odoo import fields, models | ||
|
||
|
||
class ResPartner(models.Model): | ||
_inherit = "res.partner" | ||
|
||
brand_id = fields.Many2one(comodel_name="res.brand") | ||
brand_logo = fields.Image( | ||
string="Brand logo", | ||
related="brand_id.partner_id.image_128", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Allow to set brand to partners allowing to group/filter partners by brand | ||
|
||
A brand, here, could be Carrefour, Wallmart, etc. | ||
|
||
It also display brand image in form view and flag for partner with brand in kanban | ||
|
||
.. figure:: ../static/description/brand_form.png | ||
:alt: Brand form view | ||
|
||
.. figure:: ../static/description/brand_tree.png | ||
:alt: Brand tree view | ||
|
||
.. figure:: ../static/description/brand_kanban.png | ||
:alt: Brand kanban view |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<odoo> | ||
|
||
<record id="view_partner_form" model="ir.ui.view"> | ||
<field name="model">res.partner</field> | ||
<field name="inherit_id" ref="base.view_partner_form" /> | ||
<field name="arch" type="xml"> | ||
<field name="industry_id" position="after"> | ||
<field | ||
name="brand_id" | ||
attrs="{'invisible': [('is_company', '=', False)]}" | ||
/> | ||
</field> | ||
<field name="image_1920" position="before"> | ||
<field | ||
name="brand_logo" | ||
widget="image" | ||
class="oe_avatar" | ||
attrs="{'invisible': [('brand_logo', '=', False)]}" | ||
/> | ||
</field> | ||
</field> | ||
</record> | ||
|
||
<record id="view_partner_tree" model="ir.ui.view"> | ||
<field name="model">res.partner</field> | ||
<field name="inherit_id" ref="base.view_partner_tree" /> | ||
<field name="arch" type="xml"> | ||
<field name="active" position="after"> | ||
<field name="brand_id" optional="hide" /> | ||
</field> | ||
</field> | ||
</record> | ||
|
||
<record id="view_res_partner_filter" model="ir.ui.view"> | ||
<field name="model">res.partner</field> | ||
<field name="inherit_id" ref="base.view_res_partner_filter" /> | ||
<field name="arch" type="xml"> | ||
<xpath expr="//group" position="inside"> | ||
<filter | ||
name="group_brand" | ||
string="Brand" | ||
context="{'group_by': 'brand_id'}" | ||
/> | ||
</xpath> | ||
</field> | ||
</record> | ||
|
||
<record id="res_partner_kanban_view" model="ir.ui.view"> | ||
<field name="model">res.partner</field> | ||
<field name="inherit_id" ref="base.res_partner_kanban_view" /> | ||
<field name="arch" type="xml"> | ||
<xpath expr="//div/div" position="before"> | ||
<div> | ||
<field name="brand_logo" invisible="1" /> | ||
<span | ||
title="This company is linked to a brand" | ||
attrs="{'invisible': [('brand_logo', '=', False)]}" | ||
>® &nbsp;</span> | ||
</div> | ||
</xpath> | ||
</field> | ||
</record> | ||
|
||
<record model="ir.ui.menu" id="res_brand_menu"> | ||
<field name="name">Brands</field> | ||
<field name="parent_id" ref="contacts.res_partner_menu_config" /> | ||
<field name="action" ref="brand.res_brand_act_window" /> | ||
</record> | ||
|
||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../partner_brand |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import setuptools | ||
|
||
setuptools.setup( | ||
setup_requires=['setuptools-odoo'], | ||
odoo_addon=True, | ||
) |