Merge lp:~openerp-dev/openerp-web/6.1-opw-572829-msh into lp:openerp-web/6.1

Proposed by Mohammed Shekha(Open ERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openerp-web/6.1-opw-572829-msh
Merge into: lp:openerp-web/6.1
Diff against target: 39 lines (+4/-4)
1 file modified
addons/web/static/src/js/view_form.js (+4/-4)
To merge this branch: bzr merge lp:~openerp-dev/openerp-web/6.1-opw-572829-msh
Reviewer Review Type Date Requested Status
Fabien Meghazi (OpenERP) (community) Abstain
Mohammed Shekha(Open ERP) (community) Needs Resubmitting
Xavier (Open ERP) (community) Abstain
Jiten (OpenERP) (community) Approve
Review via email: mp+99468@code.launchpad.net

Description of the change

Hello,

Fixed the issue of blank record created in customer form -> contact one2many field.

Here in (!self.datarecord.id || f.is_dirty()) when there is no datarecord.id at that time it will not going to check for is_dirty and will always get all the field, wheather is changed or not changed, hence it creates empty record in contact.

Thanks.

To post a comment you must log in.
2286. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2287. By Fabien Meghazi (OpenERP)

[FIX] Save icon in event dialog of calendar's day view won't work

2288. By Fabien Meghazi (OpenERP)

[FIX] KeyError: 'drop_db'. When trying to drop db without db name

2289. By Fabien Meghazi (OpenERP)

[FIX] Autocompletion popup gets partially hidden by calendar header

Also removed forgotten debugger

2290. By Fabien Meghazi (OpenERP)

[FIX] No visual feedback for required text fields

2291. By Fabien Meghazi (OpenERP)

[FIX] No tooltip in Web Calendar view. Courtesy of Synconics Technologies

2292. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

Revision history for this message
Mohammed Shekha(Open ERP) (msh-openerp) wrote :

Hello,

Refixed the issue of contact which sets false value in the field and sets field as a dirty field so when do_save is called it will save the contact record to empty record even though I have not touched the contact one2many.

Demo:- install base_contact -> create customer -> when you click on create button it will create one2many record even though you still not touched any field.

This is because when default_get is called it will gives as a response false value for location_id so the location_id is set with false value, creates one record with empty data.

Thanks.

2293. By Fabien Meghazi (OpenERP)

[FIX] web_calendar: ensure dhtmlx minical does not set offsetHeight < 0px, IE<9 raise 'Invalid argument.' breaking the view

2294. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2295. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2296. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2297. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2298. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2299. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2300. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2301. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2302. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2303. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2304. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2305. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2306. By Fabien Meghazi (OpenERP)

[FIX] Honor field's @size with html's @maxlength

2307. By Fabien Meghazi (OpenERP)

[FIX] Calendar in web client does not display all fields

2308. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2309. By Xavier ALT

[MERGE] LP #965326: web: readonly field in a class linked by a many2one doesn't refresh after clicking on a button

2310. By Antony Lesuisse (OpenERP)

[FIX] honor homeaction

2311. By Antony Lesuisse (OpenERP)

[FIX] honor homepage, dirty hack to avoid -u board on production databases

2312. By Olivier Dony (Odoo)

[FIX] base.css: make sure read-only char field contents is always visible

min-height seems the original intention of the
CSS, while height is too restrictive and hides
parts of the field value when it is very long
(and switching to edit mode is not always an
option, e.g. for read-only records like emails)

2313. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2314. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2315. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2316. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

Revision history for this message
Jiten (OpenERP) (jiten-openerp) :
review: Approve
2317. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2318. By Xavier (Open ERP)

[FIX] restriction on database names during backup import

2319. By Xavier (Open ERP)

[MERGE] fix to classes set on editable list rows: oe_forms was not set in case of row being replaced

2320. By Fabien Meghazi (OpenERP)

[FIX] Fix multiple clicks on datetime picker icon causes picker to stay overlay forever.

Fixed datetimepicker addon not forwarding 'widget' option to original datepicker

2321. By Fabien Meghazi (OpenERP)

[FIX] Usability inconsistency -> exception: create != new + edit

2322. By Fabien Meghazi (OpenERP)

[FIX] Problems with statusbar widget under IE8

2323. By Xavier (Open ERP)

[MERGE] missing translation mark in import error dialogs

2324. By Xavier (Open ERP)

[MERGE] fix for form field translation dialog's button label translations

2325. By Fabien Meghazi (OpenERP)

[FIX] Set name when uploading an image is broken on 6.1

2326. By Fabien Meghazi (OpenERP)

[FIX] when dialog is resized, the content pane should reflect the new height too

2327. By Xavier (Open ERP)

[FIX] context and domain of an action being added to a dashboard

* The action's context and domain are needed because they are
  explicitly ignored by those codepaths when the action is ultimately
  executed in the dashboard, and their data are needed: such flags as
  group_by_no_leaf may be set in the action's context, or things like
  the leads/opportunities filters which need to remain in the
  dashboard view.

* On the other hand, some keys in the action's context may be
  detrimental to the correct behavior of the action in the dashboard,
  one such key (group) is the search_default_*: these default values
  for the search view may have been unset by the user before adding to
  the dashboard, we must not add them back. And since the dashboard
  will instantiate a full action/view manager for each action there
  will be (empty) search views which will try to make use of those
  defaults.

As a result, add the action's context and domain to those of the
research while *creating* the dashboard action/section, *but* filter
out search_default_* context keys while doing so.

If new problematic context keys are discovered, they should be added
to the filter.

2328. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2329. By Xavier (Open ERP)

[FIX] correctly save group_by context key when saving a search to a dashboard

2330. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2331. By Xavier (Open ERP)

[FIX] issue with handling of list view priorities in dashboard

dashboard would select the default list view (id=false) instead of the asked/needed one, breaking the application of filters

2332. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2333. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2334. By Olivier Dony (Odoo)

[FIX] data_import: allow importing m2o via name_search() on top of their XML ID

We do default to exporting the XML ID, but there are
many cases where completely new data needs to be
imported and there is no XML ID available to do so.
In that case allowing name_search() to be used as in
6.0 is a life-saver. This patch simply makes the
m2o field itself visible during import, so users can
use it in their CSV file or manually select it.

Some trivial examples:
- you need to import 2000 new leads with their countries,
  obviously you can't guess that base.be should be used
  for country Belgium
- you need to update 2000 unassigned leads in the system
  and assign them to some of the salemen... but you don't
  have their XML IDs and even if you had, the match is
  quite hard to do.

2335. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2336. By Christophe Simonis (OpenERP)

[FIX] web: correct jsonp behavior when len(payload) >= 2000

2337. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2338. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2339. By Xavier (Open ERP)

[FIX] handling of empty lines in CSV file being imported (ignore them)

2340. By Xavier (Open ERP)

[FIX] handling of get_selection in listview in case of non-selectable lists (e.g. editable o2ms?)

OPW 572764

2341. By Xavier (Open ERP)

[FIX] reloading of o2m forms in dialogs (popups) after clicking on a button

2342. By Xavier (Open ERP)

[FIX] handling of empty domains, context and view_id in action descriptors

* Some literal actions (not stored) provide an empty string for
  domains and contexts instead of (respectively) an empty array or an
  empty dict literal inside the string. Treat those case as nothing
  being provided.
* Likewise some literal actions provide nonsensical (but falsy, but
  not False) values for view_id (such as an empty list). Yield a
  ``False`` view_id for all falsy ``view_id`` received (``0`` should
  not be a valid view_id, so ``False`` works)

2343. By Xavier (Open ERP)

[IMP] performances when opening an m2o "search" without any filtering term

Don't prefilter via name_search if no data has been entered in the m2o
field, it's going to return all records (not paginated) so it's a
waste of time and resources

Revision history for this message
Xavier (Open ERP) (xmo-deactivatedaccount) :
review: Abstain
2344. By Xavier (Open ERP)

[FIX] incorrect handling of 'None of the following condition must match' advanced search combinator

Introduced during 'simple style fixes' (sic) of rev <email address hidden>

2345. By Olivier Dony (Odoo)

[MERGE] OPW 574895: fix incorrect matching of column headers when importing CSV files

- required fields may sometimes be provided by alternative columns,
  and all the alternatives are therefore not required (e.g. for
  a m2o the CSV can provide m2o or m2o/id columns)
- when fields share the same label, precedence when matching
  column headers should be given to the field with the exact
  same name, rather than just the first one encountered

2346. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2347. By Xavier (Open ERP)

[IMP] formatting of o2m and m2m fields in list views, courtesy of William Beltrán

backported from trunk revision <email address hidden>

2348. By Xavier (Open ERP)

[FIX] re-display [Add Pad] button after removing the pad from a document

2349. By Xavier (Open ERP)

[IMP] display clean error dialog when user tries to create a database which already exists

2350. By Xavier (Open ERP)

[FIX] Error while deleting a record when there is only one record in pageview

2351. By Xavier (Open ERP)

[ADD] handling of required attr on m2m fields

2352. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2353. By Xavier (Open ERP)

[FIX] mis-handling of url actions in sidebar

2354. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2355. By Fabien Meghazi (OpenERP)

[FIX] Fixed http header Content-Disposition for non-ascii filenames

2356. By Fabien Meghazi (OpenERP)

[FIX] In form view, <image> tag is not a binary image but an <img>

2357. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2358. By Olivier Dony (Odoo)

[FIX] base.xml: missing base URL for <img src> and <form action>, for embeddded mode

2359. By Olivier Dony (Odoo)

[MERGE] Missing tab title made multi-tab use of OpenERP quite difficult - now fixed.

2360. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2361. By Fabien Meghazi (OpenERP)

[REV] Revert revid:<email address hidden> which broke field@widget=image

2362. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2363. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2364. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2365. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2366. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2367. By Xavier (Open ERP)

[FIX] actually clear basic textual fields in search view when [Clear] button used, don't just reset to default value

2368. By Xavier (Open ERP)

[MERGE] vertically flipped x axis labels in MSIE

2369. By Xavier (Open ERP)

[FIX] incorrect clearing of default values on selection fields in search view

and simplification of the same on basic fields

2370. By Xavier (Open ERP)

[MERGE] move filtering of non-searchable fields to prune the fields list itself

if only the *display* list is filtered, the advanced search engine may
still attempt to *select* a non-searchable field (if it's the first
one) leading to broken/nonsensical behavior.

Non-searchable fields should be removed from the advanced search's
ability to find them altogether.

2371. By Xavier (Open ERP)

[MERGE] ensure exception information is correctly converted to string before being concatenated with the faultCode string (sic) of emulated XMLRPC faults

2372. By Xavier (Open ERP)

[IMP] simplify localconnector's exception converter: use Python's facilities correctly

2373. By Xavier (Open ERP)

[MERGE] visual effects fix on diagram nodes in firefox

2374. By Xavier (Open ERP)

[MERGE] behavioral fixes and changes to editable list o2ms

* Correctly propagate current validation status of row being edited
* Automatically save row being edited upon leaving it
* Replace "Save" button (floppy) by "Cancel" (cross)
* Allow easier overriding of Groups and List sub-widgets

2375. By Xavier (Open ERP)

[FIX] action buttons activated in editable o2m lists during or after row edition

2376. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2377. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2378. By Xavier ALT

[MERGE] OPW 573621: web_calendar: fix localisation of calendar view

   backport of trunk <email address hidden>

2379. By Xavier (Open ERP)

[FIX] server action not returning anything should be treated as an empty action descriptor

2380. By Xavier (Open ERP)

[FIX] action-type button from a list row being edited in an o2m

Issue 575065

Flow for a button[@type=action] requires going through multiple RPC
calls to execute action. Due to reloading behavior of o2m-list on
actions (saves containing form then executes action then reloads row),
internal form view gets removed while e.g. server action is being
fetched (in Views#do_execute_action).

Problem: there is guard on ``rpc`` call which drops response to
stopped widget (Widget#rpc) => action/load call never returns
successfully because linked form is dead.

Solution: instead of calling View#do_execute_action via the formview,
call it via the listview (do_execute_action was already partially
overridden to change the ``on_close`` callback, override it further).

=> widget still lives, and rpc requests execute correctly leading to
all actions being correctly called (mostly).

2381. By Xavier (Open ERP)

[FIX] Add new operator case to advanced search: field is set or is not set

2382. By Xavier (Open ERP)

[FIX] missing comma in CSS leading to incorrect selectors

2383. By Xavier (Open ERP)

[FIX] correctly pass along options in ProxyDataSet#write calls

2384. By Xavier (Open ERP)

[FIX] remove custom error handling on saving kanban records

hides actual error (which may be e.g. validation error) and adds no value

2385. By Xavier (Open ERP)

[FIX] make datepicker and timepicker translatable

2386. By Xavier (Open ERP)

[IMP] export translatable strings

2387. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2388. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2389. By Olivier Dony (Odoo)

[FIX] OPW 575804: web_gantt: hide internal dhtmlx duration for tasks/phases, as it is misleading

The `duration` used by the dhtmlx gantt component
corresponds to the calendar duration of the event
divided by 3. This makes sense only for events
spanning full days, and for working times
with 8 hours per day. Unfortunately these
hypotheses do not hold for most cases inside
OpenERP, so we should hide this information.
The actual duration of the items can always
been viewed by clicking on the corresponding
label.

2390. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2391. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2392. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2393. By Xavier (Open ERP)

[ADD] crash manager to embedded client, otherwise RPC errors get silently supressed

2394. By Xavier (Open ERP)

[IMP] make embedded client crash manager configurable

2395. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2396. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2397. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2398. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2399. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2400. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2401. By Xavier (Open ERP)

[FIX] m2o-in-list-o2m focus issues introduced in o2m-autosave

issue revid: <email address hidden>

2402. By Xavier (Open ERP)

[IMP] missing translation marks in form and view editor

2403. By Xavier (Open ERP)

[FIX] dynamic addition of options in select in IE8, for export screen

2404. By Xavier (Open ERP)

[MERGE] manual reimplementation of progress bar for better cross-platform consistency and usability

html5 progress bar can not show progress in letters, so much less precision

2405. By Xavier (Open ERP)

[IMP] automatically close m2o autocomplete list inside dialog if dialog is dragged or resized

avoids autocomplete list being out of sync (positionally) with related m2o dialog

2406. By Xavier (Open ERP)

[TRANSLATIONS] new extraction after addition of new translation marks

2407. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2408. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2409. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2410. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2411. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2412. By Xavier (Open ERP)

[FIX] handling of focus/blur in date fields in relation to o2m autosave

2413. By Xavier (Open ERP)

[FIX] Ensure static file URLs are actually URLs, not windows file paths

2414. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2415. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2416. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2417. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2418. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2419. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2420. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2421. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2422. By Xavier (Open ERP)

[FIX] OPW 575691: parse server datetime manually

datejs's parser completely fails over itself during CST/EST transition

2423. By Xavier (Open ERP)

[FIX] correctly pass context to import_data so e.g. defaults from the action can reach write/update

2424. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2425. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2426. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2427. By Xavier (Open ERP)

[FIX] inability to select an autocompletion via mouse in an m2o in an editable o2m list

Problem due to over-eager form autosave.

Pretty straight backport of
revid:<email address hidden>

2428. By Olivier Dony (Odoo)

[MERGE] OPW 577592: form view - properly flag m2o fields as dirty when removing the value

2429. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2430. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2431. By Xavier (Open ERP)

[FIX] Correctly add new kanban records (from unfolding column) to dataset so they can be edited in form view

2432. By Xavier (Open ERP)

[FIX] make attachment deletion tooltip translatable

attachment_title can't be a method on SidebarAttachment because it doesn't correctly go through qweb context overloads/copies

2433. By Xavier (Open ERP)

[IMP] avoid potential error when specifying duplicated fields in read

Can't reproduce on my browser/machine, may be config-specific, but doesn't really hurt either way

2434. By Xavier (Open ERP)

[FIX] call update_dom on all form fields on save, even when they are valid (to clear out previously set invalid flag)

2435. By Xavier (Open ERP)

[FIX] list-sorting arrow not displayed and incorrectly positioned in Firefox, Opera

2436. By Xavier (Open ERP)

[FIX] don't store current context lang in action when creating ir.ui.view.custom for custom dashboards

2437. By Xavier (Open ERP)

[IMP] reload calendar event after save failure

2438. By Xavier (Open ERP)

[FIX] correctly show import errors from detect_data

wrong class was removed from wrong element

2439. By Xavier (Open ERP)

[FIX] MSIE8 errors out when trying to delete a property on the window host object, so set jsonp callback to null instead

2440. By Xavier (Open ERP)

[FIX] red background not appearing on save button of dirty form in MSIE

also, fix nonsensical -box-shadow property

2441. By Xavier (Open ERP)

[FIX] don't lose request_context argument in One2ManyDataSet#get_context

2442. By Xavier (Open ERP)

[FIX] generate noop stubs for all console methods in case of IE8

2443. By Xavier (Open ERP)

[FIX] restrict set_default values to the current user's company, courtesy of Guewen Baconnier

2444. By Xavier (Open ERP)

[FIX] have translatable url fields work correctly, courtesy of Guewen Baconnier

2445. By Xavier (Open ERP)

[FIX] don't display empty (false) fields literally in calendar event info

2446. By Xavier (Open ERP)

[IMP] re-export translation templates

2447. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2448. By Xavier (Open ERP)

[FIX] OPW 578531 Correctly invalidate BufferedDatasetCache when triggering an action @type=action ~/projects/tiny/web/current

otherwise when reloaded the record gets re-fetched from the cache, so
any modification from the action remains invisible until the parent
record itself is reloaded

2449. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2450. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2451. By Xavier (Open ERP)

[FIX] o2m breakage introduced in <email address hidden>

BufferedDataSet#read_ids expect coherent between #cache and
#to_create, patch removed a record from #cache which was in #to_create
leading to not being able to create new records in editable o2ms:

* The record would be inserted in #cache and #to_create
* The listview would reload the record
  - Evicting the record from #cache
  - And re-reading the record
  - Leading to breakage

Don't evict records locally edited from the cache, the server probably
doesn't know about it (at all) or we can assume the server's outdated,
so the local version remains the "correct" one and there's nothing
more recent to fetch.

2452. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2453. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2454. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2455. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2456. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2457. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2458. By Mohammed Shekha(Open ERP)

[FIX]Also fixed the issue of page view, if we don't have record then dataset.index will have -1 so it will go to read_index with index = -1 so it will fail and page view is not loaded.

Revision history for this message
Mohammed Shekha(Open ERP) (msh-openerp) wrote :

Hello,

After fixing this issue I found that page view was broken, so fixed that.

Demo :- Apply fix of this branch except last change that is I have checked dataset.index < 0, now if you create customer without any contact detail and save it, view is switched to page view but record is not loaded in page view.

Reason is that dataset.index is -1 so it will go for read_index with index = -1 and fails, hence checked for -1 index also.

Thanks.

review: Needs Resubmitting
Revision history for this message
Fabien Meghazi (OpenERP) (fme) :
review: Abstain

Unmerged revisions

2458. By Mohammed Shekha(Open ERP)

[FIX]Also fixed the issue of page view, if we don't have record then dataset.index will have -1 so it will go to read_index with index = -1 so it will fail and page view is not loaded.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'addons/web/static/src/js/view_form.js'
2--- addons/web/static/src/js/view_form.js 2012-09-03 13:17:44 +0000
3+++ addons/web/static/src/js/view_form.js 2012-09-17 12:37:19 +0000
4@@ -181,7 +181,7 @@
5 this.$element.removeClass('oe_form_dirty');
6 return this.has_been_loaded.pipe(function() {
7 var result;
8- if (self.dataset.index === null) {
9+ if (self.dataset.index === null || self.dataset.index < 0) {
10 // null index means we should start a new record
11 result = self.on_button_new();
12 } else {
13@@ -225,7 +225,7 @@
14 // New record: Second pass in order to trigger the onchanges
15 // respecting the fields order defined in the view
16 _.each(self.fields_order, function(field_name) {
17- if (record[field_name] !== undefined) {
18+ if (record[field_name] && record[field_name] !== undefined) {
19 var field = self.fields[field_name];
20 field.dirty = true;
21 self.do_onchange(field);
22@@ -529,7 +529,7 @@
23 if (!first_invalid_field) {
24 first_invalid_field = f;
25 }
26- } else if (f.name !== 'id' && !f.readonly && (!self.datarecord.id || f.is_dirty())) {
27+ } else if (f.name !== 'id' && !f.readonly && f.is_dirty()) {
28 // Special case 'id' field, do not save this field
29 // on 'create' : save all non readonly fields
30 // on 'edit' : save non readonly modified fields
31@@ -543,7 +543,7 @@
32 return $.Deferred().reject();
33 } else {
34 var save_deferral;
35- if (!self.datarecord.id) {
36+ if (!self.datarecord.id && (!_.isEmpty(values) || self.force_dirty)) {
37 //console.log("FormView(", self, ") : About to create", values);
38 save_deferral = self.dataset.create(values).pipe(function(r) {
39 return self.on_created(r, undefined, prepend_on_create);