Commit Graph
123198 Commits
Author SHA1 Message Date
David Beguin 7dea1d7208 [FIX] survey : restore debug mode for survey pages
During cleaning from ee2631cd51,
as the kwargs were removed from arguments for some routes,
debug mode was not accessible anymore as ?debug=x is, de facto,
a post argument.

This commit restores debug mode by restoring kwargs in those routes.

Fix commit from task ID 1911586 and PR #28986
Integrated in task ID 1911291 and PR #29054
2019-01-17 09:49:50 +00:00
Haresh Shyara 0e6d9863ec [IMP] purchase_requisition: improve test
Create data for all tests in order to speed data test creation. We don't want the test to be demo data dependent
What we are testing in this test case.

-> Check that procurement is creating requisition with correct details or not.
-> Check that purchase order created is consistent when we create it with supplier info.
-> Two blanket orders on different 'make to order' products must generate two different purchase orders.

Task ID : 1851286

closes odoo/odoo#30187
2019-01-17 13:00:59 +00:00
Haresh Shyara 826f927a1e [MOV] purchase_requisition: make requisition services friendly
The purpose of this commit is to make requisition usable with only services. Stock part is extracted in a new module `purchase_requisition_stock` which allows to create requisition based on product availbility or demand, also
we have moved all security access related stock in this bridge module.

Task ID : 1851286
2019-01-17 13:00:21 +00:00
Robot Odoo 22efdfbecc [IMP] web_editor,*: Refactoring the wysiwyg editor and 'html' field
_Task #1878502_

- The refactoring allows for the update of the _Summernote_ library.
- A new structure was created by transforming all the plugins in the library using the odoo inheritance system. Plugins are easier to implement with the `AbstractPlugin` to add Odoo behaviors.
- The cleanup allowed us to remove some of the code that was in `web_editor` but only used in `website` or in `mass_mailing`. Some parts are still in `web_editor` but will be moved at a later time.
- The refactoring also had to be done in order to create a set of unit tests. Each behavior can be tested, including the behaviors performed as a consequence of keyboard interactions (for instance: Enter, Tab...).
- From now on, the methods of the library (in this case _Summernote_) can no longer be called by other modules or files. Only the `wysiwyg` widgets can access it, to simplify the updating process. The `wysiwyg` object serves as an interface. A lot of tests are done, ensuring the consistency of outside behavior.
- Depending on the options the snippets will be loaded or not, the editor will be in an iframe or not... all of this is transparent from the outside.
- Regarding iframes, all controllers related to editing have been removed: the new API no longer needs them. This speeds up loading, eases testing and removes complexity for the same features.

**PUBLIC FEATURES**

There are several public methods on the `Wysiwyg` class:
- `Wysiwyg.prepare (WidgetParent)` which returns a deferred resolved when the library (xml, lazy, assets...) is loaded.
- `Wysiwyg.getRange (DOM)` returns the range (selection in the dom)
- `Wysiwyg.setRange (startNode, startOffset, endNode, endOffset)` which creates a range (selection in the dom)
- `Wysiwyg.setRangeFromNode (DOM, options)` that creates a range from an element (option available to select all, start or end)

A jQuery selector was added: `:o_editable`, which indicates whether the current element is editable. That is, if it is contained in a tag with the attribute `contentEditable = "true"` or in a tag with the class `o_editable`.
Several methods are also present:
- `focusIn`: makes a focus and places the cursor at the beginning of the element
- `focusInEnd`: makes a focus and places the cursor at the end of the element
- `selectContent`: makes a focus and selects the content

**HTML FIELD**

The HTML field can receive different options:
- `style-inline:` {boolean} transforms a class into an inline style when saving and vice versa when reading.
- `no-attachment`: {boolean} prevents the use of attachments (in media dialog)
- `cssEdit`: {xml_id} to use a template containing the css to loaded in an iframe when editing
- `cssReadonly`: {xml_id} to use a template containing the css to load into an iframe when viewing in readonly
- `snippets`: {xml_id} snippets template (can be used with or without `cssEdit`)
- `wrapper`: {template} qweb static template (containing a tag: `id = "wrapper"`) that will include the content during editing (removed on save)

**MASS MAILING**

A widget was created for `mass mailing`. There are now two fields: `body_html` and `body_arch`.
`body_arch` contains the code with the class without conversion into inline style, useful when editing and one with the inline style that is visible in readonly mode and sent by email.
Advantage: no spreading errors, able to update css/theme, able to do more changes when converting to inline style so that a maximum of mail clients have an impeccable rendering.

**REMAINING KNOW ISSUES**

These will be fixed in a subsequent commit.
- A few committed changes made during the development of this refactoring were lost in the process and should be reapplied.
- Some minor (mostly range) issues remain with Firefox.
--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

closes odoo/odoo#29775
2019-01-17 19:17:22 +01:00
Thibault Delavallée f50fbc6d16 [IMP] mass_mailing: differentiate mailing name from emails subject
Purpose of this task is to allow marketing people to differentiate the
mailing name (internal reference) from the subject used in the mailing
emails.

Mailing name is actually the UTM source name as mass mailing inherits
from it. Being able to edit it independently from the subject allows
to better categorize / filter mailings without sending technical terms
to customers. Marketing users could also change and tweak mailing subject
without disorganizing the pipe and changing the URM source name.

Demo data are updated accordingly to have both subject and mailing
names.

This commit is linked to task ID 1917602 and PR #29514.
2019-01-17 10:33:07 +00:00
Antoine GuenetandGorash eb0ea8efbe [ADD] web_editor,*: Tests for new structure of web editor
The refactoring also had to be done in order to create a set of unit
tests.
Each behavior can be tested, including the behaviors performed as a
consequence of keyboard interactions (for instance: Enter, Tab...).
This commit also contains some changes to test_utils that were
necessary given the new structure of the wysiwyg editor.

Co-authored-by: Gorash <chm@odoo.com>
2019-01-17 08:40:21 +00:00
Christophe MatthieuandAntoine Guenet f296992317 [IMP] web_editor,*: Refactoring the wysiwyg editor and 'html' field
* Creating a new structure by transforming all the plugins in the
  library using the odoo inheritance system. Plugins are easier to
  implement with the AbstractPlugin to add Odoo behaviors.

* From now on, the methods of the library (in this case Summernote) can
  no longer be called by other modules or files. Only the wysiwyg
  widgets can access it, to simplify the updating process. The wysiwyg
  object serves as an interface.

* Depending on the options the snippets will be loaded or not, the
  editor will be in an iframe or not... all of this is transparent from
  the outside.

* Regarding iframes, all controllers related to editing have been
  removed: the new API no longer needs them. This speeds up loading,
  eases testing and removes complexity for the same
  features.

PUBLIC FEATURES

There are several public methods on the Wysiwyg class:
* Wysiwyg.prepare (WidgetParent): returns a deferred resolved when the
  library (xml, lazy, assets...) is loaded.
* Wysiwyg.getRange (DOM): returns the range (selection in the dom)
* Wysiwyg.setRange (startNode, startOffset, endNode, endOffset): creates
  a range (selection in the dom)
* Wysiwyg.setRangeFromNode (DOM, options) that creates a range from an
  element (option available to select all, start or end)

A jQuery selector was added: :o_editable, which indicates whether the
current element is editable. That is, if it is contained in a tag with
the attribute 'contentEditable = "true"' or in a tag with the class
o_editable.
Several methods are also present:
* focusIn: makes a focus and places the cursor at the beginning of the
  element
* focusInEnd: makes a focus and places the cursor at the end of the
  element
* selectContent: makes a focus and selects the content

HTML FIELD

The HTML field can receive different options:
* style-inline: {boolean} transforms a class into an inline style when
  saving and vice versa when reading.
* no-attachment: {boolean} prevents the use of attachments (in media
  dialog)
* cssEdit: {xml_id} to use a template containing the css to loaded in
  an iframe when editing
* cssReadonly: {xml_id} to use a template containing the css to load
  into an iframe when viewing in readonly
* snippets: {xml_id} snippets template (can be used with or without
  cssEdit)
* wrapper: {template} qweb static template (containing a tag:
  id = "wrapper") that will include the content during editing (removed
  on save)

MASS MAILING

A widget was created for mass mailing. There are now two fields:
body_html and body_arch.
body_arch contains the code with the class without conversion into
inline style, useful when editing and one with the inline style that is
visible in readonly mode and sent by email.
Advantage: no spreading errors, able to update css/theme, able to do
more changes when converting to inline style so that a maximum of mail
clients have an impeccable rendering.

Co-authored-by: Antoine Guenet <age@odoo.com>
2019-01-17 08:40:21 +00:00
Christophe Matthieu de444335b7 [REF] web_editor,*: Move and rename files to prepare refactoring
The refactoring of the wysiwyg editor and 'html' field allows us to
move some of the code that was in web_editor but only used in website or
in mass_mailing. Some parts are still in web_editor but will be
moved at a later time.
2019-01-17 08:40:21 +00:00
Christophe Matthieu 17c6d00531 [IMP] web_editor,*: Update the Summernote library
The refactoring of the wysiwyg editor and 'html' field allow for the
update of the Summernote library.
2019-01-17 08:40:21 +00:00
Aurélien Warnon 2428ce871d [IMP] mass_mailing: improve mass mailing stat buttons (domain/visibility)
Task #1907952

Purpose
=======

The number of generated leads/opportunities from the mass mailing on the stat button should count
both active and archived leads/opportunities.

The stat buttons on mass mailing added by sales and crm apps should appear on every selected 'model'
for the recipients (a mass mailing sent to 'leads' can generate sales).

Specs
=======

Opportunity stat button:
- double check that the number is based on both leads or opportunities, active or archived

Stat buttons Leads #, Quotations #, Invoice Amount should appear on the form all the time for showcase purposes

closes odoo/odoo#29568
2019-01-15 15:05:20 +00:00
Robot Odoo 188ca66dbc [MERGE] project,hr_timesheet: simplify the user onboarding
This merge provides many little changes to improve the usability
and the onboarding of users in project and timesheet
applications.
This mostly contains labels renaming, restruration of views, ...
but some new mecanism appears like the "ghost kanban examples",
and improvements of the kanban examples modal.

Task-1893021

closes odoo/odoo#28461
2019-01-17 11:23:11 +01:00
Anshuman Sharma 1bb6d73949 [IMP] website: improve onboarding flow
- Improve the website tour (typo, tip positions, etc) and added new
  steps to publish a new page
- Make close button of 'Mobile Preview' more visible
- Fix the overflow for long menu names in menu editor dialog
- Change the menu string from 'Affix Top Menu' to 'Fixed Top Menu'
- Change theme customization dialog's title to 'Customize Theme'
  from 'Customize this theme'
- Improve strings for Google Analytics

task-1895287

closes odoo/odoo#28199
2019-01-16 10:50:31 +00:00
Raphael Collet 05861ffdf1 [IMP] fields: check for inconsistent many2many definitions
closes odoo/odoo#29323
2019-01-16 09:16:41 +00:00
Thibault Delavallée b7e13cf04b [FIX] survey: fix typo
closes odoo/odoo#30257
2019-01-16 09:24:10 +00:00
jem-odoo 958342bf16 [IMP] web: add example kanban background
The background example is a set of random fake column and card,
directly inspired from the kanban example modal.

We want to toggle this background depending on the kanban state;
the background will be displayed when there is no column yet,
and the quick create column is shown.

To do so, we need to update the state of the kanban when deleting
a column to (re)display the background in case of removal of the
last column. Now, on column deletion, the entire kanban is updated
and so entirely rerender (with aab's benediction).

Task-1893021
2019-01-16 08:28:09 +00:00
jem-odoo 92b6ea64ab [IMP] web: make kanban example support state bullets 2019-01-16 08:28:09 +00:00
jem-odoo 4b4e8508ef [IMP] project: improve kanban example sentences
This commit improves the sentences used in the kanban
example modal in order to be more concrete and precised
for the users

Task-1893021
2019-01-16 08:28:09 +00:00
jem-odoo 4669c524db [IMP] project: not create project from task
Prevent user to create project on the fly when
editing task. This will avoid user to create bad
project (typo, ...) and will force then to be more
organized: create a project first, then populate
it with tasks.

Task-1893021
2019-01-16 08:28:09 +00:00
jem-odoo eca54926dc [IMP] project: better labels
The privacy field labels are not clear for users: they
bring confusion and hesitation. Replacing them tries
to solve this problem.

Tasl-1893021
2019-01-16 08:28:09 +00:00
jem-odoo aa33c81535 [IMP] project: hide email field on task form view
Since this field is not very usefull, we prefer
hide it to avoid saturating the UI.

Task-1893021
2019-01-16 08:28:09 +00:00
jem-odoo e7268c201e [IMP] web: make kanban create button jump
This commit makes the create button of a kanban view
jumping when the user click on some zone on the kanban
background.
The purpose here is to educate the user, so he can learn
how to create its first kanban card.

Task-1893021
2019-01-16 08:28:09 +00:00
Lucas Lefèvre 75ef4686ff [IMP] hr_payroll: Add notion of full time/part time on resource calendar
Purpose
=======

In order to be able to manage payroll, we need to know if a resource calendar
is a full time or a part time. For instance, in belgium, 23h a week is a full
time for a teacher but in cp 200 it is 38h. In belgium every employee can take a
parental leave in part time but he cannot take it in part time if they are not full time.
Having a field indicating if the contract is full time or not is useful for computing
salary rules.

Specification
=============

On the calendar model
- Display a computed field with the number of hours in the calendar
- Display a field with the required number of hours to be full time
- Display a computed checkbox, ticked if full time or not

On the contract model
- Add a related on these fields, to ease the access on the salary rules computation.

closes odoo/odoo#30034
2019-01-15 16:04:21 +00:00
Thibault Delavallée e6c0a326d6 [IMP] survey: do not count test user entries as real inputs
Purpose of this commit is to remove test entries from statistics and reports
in survey. Indeed they are not real results and should not be taken into
account. We also display a warning on portal page of surveys when user is
in test mode.

This commit is linked to task ID 1865453 and PR #29316.
2019-01-15 15:54:54 +00:00
Robot Odoo 9771fdfe8f [MERGE][REF] survey: update ACLs and refactor invite wizard
Purpose of this merge is to refactor, clarify and fix surveys access rights
and rules. Indeed currently surveys access rights and rules are not very
clear. This application is currently used mainly for external and public
surveys.

In this merge we clean access on survey models. Basically only surveys officers
and managers have access to the models. Other people including employees,
portal users and anonymous people users have to use the portal view and
dedicated routes instead of accessing data through the backend.

In this merge we also expand the access options of surveys. Surveys can be
public, limited to authenticated people, limited to employees or on invitation
only. Invite wizard has been redone to simplify it and better support those
options.

For more details about the content please have a look at each subcommits.

This merge is linked to task ID 1911586 and PR #28986.
2019-01-15 13:23:56 +01:00
Thibault Delavallée 812d1ec0ee [FIX] hr_recruitment_survey: set related survey readonly on applicant
Otherwise you might change the survey used on the job without knowing it.
Survey on applicant is just there for information / action purpose, not
configure the job itself.

This commit is linked to task ID 1911586 and PR #28986.
2019-01-14 15:22:18 +00:00
Thibault Delavallée a8a6729eed [IMP] hr_recruitment_survey: add recruitment survey category
Purpose of this commit is to add a new survey category for applicants. That
way surveys created and/or used through recruitment process are correctly
set in their own category allowing to filter them. When creating a new
recruitment only surveys linked to recruitment process are shown. Moreover
default values are propagated when creating new surveys so that they are
correctly configured by default as recruitment and invite-only surveys.

This commit is linked to task ID 1911586 and PR #28986.
2019-01-14 15:22:18 +00:00
Thibault Delavallée f15861c36d [IMP] survey: add a category on surveys to allow filtering them
Purpose of this commit is to add a category selection field on surveys. It
will allow to filter / select surveys according to their category and their
main use.

This commit is linked to task ID 1911586 and PR #28986.
2019-01-14 15:22:18 +00:00
Thibault Delavallée 27328ca33c [REF] hr_recruitment_survey: adapt application to survey ACLs update
Recent community commit updated survey ACLs. Notably survey access groups
officer and manager have been updated to really give access to survey models
management. Other people cannot access survey models as they are considered
technical. Controllers give a way to take and complete surveys.

In this commit we update recruitment bridge module with survey to remove
custom rights and rules definition for survey models. As recruitment groups
already imply survey groups access defined in base survey should be sufficient.
Being a recruitment officer or manager automatically makes the user a survey
officer.

This commit is linked to task ID 1911586 and PR #28986.
2019-01-14 15:22:18 +00:00
Thibault Delavallée 7d110c20c5 [REF] survey: refactor template use on invite wizard
Purpose of this merge is to remove the ugly __URL__ hack of survey templates.
It is solved by making template rendered on user_input model. This means each
invitation recipient will received its own rendered mail. Small jinja code
allows therefore to include the url in a clean odoo-style way.

Subject and body in survey invite wizard are not rendered anymore. It means
jinja could be displayed. This is necessary as this wizard will work in batch
mode, rendering the body on each recipient.

This commit is linked to task ID 1911586 and PR #28986.
2019-01-14 15:22:18 +00:00
Thibault Delavallée 6fa4688693 [REF] survey: refactor invitation wizard
Purpose is to clean and simplify invite wizard on surveys. Main purpose is
to simplify options.

Public link is displayed for public surveys, allowing to quickly share
it. When sending emails a token is now generated for each recipient. There is
no "batch public link" sending option anymore as it is not really necessary.

Check is done on recipients and emails to match the access mode option. Having
a restricted survey gives the same limitations on people to invite (users,
employees, ...).

Code is cleaned to ease its understanding and prepare future evolution notably
with appraisals.

An existing mode field is added on invite model. All options are currently
not used but it prepares future addition to survey, notably for certifications.
Its purpose is to know what to do with existing tokens when inviting new
recipients. It is used notably to resend tokens through the user_input form
view instead of relying on a custom context key.

This commit is linked to task ID 1911586 and PR #28986.
2019-01-14 15:22:18 +00:00
Thibault Delavallée 1c5371a966 [IMP] survey: improve some survey pages
Survey has several side pages related to corner cases: closed surveys, void
surveys, ... those templates need a bit of polishing. Other main templates
are left untouched and will probably be improved in other tasks.

This commit is linked to task ID 1911586 and PR #28986.
2019-01-14 15:22:18 +00:00
Thibault Delavallée 7c50807bec [REF] survey: improve access mode options and survey form view
In this commit we extend access option on survey model. Access mode is now
defined as

 * public: everyone can access this survey. People having a link to the survey
   can create answers and fill survey. Those are used for example as
   satisfaction surveys;
 * login required: only users can access this survey. Depending on auth
   signup configuration this either limits survey access or forces people
   to create an account;
 * employees only: only users belonging to base.group_user can access this
   survey. Those are used for example for internal polls;
 * on invitation only: only people receiving a token can access this survey.
   They do not need to be an user, having a token is sufficient. Those are
   used for example for appraisals;

Note that survey officers and managers can always create and update answers
according to their ACLs.

In this commit we also improve a bit survey form view while changing the
access field. Surveys users now have access to all buttons and some labels
have been updated to better fit current Odoo style. Archive button is now
always displayed as it is considered as a standard way of managing surveys.

This commit is linked to task ID 1911586 and PR #28986.
2019-01-14 15:22:18 +00:00
Thibault Delavallée 66e00f642a [IMP] survey: add access rights tests
Purpose of this commit is to improve test coverage of survey module. This
commit adds tests related to current access and serve as a base for future
modification. Some tests are commented as access will evolve for this
application.

This commit is linked to task ID 1911586 and PR #28986.
2019-01-14 15:22:18 +00:00
Thibault Delavallée dfc37ecede [REF] survey: adapt controllers and portal flow to new ACLs
Purpose of this commit is to adapt controllers and routes to new ACLs. As
survey access is now controlled routes have to use survey ID and browse
records as sudo when access is granted.

This commit is linked to task ID 1911586 and PR #28986.
2019-01-14 15:22:18 +00:00
Thibault Delavallée 5878579b10 [FIX] survey: is_closed field on survey should be readonly
Otherwise having this value coming from a view triggers a write on the
survey stage model. This write is unnecessary ad is_closed should really
be readonly. It may also causes access rights issues notably for survey
users that cannot update stages.

This commit is linked to task ID 1911586 and PR #28986.
2019-01-14 15:22:18 +00:00
Thibault Delavallée 598d84783e [FIX] survey: allow to delete surveys with questions and answers
Purpose of this commit is to allow to unlink surveys even if answers have
been given. Currently an ondelete restrict on answers exists that prevent
from unlinking surveys. As unlink rights are now given to survey users
only they should be able to completely remove surveys if necessary.

This commit is linked to task ID 1911586 and PR #28986.
2019-01-14 15:22:18 +00:00
Thibault Delavallée e3d2957f98 [REF] survey: update ACLs and limit access to survey models
Purpose of this commit is to rewrite all access rights and rules of survey
models. Indeed this module is quite old and rules may give some strange
permissions to some people and does not enforce the use of real survey
user groups.

Specifications
 * survey manager: can CRUD everything;
 * survey users: can CRUD their own surveys, read all;
 * regular users: cannot access anything and will use dedicated controllers
   and routes;
 * portal, public: cannot access anything and will use dedicated controllers
   and routes;

This commit alone breaks some use of survey, notably its embedded portal.
Future commit will update code to use those new ACLs. It is done in several
commits in order to have smaller diff and avoid having too large diff in a
single commit.

This commit is linked to task ID 1911586 and PR #28986.
2019-01-14 15:22:18 +00:00
Thibault Delavallée b74252dd1d [REF] survey: clean models by removing unnecessary fields
This commit holds several improvements on survey models.

[IMP] re-order fields in survey models and update strings / helps

Purpose is to ease understanding and future modifications of survey models
by reordering fields in survey, question and user input models. Those are the
main models we want to clean in future updates.

Some comments have been moved into help and some labels and helps have been
updated to clarify a bit the use of various fields, notably in question model.

No functional or technical change occur with this commit. It is just pure
code move. Reordering them allow to already understand a bit more the logic
of this module.

[REF] survey: remove unnecessary/unused fields on answer models

Purpose of this commit is to remove unnecessary and/or unused fields on survey
answer line model. In this commit we

 * remove useless date_create field on answer and answer lines models. This
   field is basically a renamed create_date. Let us remove this dummy field
   as it adds nothing to the answer and answer lines models;
 * remove useless URL-related fields and actions on answer and answer lines
   models. Having those fields actually bloats the model without really helping
   understanding survey models. As changing routes should not occur frequently
   hiding routes in fields does not really help. Templates are update to
   directly include links instead of fields;

We also remove a button on user input that redirects to the survey global
results. Surveys results are available on survey kanban and form views. It
makes no sense to have that kind of button on a specific answer.

[REF] survey: remove unnecessary/unused fields on survey models

Purpose of this commit is to remove unnecessary and/or unused fields on survey
model. In this commit we

 * remove useless is_designed field on survey model. We remove is_designed
   field that is based on having page and/or questions. It is just used to
   make some links inactive in kanban view. Having fields just for that
   purpose bloats the model and is not necessary. Testing void surveys will
   just lead to a void page;
 * remove useless email_template_id field on survey model. This field is
   completely not used anywhere in survey codebase;
 * remove useless urls field in survey model. In this commit we remove support
   of both relative and global urls computation. It was used only in invite
   wizard but was actually not really necessary as knowing the survey access
   url is the only really necessary thing to display;
 * Print and results URLs are removed from survey model. Having them inlined
   directly in code is simpler that actually hiding them behind field. As
   changing routes should not occur often it is not a big deal to write them
   when necessary. We therefore remove public_url_html, print_url and
   result_url fields;

This commit is linked to task ID 1911586 and PR #28986.
2019-01-14 15:22:18 +00:00
Thibault Delavallée ee2631cd51 [REF] survey: clean survey routes definitions
Purpose of this commit is to ease understanding or routes. In this commit
we make token a parameter where it is optional and force is where it is
not; we remove unnecessary list on routes; we rename some controller methods
to ease understanding;

Code calling those URLs is adapted accordingly. No functional change should
occur with this commit.

Some routes are json-http-mixed as a result of old implementation. Those
will be updated in future tasks when cleaning the templates and routes.

This commit is linked to task ID 1911586 and PR #28986.
2019-01-14 15:22:18 +00:00
jem-odoo 08a9391a84 [IMP] project: always display working calendar
Setting the working calendar on a project should
be done in debug mode for now. This is annoying as
it is not a "so delicate" feature and project
manager should be able to do it.
This commit makes the field always visible to ease
project configuration.

Task-1827986

closes odoo/odoo#30193
2019-01-14 14:35:01 +00:00
jem-odoo 44b9f1efbe [IMP] hr: make default calendar required
Through the HR setting, you can set the default
calendar for employee in the company. This field
is not required, and not setting it can be annoying
on employee creation.
This commit makes the field required only on the UI,
as default calendar is generated on company creation,
we can not set the required flag on the model.

Task-1827986
2019-01-14 14:33:04 +00:00
Pratima Gupta 2f4ec15a37 [IMP]base: Unique barcode for customers.
If two customers have same barcode -
Current functionality : To select customer in POS, if we scan barcode, only the newly created customer will be selected.

To resolve this: Created the unique sql constraint for customer per company.
This commit is related to task# 1877329.

closes odoo/odoo#28316
2019-01-15 04:45:36 +00:00
Robot Odoo 4155bc5614 [MERGE][REF] link_tracker: strengthen ACLs and add tests
[REF] link_tracker: strengthen ACLs and add tests

Purpose of this merge is to clean ACLs of link tracker models. Those are rather
technical and should not be accessed as it is by external people. Let us
delegate control to controllers and lessen a bit model accessibility.

Some code is cleaned and code field is made required on link.tracker.code
model to ensure database integritry.

See commits for more details.

This merge is linked to task ID 1904277 and closes PR #28242.
2019-01-14 15:00:23 +01:00
Thibault Delavallée 6842d5cbd8 [IMP] link_tracker: make code field required on link.tracker.code model
Indeed it makes no sense to have void codes.

This commit is linked to task ID 1904277 and PR #28242.
2019-01-14 10:34:47 +00:00
Thibault Delavallée 7222f0ab53 [CLN] link_tracker: clean some code
Purpose of this commit is to remove some unnecessary code in link tracker.

 * remove unnecessary code / parameters:
 * remove unused field click_date on click as create_date is already used for
   that purpose;

This commit is linked to task ID 1904277 and PR #28242.
2019-01-14 10:34:27 +00:00
Thibault Delavallée b670911a92 [REF] link_tracker, mass_mailing: simplify add_click method and add tests
In this commit we rewrite a bit add_click in order to remove the inlined sudo
and ease inheritance and parameter management inside the method.

Access through controllers is sudo-ed as the main API method is now done
with current user access rights.

This commit is linked to task ID 1904277 and PR #28242.
2019-01-14 10:34:26 +00:00
Thibault Delavallée 75638ffb94 [REF] link_tracker: do not let public read technical / private link data
Link tracker models are rather technical and should not be accessed as it is
by external people. Let us delegate control to controllers and lessen a bit
model accessibility.

Currently everyone can use add_click method and generate statistics. Now
statistics will be generated only through dedicated routes. It will make
statistics more reliable and ensure technical data remain private.

Next commit will update code from controllers and main methods in order to be
have a more readable click API and avoid link between non dependent modules.

This commit is linked to task ID 1904277 and PR #28242.
2019-01-14 10:34:21 +00:00
mgh-odoo 9ee9724a10 [Generic] unaccent search
- added unaccent search on POS customer/partner and product
- moved unaccent from "mail.utils" to "web.utils"
- added more character to make function accurate

We might use str.normalize(from ES6) but the problem is str.normalize method can not consider some double characters i.e. accented character when normalized it returns 2 normal characters and normalize method returns single character, so here custom unaccent method is used to normalize the string

What we can improve here: We can use str.normalize method and check if string is still have unaccented charaters that we can call our unaccent method but this unaccent method is also working and performing well

closes odoo/odoo#27671
2019-01-10 12:31:53 +00:00
XavierDo 80f3eb27f7 [FIX] mail: add index on mail.activity create_uid
The activity create_user_id field is now replaced by magic create_uid field.
Since most of the search are done on this field, create_uid should be indexed as
create_user_id was.

closes odoo/odoo#30061
2019-01-09 09:30:05 +00:00
Robot Odoo a57503bfd0 [MERGE] web: update bootstrap from 4.1.3 to 4.2.1
Bootstrap just released a brand new version with new components and new possibilities, which are great to integrate in master.

Note: Unfortunately, this also comes with some bug fixes they did not add in a 4.1.4 version, so there is no clean way to backport them in Odoo 12.0 (so if any is required at some point, we will have to use bootstrap_review.scss or anything else to bug fix).

closes odoo/odoo#29949
2019-01-10 13:58:21 +01:00