Browse Source

[ADD] product_variant_description_sale

16.0
RemiFr82 1 year ago
parent
commit
12b60b50a4
  1. 2
      README.md
  2. 1
      product_variant_description_sale/__init__.py
  3. 39
      product_variant_description_sale/__manifest__.py
  4. BIN
      product_variant_description_sale/__pycache__/__init__.cpython-39.pyc
  5. 53
      product_variant_description_sale/i18n/fr.po
  6. 1
      product_variant_description_sale/models/__init__.py
  7. BIN
      product_variant_description_sale/models/__pycache__/__init__.cpython-39.pyc
  8. BIN
      product_variant_description_sale/models/__pycache__/product_product.cpython-39.pyc
  9. 17
      product_variant_description_sale/models/product_product.py
  10. 39
      product_variant_description_sale/views/product_product.xml

2
README.md

@ -0,0 +1,2 @@
# odoo-product-addons
Odoo modules improving products

1
product_variant_description_sale/__init__.py

@ -0,0 +1 @@
from . import models

39
product_variant_description_sale/__manifest__.py

@ -0,0 +1,39 @@
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
{
"name": "Product Variant description",
"version": "1.0.0",
"summary": """
This module allows to manage additional internal, sales and purchases descriptions on product variants
""",
"description": """
TO WRITE
""",
"author": "RemiFr82",
"contributors": "",
"website": "https://remifr82.me",
"license": "LGPL-3",
"category": "Events",
# "price": 0,
# "currency": "EUR",
"application": False,
"installable": True,
"auto_install": False,
"pre_init_hook": "",
"post_init_hook": "",
"uninstall_hook": "",
"excludes": [],
"external_dependencies": [],
"depends": [
"product",
],
"data": [
"views/product_product.xml",
],
"assets": {},
"css": [],
"images": [],
"js": [],
"test": [],
"demo": [],
"maintainer": "RemiFr82",
}

BIN
product_variant_description_sale/__pycache__/__init__.cpython-39.pyc

53
product_variant_description_sale/i18n/fr.po

@ -0,0 +1,53 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * product_variant_description_sale
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0+e-20230613\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-10-04 18:31+0000\n"
"PO-Revision-Date: 2023-10-04 18:31+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_variant_description_sale
#: model_terms:ir.ui.view,arch_db:product_variant_description_sale.product_normal_form_view_inherit
#: model_terms:ir.ui.view,arch_db:product_variant_description_sale.product_variant_easy_edit_view_inherit
msgid "Product"
msgstr "Article"
#. module: product_variant_description_sale
#: model:ir.model,name:product_variant_description_sale.model_product_product
msgid "Product Variant"
msgstr "Variante de produit"
#. module: product_variant_description_sale
#: model_terms:ir.ui.view,arch_db:product_variant_description_sale.product_normal_form_view_inherit
#: model_terms:ir.ui.view,arch_db:product_variant_description_sale.product_variant_easy_edit_view_inherit
msgid "Sale descriptions"
msgstr "Descriptions vente"
#. module: product_variant_description_sale
#: model:ir.model.fields,help:product_variant_description_sale.field_product_product__variant_description_sale
#: model_terms:ir.ui.view,arch_db:product_variant_description_sale.product_normal_form_view_inherit
#: model_terms:ir.ui.view,arch_db:product_variant_description_sale.product_variant_easy_edit_view_inherit
msgid ""
"This note is added to sales orders and invoices for this particular variant."
msgstr ""
"Cette note est ajoutée aux commandes et factures pour cette variante précise."
#. module: product_variant_description_sale
#: model_terms:ir.ui.view,arch_db:product_variant_description_sale.product_normal_form_view_inherit
#: model_terms:ir.ui.view,arch_db:product_variant_description_sale.product_variant_easy_edit_view_inherit
msgid "Variant"
msgstr "Variante"
#. module: product_variant_description_sale
#: model:ir.model.fields,field_description:product_variant_description_sale.field_product_product__variant_description_sale
msgid "Variant sales description"
msgstr "Description vente de cette variante"

1
product_variant_description_sale/models/__init__.py

@ -0,0 +1 @@
from . import product_product

BIN
product_variant_description_sale/models/__pycache__/__init__.cpython-39.pyc

BIN
product_variant_description_sale/models/__pycache__/product_product.cpython-39.pyc

17
product_variant_description_sale/models/product_product.py

@ -0,0 +1,17 @@
from odoo import models, fields
class ProductProduct(models.Model):
_inherit = "product.product"
variant_description_sale = fields.Text(
"Variant sales description",
translate=True,
help="This note is added to sales orders and invoices for this particular variant.",
)
def get_product_multiline_description_sale(self):
name = super().get_product_multiline_description_sale()
if self.variant_description_sale:
name += "\n" + self.variant_description_sale
return name

39
product_variant_description_sale/views/product_product.xml

@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="product_variant_easy_edit_view_inherit" model="ir.ui.view">
<field name="name">product.product.view.form.inherit</field>
<field name="model">product.product</field>
<field name="inherit_id" ref="product.product_variant_easy_edit_view" />
<field name="arch" type="xml">
<group name="tags" position="after">
<group name="description" string="Sale descriptions">
<field name="description_sale" readonly="1" string="Product" />
<field name="variant_description_sale" string="Variant"
placeholder="This note is added to sales orders and invoices for this particular variant." />
</group>
</group>
</field>
</record>
<record id="product_normal_form_view_inherit" model="ir.ui.view">
<field name="name">product.product.view.form.inherit</field>
<field name="model">product.product</field>
<field name="inherit_id" ref="product.product_normal_form_view" />
<field name="arch" type="xml">
<group name="description" position="attributes">
<attribute name="string">Sale descriptions</attribute>
<attribute name="attrs">{'invisible': [('product_variant_count','=',1)]}</attribute>
</group>
<field name="description_sale" position="attributes">
<attribute name="nolabel">0</attribute>
<attribute name="string">Product</attribute>
</field>
<field name="description_sale" position="after">
<field name="variant_description_sale" string="Variant"
placeholder="This note is added to sales orders and invoices for this particular variant." />
</field>
</field>
</record>
</odoo>
Loading…
Cancel
Save