forked from OCA/product-attribute
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2acf603
commit 6ffa1a0
Showing
11 changed files
with
90 additions
and
0 deletions.
There are no files selected for viewing
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 @@ | ||
todo |
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,16 @@ | ||
# Copyright 2021 Akretion | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
{ | ||
"name": "Product Attribute Archive", | ||
"summary": """ | ||
Add an active field on product attributes""", | ||
"version": "14.0.1.0.0", | ||
"license": "AGPL-3", | ||
"author": "Akretion,Odoo Community Association (OCA)", | ||
"depends": ["product"], | ||
"data": [ | ||
"views/product_attribute.xml", | ||
], | ||
"website": "https://github.com/OCA/product-attribute", | ||
} |
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,2 @@ | ||
from . import product_attribute | ||
from . import product_attribute_value |
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,10 @@ | ||
# Copyright 2021 Akretion | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import fields, models | ||
|
||
|
||
class ProductAttribute(models.Model): | ||
_inherit = "product.attribute" | ||
|
||
active = fields.Boolean(default=True) |
10 changes: 10 additions & 0 deletions
10
product_attribute_archive/models/product_attribute_value.py
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,10 @@ | ||
# Copyright 2021 Akretion | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import fields, models | ||
|
||
|
||
class ProductAttributeValue(models.Model): | ||
_inherit = "product.attribute.value" | ||
|
||
active = fields.Boolean(default=True) |
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 @@ | ||
* Kevin Khao <[email protected]> |
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 @@ | ||
This module allows archival of product attributes and product attribute values. |
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,7 @@ | ||
Simply use the archive action on any product attribute. | ||
|
||
The attribute is then no longer usable on new products. | ||
|
||
Identical functionality on product attribute values. | ||
|
||
Existing variants are unaffected, only new ones. |
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,41 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<!-- Copyright 2021 Akretion | ||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). --> | ||
<odoo> | ||
|
||
<record model="ir.ui.view" id="product_attribute_form_view"> | ||
<field name="name">product.attribute.form</field> | ||
<field name="model">product.attribute</field> | ||
<field name="inherit_id" ref="product.product_attribute_view_form" /> | ||
<field name="arch" type="xml"> | ||
<xpath expr="//group[@name='main_fields']" position="before"> | ||
<field name="active" invisible="1" /> | ||
<widget | ||
name="web_ribbon" | ||
title="Archived" | ||
bg_color="bg-danger" | ||
attrs="{'invisible': [('active', '=', True)]}" | ||
/> | ||
</xpath> | ||
<field name="html_color" position="after"> | ||
<field name="active" optional="hide" /> | ||
</field> | ||
</field> | ||
</record> | ||
|
||
<record id="product_attribute_tree_view" model="ir.ui.view"> | ||
<field name="name">product.attribute.tree</field> | ||
<field name="model">product.attribute</field> | ||
<field name="inherit_id" ref="product.attribute_tree_view" /> | ||
<field name="arch" type="xml"> | ||
<field name="create_variant" position="after"> | ||
<field name="active" /> | ||
</field> | ||
</field> | ||
</record> | ||
|
||
<record model="ir.actions.act_window" id="product.attribute_action"> | ||
<field name="context">{'active_test': False}</field> | ||
</record> | ||
|
||
</odoo> |