Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ADD] product_brand_supplierinfo: In "Supplier Pricelist" new fields … #2571

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions product_brand_supplierinfo/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3

==========================
Product brand supplierinfo
==========================

* In "Product Brand" new field "Code".
* In "Supplier Pricelist" new fields "Brand", and "Brand Code".


Bug Tracker
===========

Bugs are tracked on `GitHub Issues
<https://github.com/avanzosc/odoo-addons/issues>`_. In case of trouble,
please check there if your issue has already been reported. If you spotted
it first, help us smash it by providing detailed and welcomed feedback.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Contributors
------------

* Ana Juaristi <anajuaristi@avanzosc.es>
* Alfredo de la Fuente <alfredodelafuente@avanzosc.es>
1 change: 1 addition & 0 deletions product_brand_supplierinfo/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
21 changes: 21 additions & 0 deletions product_brand_supplierinfo/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# -*- coding: utf-8 -*-
# Copyright 2024 Alfredo de la Fuente - AvanzOSC
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html

{
"name": "Product Brand Supplierinfo",
"version": "16.0.1.0.0",
"category": "Product",
"website": "http://www.avanzosc.com",
"author": "Avanzosc",
"license": "AGPL-3",
"depends": [
"product",
"product_brand"
],
"data": [
"views/product_brand_views.xml",
"views/product_supplierinfo_views.xml",
],
"installable": True,
}
49 changes: 49 additions & 0 deletions product_brand_supplierinfo/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * product_brand_supplierinfo
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-05-28 05:54+0000\n"
"PO-Revision-Date: 2024-05-28 05:54+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: product_brand_supplierinfo
#: model:ir.model.fields,field_description:product_brand_supplierinfo.field_product_supplierinfo__product_brand_id
msgid "Brand"
msgstr "Marca"

#. module: product_brand_supplierinfo
#: model:ir.model.fields,field_description:product_brand_supplierinfo.field_product_brand__code
#: model:ir.model.fields,field_description:product_brand_supplierinfo.field_product_supplierinfo__brand_code
#: model_terms:ir.ui.view,arch_db:product_brand_supplierinfo.product_supplierinfo_search_view
msgid "Brand Code"
msgstr "Código marca"

#. module: product_brand_supplierinfo
#: model:ir.model.fields,field_description:product_brand_supplierinfo.field_product_supplierinfo__brand_marking
msgid "Brand Marking"
msgstr "Calificación marca"

#. module: product_brand_supplierinfo
#: model:ir.model.fields,field_description:product_brand_supplierinfo.field_product_brand__marking
msgid "Marking"
msgstr "Calificación"

#. module: product_brand_supplierinfo
#: model:ir.model,name:product_brand_supplierinfo.model_product_brand
#: model_terms:ir.ui.view,arch_db:product_brand_supplierinfo.product_supplierinfo_search_view
msgid "Product Brand"
msgstr "Marca de producto"

#. module: product_brand_supplierinfo
#: model:ir.model,name:product_brand_supplierinfo.model_product_supplierinfo
msgid "Supplier Pricelist"
msgstr "Tarifa de proveedor"
49 changes: 49 additions & 0 deletions product_brand_supplierinfo/i18n/product_brand_supplierinfo.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * product_brand_supplierinfo
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-05-28 05:54+0000\n"
"PO-Revision-Date: 2024-05-28 05:54+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: product_brand_supplierinfo
#: model:ir.model.fields,field_description:product_brand_supplierinfo.field_product_supplierinfo__product_brand_id
msgid "Brand"
msgstr ""

#. module: product_brand_supplierinfo
#: model:ir.model.fields,field_description:product_brand_supplierinfo.field_product_brand__code
#: model:ir.model.fields,field_description:product_brand_supplierinfo.field_product_supplierinfo__brand_code
#: model_terms:ir.ui.view,arch_db:product_brand_supplierinfo.product_supplierinfo_search_view
msgid "Brand Code"
msgstr ""

#. module: product_brand_supplierinfo
#: model:ir.model.fields,field_description:product_brand_supplierinfo.field_product_supplierinfo__brand_marking
msgid "Brand Marking"
msgstr ""

#. module: product_brand_supplierinfo
#: model:ir.model.fields,field_description:product_brand_supplierinfo.field_product_brand__marking
msgid "Marking"
msgstr ""

#. module: product_brand_supplierinfo
#: model:ir.model,name:product_brand_supplierinfo.model_product_brand
#: model_terms:ir.ui.view,arch_db:product_brand_supplierinfo.product_supplierinfo_search_view
msgid "Product Brand"
msgstr ""

#. module: product_brand_supplierinfo
#: model:ir.model,name:product_brand_supplierinfo.model_product_supplierinfo
msgid "Supplier Pricelist"
msgstr ""
2 changes: 2 additions & 0 deletions product_brand_supplierinfo/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import product_brand
from . import product_supplierinfo
15 changes: 15 additions & 0 deletions product_brand_supplierinfo/models/product_brand.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# -*- coding: utf-8 -*-
# Copyright 2024 Alfredo de la Fuente - AvanzOSC
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from odoo import fields, models


class ProductBrand(models.Model):
_inherit = "product.brand"

code = fields.Char(
string="Brand Code", copy=False
)
marking = fields.Char(
string="Marking", copy=False
)
20 changes: 20 additions & 0 deletions product_brand_supplierinfo/models/product_supplierinfo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Copyright 2024 Alfredo de la Fuente - AvanzOSC
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from odoo import fields, models


class ProductSupplierinfo(models.Model):
_inherit = "product.supplierinfo"

product_brand_id = fields.Many2one(
string="Brand", comodel_name="product.brand", copy=False
)
brand_code = fields.Char(
string="Brand Code", related="product_brand_id.code",
store=True, copy=False
)
brand_marking = fields.Char(
string="Brand Marking", related="product_brand_id.marking",
store=True, copy=False
)
35 changes: 35 additions & 0 deletions product_brand_supplierinfo/views/product_brand_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_product_brand_tree" model="ir.ui.view">
<field name="model">product.brand</field>
<field name="inherit_id" ref="product_brand.view_product_brand_tree"/>
<field name="arch" type="xml">
<field name="partner_id" position="after">
<field name="code" optional="show" />
<field name="marking" optional="show" />
</field>
</field>
</record>

<record id="view_product_brand_form" model="ir.ui.view">
<field name="model">product.brand</field>
<field name="inherit_id" ref="product_brand.view_product_brand_form"/>
<field name="arch" type="xml">
<field name="partner_id" position="after">
<field name="code" />
<field name="marking" />
</field>
</field>
</record>

<record id="product_brand_search_form_view" model="ir.ui.view">
<field name="model">product.brand</field>
<field name="inherit_id" ref="product_brand.product_brand_search_form_view"/>
<field name="arch" type="xml">
<field name="partner_id" position="after">
<field name="code" />
<field name="marking" />
</field>
</field>
</record>
</odoo>
44 changes: 44 additions & 0 deletions product_brand_supplierinfo/views/product_supplierinfo_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="product_supplierinfo_tree_view" model="ir.ui.view">
<field name="model">product.supplierinfo</field>
<field name="inherit_id" ref="product.product_supplierinfo_tree_view"/>
<field name="arch" type="xml">
<field name="product_code" position="after">
<field name="product_brand_id" optional="show" />
<field name="brand_code" optional="show" readonly="1"/>
<field name="brand_marking" optional="show" readonly="1"/>
</field>
</field>
</record>

<record id="product_supplierinfo_form_view" model="ir.ui.view">
<field name="model">product.supplierinfo</field>
<field name="inherit_id" ref="product.product_supplierinfo_form_view"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='delay']/.." position="after">
<field name="product_brand_id" />
<field name="brand_code" readonly="1"/>
<field name="brand_marking" readonly="1"/>
</xpath>
</field>
</record>

<record id="product_supplierinfo_search_view" model="ir.ui.view">
<field name="model">product.supplierinfo</field>
<field name="inherit_id" ref="product.product_supplierinfo_search_view"/>
<field name="arch" type="xml">
<field name="product_tmpl_id" position="after">
<field name="product_brand_id" />
<field name="brand_code" />
<field name="brand_marking" />
</field>
<filter name="groupby_vendor" position="after">
<filter string="Product Brand" name="groupby_brand" domain="[]"
context="{'group_by': 'product_brand_id'}"/>
<filter string="Brand Code" name="groupby_brand_code" domain="[]"
context="{'group_by': 'brand_code'}"/>
</filter>
</field>
</record>
</odoo>
Loading