Browse Source

[FIX] Bug Fixed 'all_in_one_dynamic_custom_fields'

pull/280/head
AjmalCybro 2 years ago
parent
commit
8cc8adb98d
  1. 1
      all_in_one_dynamic_custom_fields/__init__.py
  2. 3
      all_in_one_dynamic_custom_fields/__manifest__.py
  3. 4
      all_in_one_dynamic_custom_fields/doc/RELEASE_NOTES.md
  4. 1
      all_in_one_dynamic_custom_fields/models/__init__.py
  5. 24
      all_in_one_dynamic_custom_fields/models/dynamic_fields.py
  6. 1
      all_in_one_dynamic_custom_fields/models/field_widgets.py
  7. 1
      all_in_one_dynamic_custom_fields/models/ir_model_fields.py
  8. BIN
      all_in_one_dynamic_custom_fields/static/description/assets/screenshots/01.png
  9. BIN
      all_in_one_dynamic_custom_fields/static/description/assets/screenshots/02.png
  10. BIN
      all_in_one_dynamic_custom_fields/static/description/assets/screenshots/03.png
  11. BIN
      all_in_one_dynamic_custom_fields/static/description/assets/screenshots/04.png
  12. BIN
      all_in_one_dynamic_custom_fields/static/description/assets/screenshots/05.png
  13. BIN
      all_in_one_dynamic_custom_fields/static/description/assets/screenshots/06.png
  14. BIN
      all_in_one_dynamic_custom_fields/static/description/assets/screenshots/07.png
  15. BIN
      all_in_one_dynamic_custom_fields/static/description/assets/screenshots/08.png
  16. BIN
      all_in_one_dynamic_custom_fields/static/description/assets/screenshots/09.png
  17. BIN
      all_in_one_dynamic_custom_fields/static/description/assets/screenshots/10.png
  18. BIN
      all_in_one_dynamic_custom_fields/static/description/assets/screenshots/11.png
  19. BIN
      all_in_one_dynamic_custom_fields/static/description/assets/screenshots/dynamic1.png
  20. BIN
      all_in_one_dynamic_custom_fields/static/description/assets/screenshots/dynamic10.png
  21. BIN
      all_in_one_dynamic_custom_fields/static/description/assets/screenshots/dynamic11.png
  22. BIN
      all_in_one_dynamic_custom_fields/static/description/assets/screenshots/dynamic12.png
  23. BIN
      all_in_one_dynamic_custom_fields/static/description/assets/screenshots/dynamic2.png
  24. BIN
      all_in_one_dynamic_custom_fields/static/description/assets/screenshots/dynamic3.png
  25. BIN
      all_in_one_dynamic_custom_fields/static/description/assets/screenshots/dynamic4.png
  26. BIN
      all_in_one_dynamic_custom_fields/static/description/assets/screenshots/dynamic5.png
  27. BIN
      all_in_one_dynamic_custom_fields/static/description/assets/screenshots/dynamic6.png
  28. BIN
      all_in_one_dynamic_custom_fields/static/description/assets/screenshots/dynamic7.png
  29. BIN
      all_in_one_dynamic_custom_fields/static/description/assets/screenshots/dynamic8.png
  30. BIN
      all_in_one_dynamic_custom_fields/static/description/assets/screenshots/dynamic9.png
  31. BIN
      all_in_one_dynamic_custom_fields/static/description/assets/screenshots/hero-1.gif
  32. BIN
      all_in_one_dynamic_custom_fields/static/description/assets/screenshots/hero.png
  33. BIN
      all_in_one_dynamic_custom_fields/static/description/assets/screenshots/main_view.png
  34. BIN
      all_in_one_dynamic_custom_fields/static/description/assets/screenshots/security.png
  35. 50
      all_in_one_dynamic_custom_fields/static/description/index.html
  36. BIN
      all_in_one_dynamic_custom_fields/static/description/web_icon.png
  37. 5
      all_in_one_dynamic_custom_fields/views/dynamic_fields.xml

1
all_in_one_dynamic_custom_fields/__init__.py

@ -20,5 +20,4 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>. # along with this program. If not, see <https://www.gnu.org/licenses/>.
# #
################################################################################### ###################################################################################
from . import models from . import models

3
all_in_one_dynamic_custom_fields/__manifest__.py

@ -20,10 +20,9 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>. # along with this program. If not, see <https://www.gnu.org/licenses/>.
# #
################################################################################### ###################################################################################
{ {
'name': 'All in One Dynamic Fields', 'name': 'All in One Dynamic Fields',
'version': '15.0.1.0.2', 'version': '15.0.1.1.3',
'summary': 'Create Custom Fields As Per Your Need Without Any Coding.', 'summary': 'Create Custom Fields As Per Your Need Without Any Coding.',
'description': 'All in One Dynamic Fields, All in One Custom Fields, Dynamic Fields, Custom Fields, Create Fields Dynamically', 'description': 'All in One Dynamic Fields, All in One Custom Fields, Dynamic Fields, Custom Fields, Create Fields Dynamically',
'category': 'Extra Tools', 'category': 'Extra Tools',

4
all_in_one_dynamic_custom_fields/doc/RELEASE_NOTES.md

@ -1,7 +1,7 @@
## Module <all_in_one_dynamic_custom_fields> ## Module <all_in_one_dynamic_custom_fields>
#### 09.08.2022 #### 02.08.2023
#### Version 15.0.1.0.0 #### Version 15.0.1.1.3
##### ADD ##### ADD
- Initial commit for All in One Custom Dynamic Fields - Initial commit for All in One Custom Dynamic Fields

1
all_in_one_dynamic_custom_fields/models/__init__.py

@ -20,7 +20,6 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>. # along with this program. If not, see <https://www.gnu.org/licenses/>.
# #
################################################################################### ###################################################################################
from . import ir_model_fields from . import ir_model_fields
from . import field_widgets from . import field_widgets
from . import dynamic_fields from . import dynamic_fields

24
all_in_one_dynamic_custom_fields/models/dynamic_fields.py

@ -20,7 +20,6 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>. # along with this program. If not, see <https://www.gnu.org/licenses/>.
# #
################################################################################### ###################################################################################
from odoo import api, fields, models, _ from odoo import api, fields, models, _
from odoo.exceptions import ValidationError from odoo.exceptions import ValidationError
@ -80,9 +79,9 @@ class DynamicFields(models.Model):
def create_dynamic_fields(self): def create_dynamic_fields(self):
self.write({'status': 'form'}) self.write({'status': 'form'})
if self.field_type == 'monetary' and not self.env[ if self.field_type == 'monetary' and not self.env[
'ir.model.fields'].sudo().search([ 'ir.model.fields'].sudo().search([
('model', '=', self.model_id.id), ('model', '=', self.model_id.id),
('name', '=', 'currency_id')]): ('name', '=', 'currency_id')]):
self.env['ir.model.fields'].sudo().create({ self.env['ir.model.fields'].sudo().create({
'name': 'x_currency_id', 'name': 'x_currency_id',
'field_description': 'Currency', 'field_description': 'Currency',
@ -142,10 +141,7 @@ class DynamicFields(models.Model):
} }
def add_field_to_tree_view(self): def add_field_to_tree_view(self):
if self.env['ir.model.fields'].sudo().search( if self.add_field_in_tree:
[('model', '=', self.model_id.model),
('name', '=', 'state')]):
self.write({'status': 'tree'})
if self.add_field_in_tree: if self.add_field_in_tree:
inherit_tree_view_name = str( inherit_tree_view_name = str(
self.tree_view_id.name) + ".inherit.dynamic.custom" + \ self.tree_view_id.name) + ".inherit.dynamic.custom" + \
@ -153,10 +149,10 @@ class DynamicFields(models.Model):
tree_view_arch_base = _( tree_view_arch_base = _(
'<?xml version="1.0"?>' '<?xml version="1.0"?>'
'<data>' '<data>'
'''<xpath expr="//field[@name='state']" position="before">''' '''<xpath expr="//tree" position="inside">'''
'''<field name="%s" optional="show"/>''' '''<field name="%s" optional="show"/>'''
'''</xpath>''' '''</xpath>'''
'''</data>''') % (self.name) '''</data>''') % self.name
self.tree_view_id = self.env['ir.ui.view'].sudo().create({ self.tree_view_id = self.env['ir.ui.view'].sudo().create({
'name': inherit_tree_view_name, 'name': inherit_tree_view_name,
'type': 'tree', 'type': 'tree',
@ -165,16 +161,14 @@ class DynamicFields(models.Model):
'inherit_id': self.tree_view_id.id, 'inherit_id': self.tree_view_id.id,
'arch_base': tree_view_arch_base, 'arch_base': tree_view_arch_base,
'active': True}) 'active': True})
self.write({'status': 'tree'})
return { return {
'type': 'ir.actions.client', 'type': 'ir.actions.client',
'tag': 'reload', 'tag': 'reload',
} }
else: else:
raise ValidationError( raise ValidationError(
_('Error! Selected Model You cannot add a custom field to the tree view.' _('Error! Please select the boolean field Add Field to the Tree View.'))
'The feature only applies to the model tree/list view that contains the state '
'field.'))
@api.depends('model_id') @api.depends('model_id')
@api.onchange('model_id') @api.onchange('model_id')
@ -222,4 +216,4 @@ class DynamicFields(models.Model):
if self.tree_view_id: if self.tree_view_id:
self.tree_view_id.active = False self.tree_view_id.active = False
res = super(DynamicFields, self).unlink() res = super(DynamicFields, self).unlink()
return res return res

1
all_in_one_dynamic_custom_fields/models/field_widgets.py

@ -20,7 +20,6 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>. # along with this program. If not, see <https://www.gnu.org/licenses/>.
# #
################################################################################### ###################################################################################
from odoo import models, fields from odoo import models, fields

1
all_in_one_dynamic_custom_fields/models/ir_model_fields.py

@ -20,7 +20,6 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>. # along with this program. If not, see <https://www.gnu.org/licenses/>.
# #
################################################################################### ###################################################################################
from odoo import models, fields from odoo import models, fields

BIN
all_in_one_dynamic_custom_fields/static/description/assets/screenshots/01.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

BIN
all_in_one_dynamic_custom_fields/static/description/assets/screenshots/02.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 103 KiB

BIN
all_in_one_dynamic_custom_fields/static/description/assets/screenshots/03.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 136 KiB

BIN
all_in_one_dynamic_custom_fields/static/description/assets/screenshots/04.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 101 KiB

BIN
all_in_one_dynamic_custom_fields/static/description/assets/screenshots/05.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 97 KiB

BIN
all_in_one_dynamic_custom_fields/static/description/assets/screenshots/06.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 95 KiB

BIN
all_in_one_dynamic_custom_fields/static/description/assets/screenshots/07.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 289 KiB

BIN
all_in_one_dynamic_custom_fields/static/description/assets/screenshots/08.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 202 KiB

BIN
all_in_one_dynamic_custom_fields/static/description/assets/screenshots/09.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 111 KiB

BIN
all_in_one_dynamic_custom_fields/static/description/assets/screenshots/10.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 94 KiB

BIN
all_in_one_dynamic_custom_fields/static/description/assets/screenshots/11.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 267 KiB

BIN
all_in_one_dynamic_custom_fields/static/description/assets/screenshots/dynamic1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

BIN
all_in_one_dynamic_custom_fields/static/description/assets/screenshots/dynamic10.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 136 KiB

BIN
all_in_one_dynamic_custom_fields/static/description/assets/screenshots/dynamic11.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

BIN
all_in_one_dynamic_custom_fields/static/description/assets/screenshots/dynamic12.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 272 KiB

BIN
all_in_one_dynamic_custom_fields/static/description/assets/screenshots/dynamic2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

BIN
all_in_one_dynamic_custom_fields/static/description/assets/screenshots/dynamic3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

BIN
all_in_one_dynamic_custom_fields/static/description/assets/screenshots/dynamic4.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

BIN
all_in_one_dynamic_custom_fields/static/description/assets/screenshots/dynamic5.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 KiB

BIN
all_in_one_dynamic_custom_fields/static/description/assets/screenshots/dynamic6.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

BIN
all_in_one_dynamic_custom_fields/static/description/assets/screenshots/dynamic7.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

BIN
all_in_one_dynamic_custom_fields/static/description/assets/screenshots/dynamic8.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 280 KiB

BIN
all_in_one_dynamic_custom_fields/static/description/assets/screenshots/dynamic9.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 201 KiB

BIN
all_in_one_dynamic_custom_fields/static/description/assets/screenshots/hero-1.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 359 KiB

BIN
all_in_one_dynamic_custom_fields/static/description/assets/screenshots/hero.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 633 KiB

BIN
all_in_one_dynamic_custom_fields/static/description/assets/screenshots/main_view.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

BIN
all_in_one_dynamic_custom_fields/static/description/assets/screenshots/security.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 KiB

50
all_in_one_dynamic_custom_fields/static/description/index.html

@ -31,7 +31,7 @@
style="font-family: 'Montserrat', sans-serif !important; font-weight: 300 !important; color: #FFFFFF !important; font-size: 1.4rem !important; text-align: center !important;"> style="font-family: 'Montserrat', sans-serif !important; font-weight: 300 !important; color: #FFFFFF !important; font-size: 1.4rem !important; text-align: center !important;">
Create custom fields in as per you need without any coding. Create custom fields in as per you need without any coding.
</p> </p>
<img src="./assets/screenshots/hero.png" class="img-responsive" width="100%" height="auto" /> <img src="./assets/screenshots/hero-1.gif" class="img-responsive" width="100%" height="auto" />
</div> </div>
</div> </div>
@ -241,7 +241,7 @@
style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #282F33 !important; font-size: 1rem !important;"> style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #282F33 !important; font-size: 1rem !important;">
After installation, give the user access to 'Create Custom Dynamic Fields' from user settings. After installation, give the user access to 'Create Custom Dynamic Fields' from user settings.
</p> </p>
<img src="assets/screenshots/security.png" class="img-responsive img-thumbnail border" width="100%" <img src="assets/screenshots/dynamic1.png" class="img-responsive img-thumbnail border" width="100%"
height="auto" /> height="auto" />
</div> </div>
@ -253,9 +253,7 @@
style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #282F33 !important; font-size: 1rem !important;"> style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #282F33 !important; font-size: 1rem !important;">
Open the module and Click Create Button to create new custom fields and fill the details.Then click the Create Field. Open the module and Click Create Button to create new custom fields and fill the details.Then click the Create Field.
</p> </p>
<img src="assets/screenshots/main_view.png" class="img-responsive img-thumbnail border" width="100%" <img src="assets/screenshots/dynamic2.png" class="img-responsive img-thumbnail border" width="100%"
height="auto" />
<img src="assets/screenshots/01.png" class="img-responsive img-thumbnail border" width="100%"
height="auto" /> height="auto" />
</div> </div>
@ -267,9 +265,9 @@
style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #282F33 !important; font-size: 1rem !important;"> style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #282F33 !important; font-size: 1rem !important;">
Select the model for which you want to create a custom field. Select the model for which you want to create a custom field.
</p> </p>
<img src="assets/screenshots/02.png" class="img-responsive img-thumbnail border" width="100%" <img src="assets/screenshots/dynamic4.png" class="img-responsive img-thumbnail border" width="100%"
height="auto" /> height="auto" />
<img src="assets/screenshots/03.png" class="img-responsive img-thumbnail border" width="100%" <img src="assets/screenshots/dynamic5.png" class="img-responsive img-thumbnail border" width="100%"
height="auto" /> height="auto" />
</div> </div>
@ -281,7 +279,7 @@
style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #282F33 !important; font-size: 1rem !important;"> style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #282F33 !important; font-size: 1rem !important;">
Choose the field type Choose the field type
</p> </p>
<img src="assets/screenshots/04.png" class="img-responsive img-thumbnail border" width="100%" <img src="assets/screenshots/dynamic6.png" class="img-responsive img-thumbnail border" width="100%"
height="auto"/> height="auto"/>
</div> </div>
@ -293,13 +291,12 @@
<p <p
style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #282F33 !important; font-size: 1rem !important;"> style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #282F33 !important; font-size: 1rem !important;">
The custom field also we can add to the module List/Tree view. The custom field also we can add to the module List/Tree view.
Note: The feature only applies to the model tree/list view that contains the state field.
</p> </p>
<img src="assets/screenshots/06.png" class="img-responsive img-thumbnail border" width="100%" <img src="assets/screenshots/dynamic7.png" class="img-responsive img-thumbnail border" width="100%"
height="auto"/> height="auto"/>
<img src="assets/screenshots/07.png" class="img-responsive img-thumbnail border" width="100%" <img src="assets/screenshots/dynamic8.png" class="img-responsive img-thumbnail border" width="100%"
height="auto"/> height="auto"/>
<img src="assets/screenshots/08.png" class="img-responsive img-thumbnail border" width="100%" <img src="assets/screenshots/dynamic9.png" class="img-responsive img-thumbnail border" width="100%"
height="auto"/> height="auto"/>
</div> </div>
@ -312,7 +309,9 @@
style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #282F33 !important; font-size: 1rem !important;"> style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #282F33 !important; font-size: 1rem !important;">
A new custom field is created in the sale order form view. A new custom field is created in the sale order form view.
</p> </p>
<img src="assets/screenshots/09.png" class="img-responsive img-thumbnail border" width="100%" <img src="assets/screenshots/dynamic3.png" class="img-responsive img-thumbnail border" width="100%"
height="auto" />
<img src="assets/screenshots/dynamic10.png" class="img-responsive img-thumbnail border" width="100%"
height="auto" /> height="auto" />
</div> </div>
@ -325,30 +324,13 @@
style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #282F33 !important; font-size: 1rem !important;"> style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #282F33 !important; font-size: 1rem !important;">
A new custom field is created in the sale order tree view. A new custom field is created in the sale order tree view.
</p> </p>
<img src="assets/screenshots/10.png" class="img-responsive img-thumbnail border" width="100%" <img src="assets/screenshots/dynamic11.png" class="img-responsive img-thumbnail border" width="100%"
height="auto" /> height="auto" />
<img src="assets/screenshots/11.png" class="img-responsive img-thumbnail border" width="100%" <img src="assets/screenshots/dynamic12.png" class="img-responsive img-thumbnail border" width="100%"
height="auto" /> height="auto" />
</div> </div>
</div> </div>
<!-- <div class="row" id="video">
<div class="col-md-12" style="border-bottom: 1px solid #d5d5d5 !important; margin: 2rem 0 !important">
<h2
style="font-family: 'Montserrat', sans-serif !important; font-weight: 600 !important; color: #714B67 !important; font-size: 1.5rem !important;">
<i class="fa fa-image mr-2"></i>Video
</h2>
</div>
<div class="col-12 d-flex justify-content-center">
<div class="s_panel_video" data-video-id="LOQDtQbcVS0">
<img class="img-fluid s_tooltip_tabs_tooltip_image s_figure_link pb0"
src="assets/screenshots/library-management-youtube.png" alt="Cybrosys Cover Video"
style="max-width:100%">
</div>
</div>
</div> -->
<!-- SUGGESTED PRODUCTS --> <!-- SUGGESTED PRODUCTS -->
<div class="row"> <div class="row">
@ -538,7 +520,7 @@
</div> </div>
</div> </div>
</section> </section>
<!-- END OF END OF OUR SERVICES --> <!-- END OF OUR SERVICES -->
<!-- OUR INDUSTRIES --> <!-- OUR INDUSTRIES -->
<section class="container" style="margin-top: 6rem !important;"> <section class="container" style="margin-top: 6rem !important;">
@ -671,7 +653,7 @@
</div> </div>
</section> </section>
<!-- END OF END OF OUR INDUSTRIES --> <!-- END OF OUR INDUSTRIES -->
<!-- FOOTER --> <!-- FOOTER -->
<!-- Footer Section --> <!-- Footer Section -->

BIN
all_in_one_dynamic_custom_fields/static/description/web_icon.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

5
all_in_one_dynamic_custom_fields/views/dynamic_fields.xml

@ -91,9 +91,8 @@
<menuitem id="menu_all_in_one_dynamic_custom_fields_root" <menuitem id="menu_all_in_one_dynamic_custom_fields_root"
name="All in One Custom Dynamic Fields" name="All in One Custom Dynamic Fields"
groups="group_all_in_one_dynamic_custom_fields_user,group_all_in_one_dynamic_custom_fields_administrator" groups="group_all_in_one_dynamic_custom_fields_user,group_all_in_one_dynamic_custom_fields_administrator"
web_icon="all_in_one_dynamic_custom_fields,static/web_icon.png" web_icon="all_in_one_dynamic_custom_fields,static/description/icon.png"
sequence="01" sequence="01"/>
/>
<menuitem id="menu_create_custom_dynamic_fields" <menuitem id="menu_create_custom_dynamic_fields"
name="Fields" name="Fields"

Loading…
Cancel
Save