mirror of
https://gitlab.com/sonalarora/tra_backend.git
synced 2025-12-18 02:39:10 +02:00
add new module
This commit is contained in:
1
inventory_groups/__init__.py
Normal file
1
inventory_groups/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from . import models
|
||||
24
inventory_groups/__manifest__.py
Normal file
24
inventory_groups/__manifest__.py
Normal file
@@ -0,0 +1,24 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
{
|
||||
'name': 'Inventory Groups',
|
||||
'version': '1.0',
|
||||
'category': 'Inventory/Product',
|
||||
'summary': 'Enable to make arrangement in Groups',
|
||||
'description': "",
|
||||
'depends': ['base'],
|
||||
'data': [
|
||||
|
||||
|
||||
'security/ir.model.access.csv',
|
||||
'views/groups.xml',
|
||||
],
|
||||
'demo': [
|
||||
|
||||
],
|
||||
'css': [],
|
||||
'installable': True,
|
||||
'application': True,
|
||||
'auto_install': False
|
||||
}
|
||||
BIN
inventory_groups/__pycache__/__init__.cpython-36.pyc
Normal file
BIN
inventory_groups/__pycache__/__init__.cpython-36.pyc
Normal file
Binary file not shown.
1
inventory_groups/models/__init__.py
Normal file
1
inventory_groups/models/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from . import groups
|
||||
BIN
inventory_groups/models/__pycache__/__init__.cpython-36.pyc
Normal file
BIN
inventory_groups/models/__pycache__/__init__.cpython-36.pyc
Normal file
Binary file not shown.
BIN
inventory_groups/models/__pycache__/groups.cpython-36.pyc
Normal file
BIN
inventory_groups/models/__pycache__/groups.cpython-36.pyc
Normal file
Binary file not shown.
21
inventory_groups/models/groups.py
Normal file
21
inventory_groups/models/groups.py
Normal file
@@ -0,0 +1,21 @@
|
||||
from odoo import _, fields, models, api
|
||||
|
||||
|
||||
class Inventorygroups(models.Model):
|
||||
_name = "stock.groups"
|
||||
_parent_name = "parent_id"
|
||||
_rec_name = 'complete_name'
|
||||
|
||||
name = fields.Char(required=True)
|
||||
parent_id = fields.Many2one('stock.groups', "Parent Group")
|
||||
complete_name = fields.Char(
|
||||
'Complete Name', compute='_compute_complete__group_name',
|
||||
store=True)
|
||||
|
||||
@api.depends('name', 'parent_id.complete_name')
|
||||
def _compute_complete__group_name(self):
|
||||
for category in self:
|
||||
if category.parent_id:
|
||||
category.complete_name = '%s / %s' % (category.parent_id.complete_name, category.name)
|
||||
else:
|
||||
category.complete_name = category.name
|
||||
1
inventory_groups/security/.~lock.ir.model.access.csv#
Normal file
1
inventory_groups/security/.~lock.ir.model.access.csv#
Normal file
@@ -0,0 +1 @@
|
||||
,apagen,apagen-One-Z1402,16.07.2020 21:13,file:///home/apagen/.config/libreoffice/4;
|
||||
2
inventory_groups/security/ir.model.access.csv
Normal file
2
inventory_groups/security/ir.model.access.csv
Normal file
@@ -0,0 +1,2 @@
|
||||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||
access_stock_groups,stock.groups,model_stock_groups,base.group_user,1,1,1,1
|
||||
|
31
inventory_groups/views/groups.xml
Normal file
31
inventory_groups/views/groups.xml
Normal file
@@ -0,0 +1,31 @@
|
||||
<?xml version="1.0"?>
|
||||
<odoo>
|
||||
<record id="inventory_groups_arrangment_view_form" model="ir.ui.view">
|
||||
<field name="name">stock.groups.form</field>
|
||||
<field name="model">stock.groups</field>
|
||||
<field name="arch" type="xml">
|
||||
<form>
|
||||
<field name="name" placeholder="Name"/>
|
||||
<group>
|
||||
<field name="parent_id"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record id="inventory_groups_arrangment_view_action" model="ir.actions.act_window">
|
||||
<field name="name">Groups</field>
|
||||
<field name="res_model">stock.groups</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
Create Groups
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
<menuitem
|
||||
id="inventory_groups_arrangment_view_menu"
|
||||
name="Groups"
|
||||
action="inventory_groups_arrangment_view_action"
|
||||
parent="stock.menu_product_in_config_stock"
|
||||
/>
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user