Skip to content
Merged
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
Empty file.
1 change: 1 addition & 0 deletions product_attribute_value_menu/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
13 changes: 13 additions & 0 deletions product_attribute_value_menu/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "Product Attribute Value Price Import",
"summary": """Product attributes values tree and form. Import attribute values.""",
"version": "14.0.1.0.0",
"website": "https://github.com/OCA/product-attribute",
"author": "Ilyas, Ooops404, Odoo Community Association (OCA)",
"license": "LGPL-3",
"category": "Stock",
"depends": ["sale"],
"data": ["views/product_attribute_views.xml"],
"installable": True,
"application": False,
}
Empty file.
1 change: 1 addition & 0 deletions product_attribute_value_menu/readme/CONFIGURE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Configuration is not required.
3 changes: 3 additions & 0 deletions product_attribute_value_menu/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* `Ooops404 <https://www.ooops404.com>`_:

* Ilyas <irazor147@gmail.com>
4 changes: 4 additions & 0 deletions product_attribute_value_menu/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
This module adds a menu item in sales > configuration where user can see/edit all extra
prices set for each attribute value in each product template.

It also allows extra prices to be imported via standard csv/xlsx import.
6 changes: 6 additions & 0 deletions product_attribute_value_menu/readme/USAGE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- Got to: Sales -> Configuration -> Product Variant Values to manage extra price lines.
- You can edit *Extra Price* right in the list view.

To update values through spreadsheet, it is recommended to:
- export records' external ID and relevant fields necessary to work on the spreadsheet (product template, attribute, attribute value, value price extra).
- re-import records using only columns External ID and Value price extra.
71 changes: 71 additions & 0 deletions product_attribute_value_menu/views/product_attribute_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>

<record
id="product_template_attribute_value_inherited_view_tree"
model="ir.ui.view"
>
<field name="name">product.template.attribute.value.inherit.view.tree</field>
<field name="model">product.template.attribute.value</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Attributes" delete="0" create="0" multi_edit="1">
<field name="product_tmpl_id" />
<field name="attribute_id" />
<field name="name" />
<field name="html_color" />
<field name="price_extra" class="oe_inline" />
</tree>
</field>
</record>

<record id="pt_attribute_value_inherit_view_form" model="ir.ui.view">
<field
name="name"
>inherit.product.template.attribute.value.inherit.view.form</field>
<field name="model">product.template.attribute.value</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Product Attribute" create="0">
<group>
<field name="product_tmpl_id" />
<field name="name" readonly="1" />
<field name="html_color" readonly="1" />
<field name="price_extra" />
<field name="exclude_for" widget="one2many_list" mode="tree">
<tree editable="bottom">
<field name="product_tmpl_id" />
<field
name="value_ids"
widget="many2many_tags"
options="{'no_create': true}"
/>
</tree>
</field>
</group>
</form>
</field>
</record>

<record id="import_product_attribute_value_action" model="ir.actions.act_window">
<field name="name">Product Variant Values</field>
<field name="res_model">product.template.attribute.value</field>
<field name="view_mode">tree,form</field>
<field
name="view_ids"
eval="[(5, 0, 0),
(0, 0, {'view_mode': 'tree', 'view_id': ref('product_attribute_value_menu.product_template_attribute_value_inherited_view_tree')}),
(0, 0, {'view_mode': 'form', 'view_id': ref('product_attribute_value_menu.pt_attribute_value_inherit_view_form')})]"
/>
</record>

<menuitem
id="import_product_attribute_value_configuration_action_menu"
name="Product Variant Values"
parent="sale.prod_config_main"
sequence="1"
groups="product.group_product_variant"
action="product_attribute_value_menu.import_product_attribute_value_action"
/>

</odoo>
6 changes: 6 additions & 0 deletions setup/product_attribute_value_menu/setup.py
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,
)