mirror of
https://gitlab.com/sonalarora/tra_backend.git
synced 2025-12-17 10:19:09 +02:00
add new fields
This commit is contained in:
6
tra_backend_Product/__init__.py
Normal file
6
tra_backend_Product/__init__.py
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||||
|
|
||||||
|
|
||||||
|
from . import models
|
||||||
|
|
||||||
25
tra_backend_Product/__manifest__.py
Normal file
25
tra_backend_Product/__manifest__.py
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||||
|
|
||||||
|
{
|
||||||
|
'name': 'Tra_Backend',
|
||||||
|
'version': '1.0',
|
||||||
|
'category': 'Product',
|
||||||
|
'sequence': 5,
|
||||||
|
'summary': 'Product',
|
||||||
|
'description': "",
|
||||||
|
'website': 'https://www.odoo.com/page/crm',
|
||||||
|
'depends': [
|
||||||
|
'product'
|
||||||
|
],
|
||||||
|
'data': [
|
||||||
|
'views/product_views.xml',
|
||||||
|
],
|
||||||
|
'demo': [
|
||||||
|
|
||||||
|
],
|
||||||
|
'css': [],
|
||||||
|
'installable': True,
|
||||||
|
'application': True,
|
||||||
|
'auto_install': False
|
||||||
|
}
|
||||||
BIN
tra_backend_Product/__pycache__/__init__.cpython-36.pyc
Normal file
BIN
tra_backend_Product/__pycache__/__init__.cpython-36.pyc
Normal file
Binary file not shown.
5
tra_backend_Product/models/__init__.py
Normal file
5
tra_backend_Product/models/__init__.py
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||||
|
|
||||||
|
|
||||||
|
from . import product
|
||||||
BIN
tra_backend_Product/models/__pycache__/__init__.cpython-36.pyc
Normal file
BIN
tra_backend_Product/models/__pycache__/__init__.cpython-36.pyc
Normal file
Binary file not shown.
BIN
tra_backend_Product/models/__pycache__/product.cpython-36.pyc
Normal file
BIN
tra_backend_Product/models/__pycache__/product.cpython-36.pyc
Normal file
Binary file not shown.
17
tra_backend_Product/models/product.py
Normal file
17
tra_backend_Product/models/product.py
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||||
|
|
||||||
|
import logging
|
||||||
|
from psycopg2 import sql, extras
|
||||||
|
from datetime import datetime, timedelta, date
|
||||||
|
|
||||||
|
from odoo import api, fields, models, tools, SUPERUSER_ID
|
||||||
|
|
||||||
|
|
||||||
|
class ProductProduct(models.Model):
|
||||||
|
_inherit = "product.template"
|
||||||
|
|
||||||
|
width = fields.Float('Width', digits='Stock Weight')
|
||||||
|
length = fields.Float('Length', digits='Stock Weight')
|
||||||
|
height = fields.Float('Height', digits='Stock Weight')
|
||||||
|
model_grade = fields.Char('Model/Grade')
|
||||||
25
tra_backend_Product/views/product_views.xml
Normal file
25
tra_backend_Product/views/product_views.xml
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<odoo>
|
||||||
|
<data>
|
||||||
|
|
||||||
|
<!-- view common to both template and product -->
|
||||||
|
<record id="product_template_form_view__inventory_inherit" model="ir.ui.view">
|
||||||
|
<field name="name">product.template.stock.property.form.inherit</field>
|
||||||
|
<field name="model">product.template</field>
|
||||||
|
<field name="inherit_id" ref="product.product_template_form_view"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
|
||||||
|
<page name="inventory" position="inside">
|
||||||
|
<xpath expr="//field[@name='weight']" position="after">
|
||||||
|
<field name="width"/>
|
||||||
|
</xpath>
|
||||||
|
</page>
|
||||||
|
|
||||||
|
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</data>
|
||||||
|
</odoo>
|
||||||
Reference in New Issue
Block a user