This commit adds a recordsDraggable option on the kanban view that allows to completly disable
the drag and drop feature.
This is a preliminary work for the social 'Feeds' kanban where the user should not be able to drag and drop posts.
When changing an employee's parent_id, the leave_manager_id
should be updated to the new parent_id's user, UNLESS
leave_manager_id was changed manually.
i.e leave_manager_id != previous parent_id
closesodoo/odoo#37190
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Currently, parent_id is defined on hr.employee. This field
as an onchange defined.
But the inherit of hr.employee.base in the leave module
adds an onchange('parent_id'). The onchange method is never
called because the onchange in hr.employee does not call super
(which it's not supposed to do because the parent model
does not have the parent_id field).
To fix the issue, parent_id and all its onchange methods
are now defined on hr.employee.base
Currently, when an employee's manager (parent_id) changes,
the leave manager (leave_manager_id) is set to the new manager
if it was not manually changed (leave_manager_id != parent_id.user_id).
Please, note that `parent_id` is an `hr.employee` while `leave_manager_id`
is a `res.users`. Hence if `leave_manager_id` is not set, we have
`leave_manager_id == False`.
Next time we change `parent_id` (employee with a user)
we have `False != parent_id.user_id` and the leave_manager_id
is not set.
This commit adds the concept of sms into the utm.campaign
* Add "Send new sms" button to the cta
* Add a SMS stat button
* Add a sms page in the notebook
LINKS
Task ID 2074813 (FP request UTM refactor)
closes odoo/odoo#37185
Pr: #37185
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit cleans up the utm.campaign form view:
* Don't display mailing related things if no mailings on the campaign or
if the campaigns were not activated in mass_mailing settings;
* Stat button for the mass mailings was wrong, it was displaying the number
of mails instead of the number of mailings;
* Remove unused global click ratio field all other fields/methods related
to its computation;
* Remove ab testing cta on campaign form;
* Add groups on mailing related fields to avoid access errors;
LINKS
Task ID 2074813 (FP request UTM refactor)
PR: #37185
Considering that mass_mailing, mass_mailing_sms and social all had their
own buttons to add in the header, the header previously defined in
mass_mailing had to be moved into the root utm form view.
Task ID 2074813 (FP request UTM refactor)
PR: #37185
Having a global click ratio on the campaign was pointless considering the
nature of the social.app and its posts. Therefore, we decided to have a
global click count which gives a better idea of the popularity of the campaign
itself.
Task ID 2074813 (FP request UTM refactor)
PR: #37185
Purpose of this commit is to add an anchor in mass mailing view in order
to ease some marketing automation fixes.
Also reset the sms composer context when sending sms from an sms mailing
as it may create some issues when sending manually an sms from a marketing
activity (see enteprise). Indeed wrong participant is chosen.
Task ID 2073158 (marketing automation fixes)
PR #37185
PR odoo/enterprise#5693
In the email/sms marketing form (edition), only on debug mode, we can get
a js traceback (bootstrap tooltip can't be show for a invisible element,
the domain field in this case) when we change the recipient model from Mailing
List -> a other model -> Mailing List. We avoid the traceback by putting
invisible a parent div of the domain fields instead of the domain field
itself.
In the email/sms marketing form (edition), we can create a email/sms marketing
without any recipient model which cause a issue on the kanban view (blank
space). Also behind the scene the mass mailing contact model is used. To
clarify and fix the issue in kanban view, the recipient model is now required
in the form view.
In the email/sms marketing form (debug mode only), we can create a email/sms
marketing with "allow A/B testing" checked without a campaign marketing
(not logical), which lead to a traceback when the email are sent. To fix
this issue, we move the "Allow A/B testing" field in the group form called
"marketing" and when it is checked the campaign marketing field is mandatory.
Task ID 2058738 (mass mailing internal testing)
PR #37185
As mailings are now using subject as naming field and name is now a technical
field used for utm source, let us use the subject as rec_name of the mailing
model.
LINKS
Task ID 2072130
PR: #36935
This commit hides the field "name" of the mailing.mailing model.
Instead of having both fields "name" and "subject" on the form, "name" will
only be visible in debug mode leaving only "subject" to be visible for other
users. Indeed name is a more technical field used to create and find UTM
source record back while subject is the real business field.
This change implies that the name will now be set by default in the create
method so that the UTMs keeps working as they were. The name will be
constructed as follow: "subject create_date".
If the admin decides to set the name himself, the name will not be set
by default. Field is set in debug mode to allow its edition.
In mass mailing sms subject field is made visible. The name field being only
visible in debug mode now, the subject field had to be made visible in the
mailing form of the mass_mailing_sms module.
LINKS
Task ID 2072130 (hide name on mass mailing)
PR: #36935
sms, in the form view of sms composer (mass composition) : we got a blocking
message when we validate the composer sms with records which doesn't have a
phone number.
However we generally explicitly handle void numbers: in composer in comment
mode there is an User Error, and mass mode has specific error code to put on
sms records telling number is void (and sms is in error, meaning it will not)
be sent.
As sms record is required notably for mass mailing traces and marketing
automation traces we have to keep sms records with void numbers. We therefore
remove the required attribute on sms record.
Task ID 2073016 (sms fixes)
PR #37185
Specifications
* sms, in the form view of sms composer : the count of all record doesn't
match the reality in a multi-company environment. The search_count was
done is sudo, then records of other company was taken in account in the
count. Fix by explicitly setting fields as computer_sudo=False;
* mass_mailing, in the kanban view of mail marketing : A warning ribbon
("insufficient credit") appeared on the kanban item of mass mailing, but
the message was for sms marketing views only. Change the attributes to be
invisible for mail marketing;
* mass_mailing, in the form view of mail mailing : Weird default domain
filter ([0 = 1]) was display instead of an empty domain filter;
* mass_mailing_sms, in the test sms wizard, remove a duplicate error message :
When the number format was wrong a duplicate error message pop up. Fix by
simplify the model and remove useless computed fields.
* mass_mailing_sms, in the test sms wizard, rename the label "Number" to
"Number(s)" to show that it can multiples ones.
Task ID 2073016 (sms fixes)
PR #37185
PURPOSE
Do like Mail Speakers, but with SMS, in a single "Contact" button.
SPECIFICATIONS
Specifications:
* on event form view, rename "Mail Speakers" button to "Contact Speakers"
and open a mixed for view on mailing.mailing allowing to choose the type
of mailing;
* send SMS to all speakers;
* see https://drive.google.com/file/d/1-7iDaNJSZbdTW1PYMU2vWtfPHGJmN7SF/edit
FP "Testing Weekend nothing works" request
LINKS
Task ID 2075183 (sms on speakers)
PR #37185
PURPOSE
Do like Mail Attendees, but with SMS, in a single "Contact" button.
SPECIFICATIONS
Specifications:
* on event form view, rename "Mail Attendees" button to "Contact Attendees"
and open a mixed for view on mailing.mailing allowing to choose the type
of mailing;
* send SMS to all attendees;
* see https://drive.google.com/file/d/1-7iDaNJSZbdTW1PYMU2vWtfPHGJmN7SF/edit
FP "Testing Weekend nothing works" request
LINKS
Task ID 2074848 (sms on attendees)
PR #37185
Currently in mass_mailing_sms form view of mailing is displaying differently
depending on mailing_type field that is hidden. Purpose is to have a single
form view while not allowing people to change the mailing type as they
always come from a context where it is given (mass_mailing -> mail, mass
mailing sms -> sms, same in marketing automation(_sms)).
In this commit we create a new form view based on the existing one (inherit
and primary) with the only change currently being the mailing_type being
displayed.
It will be used in some cases when we want people to contact in mass records
without knowing if it will be mail or sms. For example on event, allowing
to contact attendees and choose either mail or sms, avoiding to define
two buttons and actions on event form view.
Task ID 2074848 (sms on attendees)
Task ID 2075183 (sms on speakers)
PR #37185
As date is not required, trying to make a new date from it crashes. Let us
set value to False to ensure always having a value (new ORM computed yay)
and avoir crash (woop woop).
Spotted in task ID 2075183 (sms on speakers).
PR #37185
* External payment fetching the stripe API need valid account/key in order
to perform the tests.
* 1st test is testing the previous stripe API, it has been disabled.
* 2nd test is testing for values removed by 595c0ad8ee, the test has
been updated to only ensure the form renders without error.
* 3rd test is testing for amount sent as integers while stripe requires
as cents.
closesodoo/odoo#37160
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
When creating a new picking, in case the user creates stock.move before
define the picking type, the move has no `company_id`.
Also, if they changes the picking type for an another company picking
type, the `company_id`of the move already created doesn't corresponding
anymore to the `company_id`of the picking anymore.
So, when create a new picking, we now insure the write the `company_id`
of new stock.move to be sure these cases was handle.
closesodoo/odoo#37130
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
Purpose
=======
The commit 2849b5c introduces a new export mechanism of grouped
list views to xls files.
The issue with this development is mainly that the displayed records
are exported, instead of all the records that match the search
parameters.
To export all the records we cannot rely on the data from the web
client. This implies to revert 2849b5c, and implement it in a better
way.
Functional Spec
===============
Add the support of grouped exports.
Allow the user to export all records in one click from
the listview, without having to go through the export modal,
taking into account the domain, groupbys, and visible fields.
Technical Spec
==============
When exporting (whether it is from the modal or from the shortcut),
any groupby(s) set on the listview should be taken into account (all unfolded)
- UNLESS the export is import-compatible
- each subgroup header has an indentation compared to its parent
- the 'group headers' in the exported file should contain the
same info (label, field aggregates) as it has in the listview.
New secondary button on the tree view with label 'EXPORT' (to be confirmed...)
- the export shortcut disregard the selected records, it exports all records
according to the domain.
- the button is visible even if there is no selected records.
- essentially the export shortcut does the same thing as the following:
- select all records
- hit 'action' then 'export'
- hit 'export'
Define a boolean attribute on <tree> to specify whether or not the export
shortcut should be displayed
Task 2072910
closesodoo/odoo#37087
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
PURPOSE
=======
Add the support of grouped exports.
Allow the user to export all records in one click from
the listview, without having to go through the export modal,
taking into account the domain, groupbys, and visible fields.
SPECIFICATION
=============
When exporting (whether it is from the modal or from the shortcut),
any groupby(s) set on the listview should be taken into account (all unfolded)
- UNLESS the export is import-compatible
- each subgroup header has an indentation compared to its parent
- the 'group headers' in the exported file should contain the
same info (label, field aggregates) as it has in the listview.
New secondary button on the tree view with label 'EXPORT' (to be confirmed...)
- the export shortcut disregard the selected records, it exports all records
according to the domain.
- the button is visible even if there is no selected records.
- essentially the export shortcut does the same thing as the following:
- select all records
- hit 'action' then 'export'
- hit 'export'
Define a boolean attribute on <tree> to specify whether or not the export shortcut should be displayed
Task 2072910
PURPOSE
Previously when the 'SAVE & NEW' button was pressed in the 'create and
edit...' menu of the many2many_tags widget was pressed, the modal window
would close and the button would act exactly like the 'SAVE & CLOSE'
button. This was due to the fact that whenever a new record was created
and added to the field, it would reset the many2one field it uses for
display, which would destroy the edit modal.
This commit fixes that by not notifying the underlying many2one field of
any change until the modal is closed by the user. This has the
disadvantage that tags display, if visible behind the modal 'shade',
will not be updated until the modal is closed, but restores the
functionality of the save&new button. It also adds a test for this
behaviour
task-2070454
closesodoo/odoo#37114
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
The gantt view allows the dragged pill to be copied when
the key ctrl (or command) is pressed. In order to be
able to test that feature, we had to modify
testUtils.dragAndDrop. This is done in the present
commit.
closesodoo/odoo#37074
Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
When creating a new database from the database manager, with no open
cursor, the wrong env was retrieved during the cr.commit() call.
2019-09-09 18:16:07,454 19886 ERROR None odoo.service.db: CREATE DATABASE failed:
Traceback (most recent call last):
File "/home/odoo/odoo/service/db.py", line 60, in _initialize_db
cr.commit()
File "/home/odoo/odoo/sql_db.py", line 165, in wrapper
return f(self, *args, **kwargs)
File "/home/odoo/odoo/sql_db.py", line 389, in commit
env = get_env(currentframe(), 2)
File "/home/odoo/odoo/sql_db.py", line 72, in get_env
env = getattr(frame.f_locals.get('self'), 'env', SENTINEL)
File "/home/odoo/odoo/http.py", line 268, in env
self._env = odoo.api.Environment(self.cr, self.uid, self.context)
File "/home/odoo/odoo/http.py", line 238, in cr
raise RuntimeError('request not bound to a database')
get_env method checks every frame to find a variable called 'env'
As none was found, it used the one of the WebRequest object.
In a WebRequest, env is a property that will try to create a new
Environment, which fails as no database is available (yet).
At eafdf1812d the iteration on Environment.envs was removed as envs
is a weakset and it introduced potential errors where the content was
garbage-collected during the iteration.
Go back to the simpler iteration but convert the set to list to avoid
garbage-collection issues.
Fixesodoo/odoo#36588closesodoo/odoo#37005
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Co-authored-by: Raphael Collet <rco@odoo.com>
The FieldColor widget had been designed exclusively for the document
layout configurator. Because of this, the widget would not display/behave
correctly in other views.
Before this commit:
- in list views, the widget had a "white-space" attribute adapted for char fields,
which gave it much more space than it needed
- there was no handling of the widget in readonly state: it was always editable
- its size in list views was a bit too large
Now:
- all styling problems have been adjusted for list views (unchanged for forms)
- the widget is disabled when in readonly mode
Task 2072466
closesodoo/odoo#36949
Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
* Changed the default value of datetime to "is between" with "today"
as the default value (same day 00:00:00 to 23:59:59).
* Changed the style of the "Close" button to match the one on the "primary buttons".
* added increments to the minutes in daterange
Minutes can now be chosen by increments of 5 instead of 10.
Task 2068164
--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
closesodoo/odoo#36775
Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
TransientModel (wizards) can be annoying because if they have required
many2one fields, those fields will default to `ondelete='restrict'`,
preventing user to delete the comodel records without deleting the
transient model records first.
To improve such case, we default to `ondelete='cascade'` for required
many2one field on a TransientModel (unless specified otherwise)
closesodoo/odoo#36738
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
In multi-level checkboxes, if there is only one checkbox per level, the
expected behavior is that all checkbox will be checked if one of them is
checked. This was not the case before this commit.
When setting align right on a picture, the popover of the picture was
partially overflowing the editable zone, rendering it useless.
This commit mimicks the behavior of Odoo 12 by disabling the fact
that the popover follows the picture.
The `get_technical_translations()` method was returning wrong list of list
for field selection values; instead we flatten the results to get a correct
domain.
closesodoo/odoo#37101
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
If the journal is set to post entries at bank reconciliation, payment entries that are validated have their associated account_move in draft.
Or we still want those to appear in the invoices/bills as outstanding credit/debit.
This commit fixes this problem by adapting the domain used to fetch the payment lines that should be displayed as outstanding debit/credit.
closesodoo/odoo#37091
Signed-off-by: Cedric Snauwaert (csn) <csn@openerp.com>
The style for custom color in the editor color menu from 12.0 was
dropped in 12.3 (correctly because of the changed structure) but in 12.5
the HTML structure changed again and the CSS is once again necessary.
opw-2073734
closes#37090
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
When you add a discount, the price is changed on the product, and so
when you have enabled options to display the discount, the product is
shown as discounted. So we are modifying the lst_price too (like for
tip) to avoid having differences between prices.
closesodoo/odoo#37089
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
When a draft move is created and saved, we cannot post a pdf on it
anymore because facturx expects a default journal entry type to be in
the context in _import_facturx_invoice.
In this case, it is not in the context anymore because it has already
been saved on the account.move on which we try to post the pdf.
closesodoo/odoo#37055
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
Prior to this commit, the Time Off Analysis report was showing the
leaves of all employees and not the ones selected.
closesodoo/odoo#37048
Taskid: 2073345
Signed-off-by: Romain Libert (rli) <rli@odoo.com>
Before this commit, you can start a repair order with negative value
into its operations (who will cause a dead end when user will try to end
it). So, now a check is done when user tries to start it.
closesodoo/odoo#37045
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
When user confirms a repair order for a consumable product, they always
get a warning wizard about insufficient quantity.
But as we don't track quantity for consumables, this wizard is useless.