Skip to content

Commit

Permalink
Add product_editable_sequence
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastienbeau committed Dec 20, 2024
1 parent 1d96cc4 commit 2066bff
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 0 deletions.
1 change: 1 addition & 0 deletions product_editable_sequence/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
25 changes: 25 additions & 0 deletions product_editable_sequence/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright 2024 Akretion (https://www.akretion.com).
# @author Sébastien BEAU <[email protected]>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
"name": "Product Editable Sequence",
"summary": "Make s=the sequence mass editable with a default value of 100",
"version": "14.0.1.0.0",
"development_status": "Alpha",
"category": "Uncategorized",
"website": "www.akretion.com",
"author": " Akretion",
"license": "AGPL-3",
"external_dependencies": {
"python": [],
"bin": [],
},
"depends": [
"product",
],
"data": [
],
"demo": [
],
}
11 changes: 11 additions & 0 deletions product_editable_sequence/models/product_template.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Copyright 2024 Akretion (https://www.akretion.com).
# @author Sébastien BEAU <[email protected]>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import _, api, fields, models


class ProductTemplate(models.Model):
_inherit = 'product.template'

sequence = fields.Integer(default=100)
16 changes: 16 additions & 0 deletions product_editable_sequence/views/product_template_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>

<record id="product_template_view_tree" model="ir.ui.view">
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_tree_view" />
<field name="arch" type="xml">
<field name="sequence" position="attributes">
<attribute name="widget"/>
<attribute name="readonly"/>
</field>
</field>
</record>

</odoo>

0 comments on commit 2066bff

Please sign in to comment.