Due to some rounding error, we arbitrarily decide to don't show a discount of 1 cent.
Before this commit, the limit was 10 cents in some case, 20 cents in others cases, ...
In the case of a guy who sell nails, these 2 cents may be important :)
That seems to have no impact negative to remove it.
That fixes the case when you have a main product with a discount, and a optionnal
product without the discount; before this commit, discount class was removed and
so the striked price for the main product disappeared.
Explicitly remove the cursor of the request. Dropping a database
is not transactional and if overrides of ir_http's dispatch worked
with the database (for example, utm), we are not able to commit
the changes at the end of the request.
It worked nice before rev 40561b0fb6 that changed the use of self.pool
by request.env. Note: a cursor is always attached to an environment. Since
the call to super possibly broke the cursor (for example by dropping the
database), the end of the dispatch operation that try to commit and/or close
the cursor could possibly result in the traceback 'unable to close a closed
cursor' with request.env. With self.pool, it didn't happen because the
code actually called in the utm's dispatch override doesn't use a cr
and so there's nothing to close.
When overriding dispatch, we have to make sure that we do the
database operations before calling super, because we are not sure
to have a valid database/env after (for example, in the case of a
drop of a database).
* + web_editor
The feature was only activated in the web_editor in snippet contents
(before they are dropped in the page). Now, on first theme selection,
the feature is activated in the template content.
If the method "_get_display_time" is called on an event and if the
user or partner has no timezone set. The string returned by the function
contains the value 'False' instead of a timezone.
To fix this, we replaced the "False" value by "UTC", because UTC is the
default timezone in Odoo.
It will be used in various email templates to avoid having either badly
formatted emails either not formatted emails. As this is a not stored
function field it does not impact model.
In saas-12, a stupid record rule authorizes an employee to create a payslip only for him (dafuq)
In saas-13, sine the HR access right splitting, this record rule authorizes an payroll user ti create a payslip only for him (bug). A consequence of this is that the rule is also applied to the payroll manager (bugx2)
* web_editor, website
-> Move some website options to web_editor to use them in mass_mailing
(margin and resize)
-> Rework on themes design and declaration conventions
-> Review theme switching to bring default layout on first edition and
to be able to define theme images
-> Move theme design in their own asset
-> Edition and saves fixes
The web_editor transcoder, who is in charge to change mail css style
into inline style and vice versa, has a cache to improve its
efficiency. The problem is that it was designed to work only if a
particular "<tag>.className" has always the same css style no matter
what its parent or neighbors are. This is obviously not compatible
with theme switching. Indeed, only by switching from one theme to
another, the parent of every snippet have a different className which
is used in css to design differently every snippet. Also inside a same
theme, we obviously want to be able to style a particuler .myClass
element differently from one snippet to another without having to
multiple css classes.
This commit removes the cache system to allow theme switching and
liberty in theme designing. This however make the edition start and
the saving really slower...
* Use the theme class selector as root for the less file
-> Allow to style the editor as applied to the body
-> Split in editor/color/layout/snippets
* Create an assets to contain all mm themes so that the compilation is
made by the odoo system, and allow minification and variable sharing
between themes
-> Remove css files
* Reformat the LESS files content
website -> web_editor so that they are available for mass_mailing.
To allow setting margins on td elements:
As the above mentionned option allows to control the mt and mb classes
on the mass mailing items, the problem is that we would ideally want it
to be functionnal on td element as they are the main part of a mail.
As they don't support margins, there were many options to fix the
problem:
- Add more JS to place the mt and mb classes on children of td element
- Place the option on children of td element and not td element itself
but in that case, the width control of td would imply a lot of parent
option hierarchy, or the width control had also to be adapted to control
children
- Control padding instead of margin. This forces to add lots of
css rules like pt4 pt8, ... (or td.mt4, td.mt8, ...).
The last solution has been chosen. Padding is more supported than
margins in mail client anyway and the css rules will be isolated in
the mail editor anyway. Using td.mt4 instead of pt4 had the advantage
to not require any JS modification.
When there is no content in the mail, the user is now forced to choose
a theme. Once the choice is made, the theme introduces default content
(series of snippet to simplify user edition).
The default images are also changed when the theme is switched. To do
that, JS code was implemented so that on theme switch, all the images
are changed to check for images in the static theme folder or use a
theme related xml_id.
+ Refactore theme data management.
If a leave request is refused by the manager, the button reset to draft is displayed, but the employee cannot use it because he doesn't have the write access rights on his own leave requests
In 'refuse' state, all the form is readonly, but the employee should be have to reset his own leave to draft to modify it and re-submit it.
Some view extension (in this case mainly counters on partners, like
small Sales Orders counter badges etc.) should not be visible if you
don't have the relevant rights.
If an analytic account is not linked to sale order, do nothing (and do not return False which is not a valid value for a write ({} would have been valid)). We should allow the simple analytic accounting without sales order.
It often occurs that users get nasty error messages like "missing value
for column xxx" when trying to create objects. It can happen if the
objects uses a sequence as default value that is not defined in an
available company.
We try to give a hint to the glory support person who could be confused
by that.
The dictionary `_group_by_full` is replaced by a field parameter `group_expand`
that is assigned to the method name. The API of the method has been simplified
as well:
@api.multi
def _read_group_stage_ids(self, domain, read_group_order=None, access_rights_uid=None):
# the stages are given by self.ids (wrong model);
# read_group_order is the order given to read_group() on self;
# return stages.name_get(), {stage.id: stage.fold)
_group_by_full = {'stage_id': _read_group_stage_ids}
is now written:
stage_id = fields.Many2one(..., group_expand='_read_group_stage_ids')
@api.model
def _read_group_stage_ids(self, stages, domain, order):
# stages is a recordset;
# order is the order to use on stages' model;
# return a recordset which is a superset of stages
When increasing the amount on a confirmed purchase order line,
an extra move is created in the incoming picking.
When the purchase creates the moves in the picking on confirmation, it takes into account
the procurements that triggered the purchase order and creates a move for every procurement.
This is necessary in order to make the next steps ready.
With this commit, when you increase the quantity, it will take into account the amounts of moves
already created for a procurement and not link the new move with a procurement if not necessary.
This case can be tested by confirming the PO with less than foreseen by the procurements and increasing
the amount afterwards. (which is more of a corner case, but it is good to do things right)
The dashboard must be visible for non-'group system' users, hence
the sudo call + only display the link to modify the client id
if the user has sufficient access rights.
Small visual correction for live users counter in the dashboard.
This is linked to the previous commit.
This commit adapts the widget extension and backend controller of
the website admin dashboard to prevent a crash if the user does not
have sales rights.
This is linked to the previous commit.
This commit adapts the widget extension and backend controller of
the website admin dashboard to prevent a crash if the user does not
have sales rights.
The Website Admin dashboard displays graphs for sales, analytics,etc.
using a (somewhat easily) extensible js framework.
Unfortunately, this framework is ACL unaware, meaning that it will
completely and silently crash if you are missing any of the required
access rights.
To solve this, extensions must now specify not just a graph name
but a necessary group for it and set the value for this group in
the extension of the backend controller.
This commit also
- make the icon visible for the group 'Website Designer and Editor'
(not juste the Settings group, which is extremely restrictive)
- make the button to set the Google API key only visible to people
with sufficient access rights
This will improve the onbarding of project and the usability in general.
Project: When creating a project a small modal opens with one or more fields, and you have to click on it just to type the project name.
Usability: one many2one (and others), when clicking on "Create and Edit", the focus is set on the first field.