Chirag Patel (OpenERP) has proposed merging 
lp:~openerp-dev/openerp-web/6.1-opw-573171-cpa into lp:openerp-web/6.1.

Requested reviews:
  OpenERP Core Team (openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openerp-web/6.1-opw-573171-cpa/+merge/99714

Hello,

Fixed form view allow to save when m2m field required and blank.

Demo:
1) Set any m2m field required.
2) Save form without adding any record in m2m field.

Observed: It will allow you to save.
Expected: It must be show notification, m2m field border color 'RED' and 
prevent save record.

Thanks.

-- 
https://code.launchpad.net/~openerp-dev/openerp-web/6.1-opw-573171-cpa/+merge/99714
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openerp-web/6.1-opw-573171-cpa.
=== modified file 'addons/web/static/src/css/base.css'
--- addons/web/static/src/css/base.css	2012-02-27 17:14:40 +0000
+++ addons/web/static/src/css/base.css	2012-03-28 12:44:24 +0000
@@ -1578,6 +1578,12 @@
     background-color: #F66 !important;
     border: 1px solid #D00 !important;
 }
+.openerp td.required table.oe-listview-content{
+    border: 1px solid #D2D2FF !important;
+}
+.openerp td.invalid table.oe-listview-content{
+    border: 1px solid #FF6666 !important;
+}
 .openerp div.oe-progressbar span {
     position: absolute;
     margin-left: 10px;

=== modified file 'addons/web/static/src/js/view_form.js'
--- addons/web/static/src/js/view_form.js	2012-03-05 19:58:00 +0000
+++ addons/web/static/src/js/view_form.js	2012-03-28 12:44:24 +0000
@@ -2664,7 +2664,7 @@
         return [commands.replace_with(this.dataset.ids)];
     },
     validate: function() {
-        this.invalid = false;
+        this.invalid = this.required && !this.dataset.ids.length ? true : false ;
     },
     is_readonly: function() {
         return this.readonly || this.force_readonly;

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to