Skip to content

Commit

Permalink
Merge pull request #8 from OCA/14.0
Browse files Browse the repository at this point in the history
Fork Sync Branch 14.0
  • Loading branch information
btl-bot authored Oct 19, 2023
2 parents 65e0a34 + 41529c1 commit 0d3a258
Show file tree
Hide file tree
Showing 46 changed files with 1,534 additions and 29 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,13 @@ addon | version | maintainers | summary
[web_calendar_slot_duration](web_calendar_slot_duration/) | 14.0.1.0.0 | [![Yajo](https://github.com/Yajo.png?size=30px)](https://github.com/Yajo) | Customizable calendar slot durations
[web_company_color](web_company_color/) | 14.0.2.0.0 | | Web Company Color
[web_copy_confirm](web_copy_confirm/) | 14.0.1.0.0 | | Show confirmation dialogue before copying records
[web_create_write_confirm](web_create_write_confirm/) | 14.0.1.0.0 | | Confirm/Alert pop-up before saving
[web_create_write_confirm](web_create_write_confirm/) | 14.0.1.1.0 | [![ilyasProgrammer](https://github.com/ilyasProgrammer.png?size=30px)](https://github.com/ilyasProgrammer) | Confirm/Alert pop-up before saving
[web_decimal_numpad_dot](web_decimal_numpad_dot/) | 14.0.1.0.0 | | Allows using numpad dot to enter period decimal separator
[web_dialog_size](web_dialog_size/) | 14.0.1.0.0 | | A module that lets the user expand a dialog box to the full screen width.
[web_disable_export_group](web_disable_export_group/) | 14.0.2.0.0 | | Web Disable Export Group
[web_domain_field](web_domain_field/) | 14.0.1.0.2 | | Use computed field as domain
[web_drop_target](web_drop_target/) | 14.0.1.1.1 | | Allows to drag files into Odoo
[web_edit_user_filter](web_edit_user_filter/) | 14.0.1.0.0 | | Edit User Filters
[web_environment_ribbon](web_environment_ribbon/) | 14.0.1.0.0 | | Web Environment Ribbon
[web_field_required_invisible_manager](web_field_required_invisible_manager/) | 14.0.2.1.3 | [![ilyasProgrammer](https://github.com/ilyasProgrammer.png?size=30px)](https://github.com/ilyasProgrammer) | Web Field Required Invisible Readonly Managerr
[web_group_expand](web_group_expand/) | 14.0.1.0.0 | | Group Expand Buttons
Expand Down Expand Up @@ -70,7 +71,7 @@ addon | version | maintainers | summary
[web_widget_child_selector](web_widget_child_selector/) | 14.0.1.0.1 | | Widget used for navigation on hierarchy fields
[web_widget_ckeditor](web_widget_ckeditor/) | 14.0.1.0.2 | [![ivantodorovich](https://github.com/ivantodorovich.png?size=30px)](https://github.com/ivantodorovich) | Provides a widget for editing HTML fields using CKEditor
[web_widget_datepicker_fulloptions](web_widget_datepicker_fulloptions/) | 14.0.1.0.0 | | Web Widget DatePicker Full Options
[web_widget_domain_editor_dialog](web_widget_domain_editor_dialog/) | 14.0.1.0.1 | | Recovers the Domain Editor Dialog functionality
[web_widget_domain_editor_dialog](web_widget_domain_editor_dialog/) | 14.0.1.0.2 | | Recovers the Domain Editor Dialog functionality
[web_widget_dropdown_dynamic](web_widget_dropdown_dynamic/) | 14.0.1.0.0 | | This module adds support for dynamic dropdown widget
[web_widget_image_download](web_widget_image_download/) | 14.0.1.0.0 | | Allows to download any image from its widget
[web_widget_image_webcam](web_widget_image_webcam/) | 14.0.1.0.1 | | Allows to take image with WebCam
Expand Down
2 changes: 1 addition & 1 deletion setup/_metapackage/VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14.0.20230724.0
14.0.20231018.0
1 change: 1 addition & 0 deletions setup/_metapackage/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
'odoo14-addon-web_disable_export_group',
'odoo14-addon-web_domain_field',
'odoo14-addon-web_drop_target',
'odoo14-addon-web_edit_user_filter',
'odoo14-addon-web_environment_ribbon',
'odoo14-addon-web_field_required_invisible_manager',
'odoo14-addon-web_group_expand',
Expand Down
6 changes: 6 additions & 0 deletions setup/web_edit_user_filter/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)
14 changes: 11 additions & 3 deletions web_create_write_confirm/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Confirm/Alert pop-up before saving
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:7ffe943eb22ee465e35d6e7d5eeca244b46c04ac4b25c62a1afc5c214fa80ca9
!! source digest: sha256:9a2b87a13801cefbe6e4daaeda2556665241e46995fa392222f939ea05134cb7
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand Down Expand Up @@ -51,7 +51,7 @@ Confirm res.partner change:
msg = self.env['popup.message'].create(
{
'model_id': self.env['ir.model'].search([('model', '=', 'res.partner')]).id,
'model_id': self.env['ir.model']._get_id('res.partner')
'field_ids': [(6, 0, self.env['ir.model.fields'].search([('model', '=', 'res.partner')]).ids)],
'popup_type': 'confirm',
'title': 'Warning',
Expand All @@ -66,7 +66,7 @@ Sale order alert:
msg = self.env['popup.message'].create(
{
'model_id': self.env['ir.model'].search([('model', '=', 'sale.order')]).id,
'model_id': self.env['ir.model']._get_id('sale.order'),
'field_ids': [(6, 0, self.env['ir.model.fields'].search([('model', '=', 'sale.order')]).ids)],
'popup_type': 'alert',
'title': 'Attention',
Expand Down Expand Up @@ -116,6 +116,14 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

.. |maintainer-ilyasProgrammer| image:: https://github.com/ilyasProgrammer.png?size=40px
:target: https://github.com/ilyasProgrammer
:alt: ilyasProgrammer

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-ilyasProgrammer|

This module is part of the `OCA/web <https://github.com/OCA/web/tree/14.0/web_create_write_confirm>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
3 changes: 2 additions & 1 deletion web_create_write_confirm/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@

{
"name": "Confirm/Alert pop-up before saving",
"version": "14.0.1.0.0",
"version": "14.0.1.1.0",
"depends": ["web"],
"author": "Smile, Odoo Community Association (OCA)",
"maintainers": ["ilyasProgrammer"],
"license": "AGPL-3",
"website": "https://github.com/OCA/web",
"category": "Tools",
Expand Down
7 changes: 3 additions & 4 deletions web_create_write_confirm/models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
class BaseModel(models.AbstractModel):
_inherit = "base"

def get_message_informations(self, values=False):
def get_popup_message_info(self, values=False):
"""
This function gives us the possibility to know
if we display the message or not
Retrieve popup messages' data.
- In create self is empty
- In write self is not empty contains current ID
:param values:
Expand All @@ -22,7 +21,7 @@ def get_message_informations(self, values=False):
"""
return False

def execute_processing(self, values=False):
def process_popup_message(self, values=False):
"""
This function gives us the possibility to execute a
specific treatment after the confirmation of the message
Expand Down
4 changes: 2 additions & 2 deletions web_create_write_confirm/models/popup_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ class PopupMessage(models.Model):
default="confirm",
selection=[("confirm", "Confirmation"), ("alert", "Alert")],
)
title = fields.Char(string="Title")
message = fields.Text(string="Message", required=True)
title = fields.Char(string="Title", translate=True)
message = fields.Text(string="Message", required=True, translate=True)
active = fields.Boolean(string="Active", default=True)

@api.depends("field_ids")
Expand Down
4 changes: 2 additions & 2 deletions web_create_write_confirm/readme/USAGE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Confirm res.partner change:
msg = self.env['popup.message'].create(
{
'model_id': self.env['ir.model'].search([('model', '=', 'res.partner')]).id,
'model_id': self.env['ir.model']._get_id('res.partner')
'field_ids': [(6, 0, self.env['ir.model.fields'].search([('model', '=', 'res.partner')]).ids)],
'popup_type': 'confirm',
'title': 'Warning',
Expand All @@ -24,7 +24,7 @@ Sale order alert:
msg = self.env['popup.message'].create(
{
'model_id': self.env['ir.model'].search([('model', '=', 'sale.order')]).id,
'model_id': self.env['ir.model']._get_id('sale.order'),
'field_ids': [(6, 0, self.env['ir.model.fields'].search([('model', '=', 'sale.order')]).ids)],
'popup_type': 'alert',
'title': 'Attention',
Expand Down
8 changes: 5 additions & 3 deletions web_create_write_confirm/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ <h1 class="title">Confirm/Alert pop-up before saving</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:7ffe943eb22ee465e35d6e7d5eeca244b46c04ac4b25c62a1afc5c214fa80ca9
!! source digest: sha256:9a2b87a13801cefbe6e4daaeda2556665241e46995fa392222f939ea05134cb7
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/web/tree/14.0/web_create_write_confirm"><img alt="OCA/web" src="https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/web-14-0/web-14-0-web_create_write_confirm"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/web&amp;target_branch=14.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module provides feature to create custom confirmation or alert dialog when user creates or writes record.
Expand Down Expand Up @@ -396,7 +396,7 @@ <h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
<pre class="code python literal-block">
<span class="n">msg</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">env</span><span class="p">[</span><span class="s1">'popup.message'</span><span class="p">]</span><span class="o">.</span><span class="n">create</span><span class="p">(</span><span class="w">
</span> <span class="p">{</span><span class="w">
</span> <span class="s1">'model_id'</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">env</span><span class="p">[</span><span class="s1">'ir.model'</span><span class="p">]</span><span class="o">.</span><span class="n">search</span><span class="p">([(</span><span class="s1">'model'</span><span class="p">,</span> <span class="s1">'='</span><span class="p">,</span> <span class="s1">'res.partner'</span><span class="p">)])</span><span class="o">.</span><span class="n">id</span><span class="p">,</span><span class="w">
</span> <span class="s1">'model_id'</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">env</span><span class="p">[</span><span class="s1">'ir.model'</span><span class="p">]</span><span class="o">.</span><span class="n">_get_id</span><span class="p">(</span><span class="s1">'res.partner'</span><span class="p">)</span><span class="w">
</span> <span class="s1">'field_ids'</span><span class="p">:</span> <span class="p">[(</span><span class="mi">6</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">env</span><span class="p">[</span><span class="s1">'ir.model.fields'</span><span class="p">]</span><span class="o">.</span><span class="n">search</span><span class="p">([(</span><span class="s1">'model'</span><span class="p">,</span> <span class="s1">'='</span><span class="p">,</span> <span class="s1">'res.partner'</span><span class="p">)])</span><span class="o">.</span><span class="n">ids</span><span class="p">)],</span><span class="w">
</span> <span class="s1">'popup_type'</span><span class="p">:</span> <span class="s1">'confirm'</span><span class="p">,</span><span class="w">
</span> <span class="s1">'title'</span><span class="p">:</span> <span class="s1">'Warning'</span><span class="p">,</span><span class="w">
Expand All @@ -409,7 +409,7 @@ <h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
<pre class="code python literal-block">
<span class="n">msg</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">env</span><span class="p">[</span><span class="s1">'popup.message'</span><span class="p">]</span><span class="o">.</span><span class="n">create</span><span class="p">(</span><span class="w">
</span> <span class="p">{</span><span class="w">
</span> <span class="s1">'model_id'</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">env</span><span class="p">[</span><span class="s1">'ir.model'</span><span class="p">]</span><span class="o">.</span><span class="n">search</span><span class="p">([(</span><span class="s1">'model'</span><span class="p">,</span> <span class="s1">'='</span><span class="p">,</span> <span class="s1">'sale.order'</span><span class="p">)])</span><span class="o">.</span><span class="n">id</span><span class="p">,</span><span class="w">
</span> <span class="s1">'model_id'</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">env</span><span class="p">[</span><span class="s1">'ir.model'</span><span class="p">]</span><span class="o">.</span><span class="n">_get_id</span><span class="p">(</span><span class="s1">'sale.order'</span><span class="p">),</span><span class="w">
</span> <span class="s1">'field_ids'</span><span class="p">:</span> <span class="p">[(</span><span class="mi">6</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">env</span><span class="p">[</span><span class="s1">'ir.model.fields'</span><span class="p">]</span><span class="o">.</span><span class="n">search</span><span class="p">([(</span><span class="s1">'model'</span><span class="p">,</span> <span class="s1">'='</span><span class="p">,</span> <span class="s1">'sale.order'</span><span class="p">)])</span><span class="o">.</span><span class="n">ids</span><span class="p">)],</span><span class="w">
</span> <span class="s1">'popup_type'</span><span class="p">:</span> <span class="s1">'alert'</span><span class="p">,</span><span class="w">
</span> <span class="s1">'title'</span><span class="p">:</span> <span class="s1">'Attention'</span><span class="p">,</span><span class="w">
Expand Down Expand Up @@ -452,6 +452,8 @@ <h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.</p>
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
<p><a class="reference external image-reference" href="https://github.com/ilyasProgrammer"><img alt="ilyasProgrammer" src="https://github.com/ilyasProgrammer.png?size=40px" /></a></p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/web/tree/14.0/web_create_write_confirm">OCA/web</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
Expand Down
11 changes: 5 additions & 6 deletions web_create_write_confirm/static/src/js/pop_up_confirmation.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ odoo.define("web_create_write_confirm.pop_up_confirmation", function (require) {
var changes = self.model.localData[self.handle]._changes;
self.getMessageInformation(
modelName,
"get_message_informations",
"get_popup_message_info",
record_id,
changes === null ? {} : changes
).then(function (results) {
this.display_popup(results, record, record_id, ev, changes, modelName);
self.display_popup(results, record, record_id, ev, changes, modelName);
});
},

Expand Down Expand Up @@ -76,11 +76,11 @@ odoo.define("web_create_write_confirm.pop_up_confirmation", function (require) {
} else if (popup_values.length === index) {
self.getMessageInformation(
modelName,
"execute_processing",
"process_popup_message",
record_id,
datas
);
this.save(ev);
this.save();
}
},
}).on("closed", null, resolve);
Expand All @@ -90,14 +90,13 @@ odoo.define("web_create_write_confirm.pop_up_confirmation", function (require) {
});
}
} else {
this.save(ev);
self.save();
}
});
},

save: function ev() {
var self = this;
ev.stopPropagation();
self._disableButtons();
self.saveRecord()
.then(self._enableButtons.bind(self))
Expand Down
4 changes: 2 additions & 2 deletions web_create_write_confirm/tests/test_base_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def test_compute_field_name(self):

def test_get_message_informations(self):
"""Test correct flow of get_message_informations method"""
ret_value_of_method = self.base_model.get_message_informations()
ret_value_of_method = self.base_model.get_popup_message_info()
check_ret_value = False
if (ret_value_of_method is False) or isinstance(
ret_value_of_method, type(self.env["popup.message"])
Expand All @@ -51,5 +51,5 @@ def test_get_message_informations(self):
def test_execute_processing(self):
"""Test correct flow of execute_processing method"""
self.assertFalse(
self.base_model.execute_processing(), msg="Return value must be False"
self.base_model.process_popup_message(), msg="Return value must be False"
)
Loading

0 comments on commit 0d3a258

Please sign in to comment.