Future runbot improvement may share sources between build,
meaning that sources will be readonly to avoid any interaction.
_touch() was supposed to handle ro filesystem but
f7130556 introduced a new test that was not working
in this case.
Instead of trying to touch file and pseudomocking the result
if the filesystem is readonly, this commit add a real patch
on getmtime.
cherry-pick of b295723c99closesodoo/odoo#34823
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
Let's assume a one2many field (editable list) in a form view with
a many2many (e.g. many2many_tags), and an onchange on the one2many
such that, when a row is added to the relation, the server returns
update commands for (a subset of) the records being already in the
relation. For thoses updated records, the many2many field needs to
be read (the onchange only returns the ids in the relation).
Before this rev., the many2many field was read independently for
each record in the one2many. This could cause a performance issue
on large relations. For instance, this was the case on
account.invoice records with a lot of lines.
Issue 2027356
closesodoo/odoo#34785
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Since commit 9fbb4fb, the `title` attribute is added
to list views `<td>`. The title value is given
by field utils formatting methods, according to the
field type. However, for boolean fields, the formatting
method does not return a string but a jquery element
(unless `forceString: true` is given as an option).
Hence, the displayed title is `[Object object]`.
After this commit, boolean fields do not have any title.
closesodoo/odoo#34657
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This commit replaces the usage of `formData.delete()` as it is not supported
by Internet Explorer and Safari Mobile.
closesodoo/odoo#34787
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
When answering a quiz, the button "Check your answers"
is not displayed when not in fullscreen.
JS error: `def.resolve is not a function`
because an already instantiated Promise does not have a
resolve function.
A promise cannot be resolved from outside its callback scope.
closesodoo/odoo#34762
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Before this commit, if we had a livechat channel with a user and:
- in backend use command "/leave" to leave and unpin conversation
- [do not reload the page (or there is no issue)]
- then the user sends a new message
The chat window opens just with the new message. Fetched previous
messages are ignored due to being already in the mail manager, and
links between these messages and the threads were never updated.
With this commit, when fetching messages that are already in the mail
manager, these messages are linked again to threads.
This commit also fixes an issue in which messages moderated with
status "accepted" were not correctly removed from the moderation
mailbox. This problem occurred after the fix on re-linking messages
to threads.
opw-2031270
closes#34761
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
- When creating a vendor on lunch without setting explicitly the
`responsible_id`, `default_get` should return the current user id.
Instead it returns the current user's partner id.
closesodoo/odoo#34759
Signed-off-by: Nicolas Seinlet (nse) <nse@odoo.com>
Before this commit, when a direct message chat was renamed, it
crashed with the following error:
`TypeError: Cannot read property 'toLowerCase' of undefined`
This occurs because the name of the dm chat changed from the RPC
response. However, no new name was provided, thus it sets its
name to `undefined`.
Test has been adapted in order to reflect that the server does not
response with new name after RPC `channel_set_custom_name`.
closesodoo/odoo#34641
Signed-off-by: Martin Geubelle (mge) <mge@openerp.com>
Since https://github.com/odoo/odoo/pull/29442, "Animations" became
"Public Widgets" (even though the Animation class still exists as an
extension of standard PublicWidget).
Since that refactoring an error was introduced which made the code
modify the prototype of the 'events' key each time a public widget with
a 'read_events' or 'edit_events' was instantiated (while the goal was
to modify the widget's own 'events' key, not from the prototype). This
was the cause of very ununderstandable errors...
closesodoo/odoo#34600
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Steps to reproduce the bug:
- Log as admin user in company C
- Go to Leaves module and click on Managers > Allocations
- Create a leave.allocation with type = Compensatory Days, duration = 7 days
mode = By Company and Company = C
- Approve the allocation
- Create a leave request LR for all the company C and approve it
- Log as demo user (only user access right for Leaves)
- Go to Leaves > My Leaves and click on "Leaves requests"
Bug:
A traceback was raised
opw:2005813
closesodoo/odoo#33899
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Have a product with a fixed amount tax.
Make a "return" of that product in the pos (i.e. negative quantity)
Before this commit:
- The amount of the return was `tax_amount + product_amount` instead of `-1 * positive_total_amount`
- The amount differed from what can be observed in sales
This was because the sign of the quantity was applied twice
After this commit,:
- the amounts of positive and negative amounts are symmetrical
- they match the behavior in sale
The logic is very similar to bb72dea98d
OPW 2026278
closesodoo/odoo#34548
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Incorporate Deivis Laya (deivislaya) as Vauxoo's contributor
I confirm I have signed the CLA and read the PR guidelines at
www.odoo.com/submit-pr
closesodoo/odoo#34569
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Before that, groups of taxes defined in l10n_es only defined tags on child taxes. This is wrong: base tags of a group of taxes should always be set on the group itself; children should only contain tax tags (at least, if their type_tax_use is 'none'). Indeed, the tax_ids field of aml generated for these taxes will point to the group, while tax_line_id points to its children.
closesodoo/odoo#34557
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
concat_xml was apparently missed during the Python 3 text model fixes,
resuling in a function which usually returns ``(bytes, str)`` but in
the case of an empty or missing ``file_list`` would return ``(str,
str))` instead, leading to type errors in Python 3.
Fix the particular case so it properly returns bytes as the
"concatenation result" even when it did nothing. Fix the docstring so
it properly reflects expectations as well.
closesodoo/odoo#34751
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Usecase to reproduce
- Create company A and company B with one warehouse each
- Warehouse from A resupply warehouse in company B
- Create a product and check the route MTO and resupply from warehouse A
- Connect as Demo User that only have access to company B
- Do a delivery order in company B for this product -> it creates a
receipt from warehouse A
- Deliver in warehouse A to company transit
- Try to reserve the receipt in company B
-> It does nothing.
It happens because the receipt move is in company A and the delivery
order is in company B. The move is tagged as make_to_order so the
reservation is based on move_orig_ids. However the move_orig_ids is
empty due to record rule that hide since it's in the other company.
In order to fix it, allow to see move from other companies that goes
to transit location.
opw-2033066
closesodoo/odoo#35223
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
Add the missing drop_view_if_exists that allows the recreation of the template
when updating the module
closesodoo/odoo#32380
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Do not use model._description as this is a static string that is untransalted
Retrieve the value on the ir.model record which has a translated field
Fixesodoo/odoo#28481closesodoo/odoo#33957
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
smtplib.SMTP API calls such as .sendmail() or .login() make sure on
their first line that this command is sent, by calling
.ehlo_or_helo_if_needed().
However, test_smtp_connection() does not use SMTP.sendmail() to simulate
sending email, or the email would really be sent.
Instead it uses the low-level API SMTP.mail() which does not make sure
that HELO was sent.
The connection test could be fixed by ensuring that this command was
sent to the server in the test method. However, this could lead to
inconsistent cases where the connection test passes whereas another
usage in the code fails because the command was not sent.
For example, someone could use the low-level API for some reason.
EHLO could have already been sent because if authentication is enabled
smtplib.SMTP.login() calls ehlo_or_helo_if_needed(). Therefore it is
correct to call it ourselves at the end of our connect() method.
STARTTLS sends a first EHLO, negociates the encryption, and leaves the
state without the second EHLO, which should still be sent to the server,
as stated by RFC 3207, in section "4.2 Result of the STARTTLS Command".
https://www.ietf.org/rfc/rfc3207.txtclosesodoo/odoo#34550
Signed-off-by: Julien Legros (jle) <jle@odoo.com>
Fix/improve commit d870749d79
that was removing line feed (\n).
In this one, we also remove carriage return (\r)
to address all cases.
closesodoo/odoo#34536
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
The rendering of field widgets is asynchronous (as it returns a
native Promise). However, the '_renderFieldWidget' method of basic
renderers is sync, and returns a fake div that will be replaced by
the widget'$el afterwards.
The form renderer sometimes needs to add classNames on the rendered
nodes (e.g. each child of an outer group as class 'o_group_col_x').
To handle this, once the field widget is ready, we copied all
attributes of the fake node to the widget's node. Unfortunately, we
were erasing the attr value (e.g. className) by the new one. As a
consequence, the className defined in the widget were lost. This
could be observed for the 'note' field in 'sale.order'.
As this was only necessary for classNames, this rev. only retrieves
the class attribute of the fake node, and adds it to the classNames
of the widget's $el.
closesodoo/odoo#34528
Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
In sale_expense, there is a rules allowing employee to see all confirmed sales
order. This rule breaks the one from sale "see own document" for salesman user.
The initial goal of this rule is explained in Task-29303: we wanted to ease the
reinvocie flow. For an employee, is it diffuclt to know on which analytic account
the expense should be reinvoice (no knowledge of that, no "analytic rights", ...).
Anyway, this rule brings more problem than expected and prevent people to work.
So, we decided to functionnaly revert the feature by desactivate the rule and hide
the sales order field on expense for user that are not salesperson. Salesperson can
set the SO, and the onchange will set the analytic account. Futher work will be
done in master (for 13.0) in order to solve that matter.
To apply the fix, the rule should be desactivated, and the module sale_expense can
be updated.
opw-2027005
Coming from Task-29303
closesodoo/odoo#34514
Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
During checkout, the user can create a new billing (only for public user as it
will create a 'normal' `res.partner`), a new shipping, edit its billing (that
will edit himself) or edit its shipping address.
All those cases will go through the exact same methods, public user and logged
in user included.
This previously led to multiple issues and multiple fixes to correctly set
`company_id` and `website_id` on the address (res.partner).
See 44372471ef that fixed the `website_id` part.
See 3a0f05f33 that fixed the multi-company behavior, but needed 2ba71140 to not
modify the company of an already created partner, but was still incomplete as
after that fix a logged in user would still have the admin (sudo) company
instead of the website one as supposed.
This commit will fix that bug and add some tests for all mentionned issues.
Related to #28853 as we want to backport the mentionned commit but needed to be
fix first.
closesodoo/odoo#34596
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Sending an email wasn't taking the outgoing mail server into account.
Adding it in the 'account_invoice_send_views' to use it in the wizard.
opw-2030717
closesodoo/odoo#34593
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
When hr is installed, with 'private' type, you should be member of
hr/officer group to read them, or you'll face an access right error.
closesodoo/odoo#34587
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
Before this commit, the report Leave Summary had hr.leave as its model
implicitly meaning that a report could be printed from an hr leave.
Since the report actually is a view which aggregates data, and not a document
representing a leave, it should have its wizard (the only entry point for that report)
as its model
OPW 2029699closesodoo/odoo#34507
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Before this commit, action report had their model referenced only with a char field
which made impossible to elaborate domain based on the model
After this commit, a new computed field, depending on that char field allows to do that
OPW 2029699
The aforementioned commit prevented the creation of automatic xmlids for
custom fields, however this change is not exactly stable; if a database
already contains automatic xmlids for custom fields and the module to
which these xmlids belong to is upgraded, the xmlids would get deleted,
along with any records related to it because of the way that
`_update_xmlids` works.
This commit leaves existing automatic xmlids of custom fields while
preventing the creation of *new* ones.
closesodoo/odoo#34563
Signed-off-by: Christophe Simonis <chs@odoo.com>