Enable the rtlcss library, translate the website into arabic, add a
carousel. The previous left appears right on the screen and the next
right arrow on the left.
This fix is to invert the two value (left arrow/right arrow) when the
screen in RTL-ed.
rtlcss documentation is available at:
https://rtlcss.com/learn/usage-guide/value-directives/#tip
opw-2041898
closesodoo/odoo#35220
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Before this commit, the placeholder for the website was incorrect, it
missed the protocol. This could lead to a confusion to the user who
could add a website without protocol. A website without protocol will be
open in the browser as a page of the same website and not as an
independent website.
Now, the placeholders have the correct protocol.
opw-2042816
closesodoo/odoo#35217
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
In particular, the problem forbids a user to lower quantities on a SO
if the responsible is currently in another company.
- Install sale_stock and sale
- Activate Multi-companies
- Create Company A and Company B
- Admin in A and B
- Other user U (e.g. duplicate of Admin) in B only
- U creates a SO with a product, confirms it
- Admin connects to Company A
- U decreases product_uom_qty in a line
- U gets an AccessError
When decreasing the quantity, in sale_stock,
_log_decrease_ordered_quantity is called and calls stock's _log_activity,
that needs access to the responsible or the superuser's partner.
If that user is in another company, this raises an AccessError.
Because it is when accessing the partner that the AccessError is raised,
we cannot cleanly use a check_access_rule to determine when to use sudo.
OPW 2036879
closesodoo/odoo#35132
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
Spec
====
Before this commit if a user has access to a document thanks to an access_token,
he would already be able to see the chatter for the document, but he would not
be able to download the attachments that are shown to him on that same chatter.
The goal of this commit it to let the user download those attachments. This
makes sense especially since messages publicly posted in the chatter might
generate emails to the user, and the attachments will already be attached to
those emails, so this PR is not actually granting access to more information to
the user in a typical flow.
The only difference is when said user was added as a follower after the
attachments have been posted in which case he will be able to read them even
though he didn't get the original emails, but this is consistent with how he
will also be able to read the existing messages even though he didn't get them
by email.
Technical
=========
To solve this issue we could have used the access_token of the main document,
but this would allow any user with the token to access all attachments of the
document, including those he should potentially not be able to see such as those
from internal notes.
Instead we ensure a different access_token is properly set on each of the
attachments that are going to be shown and we update their links accordingly.
This allows for a more granular access control, and it also takes advantage of
the existing /web/content route without having to adapt it.
opw-2040455
Also discussed in task-37264
closes#34384closesodoo/odoo#35121
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
Co-authored-by: Pratima Gupta <pgu@odoo.com>
Co-authored-by: Sébastien Theys <seb@odoo.com>
In the editor, when you write a letter at the end or beginning of a link
it is written outside the link. But if you press "Enter", we get on a
newline with an empty link duplicated on the new line.
This is caused by the custom code handling "Enter" keypress.
With this changeset, in this situation we place the range just before
the beginning or after the end of a link.
opw-1724606
opw-2042097
closes#35188
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Running the following 12.0 tests: https://github.com/odoo/enterprise/blob/b7768337d88990e403338c39e461ecb1796413ab/l10n_mx_edi_landing/tests/test_landing.py#L126
raise the following error using anglo-saxon:
```bash
File stock_account/models/account_invoice.py, line 60, in invoice_validate
File stock_account/models/account_invoice.py, line 89, in _anglo_saxon_reconcile_valuation
File 10n_mx_edi/models/account_move.py, line 12, in reconcile
File account/models/account_move.py, line 957, in reconcile
File account/models/account_move.py, line 948, in _check_reconcile_validity
odoo.exceptions.UserError: ('Account Mercancías en tránsito (115.05.01) does not allow reconciliation. First change the configuration of this account to allow it.', '')
```
closesodoo/odoo#34463
Signed-off-by: Josse Colpaert <jco@openerp.com>
The production.move_raw_ids usually contains only one move per bom_line_id;
it might not always be the case, as ccbd6712f6 used move[0] to get a singleton.
The following calls to _get_document_iterate_key, _log_activity_get_documents,
also require move to be a singleton, so we use replace move by move[0].
opw 2042099
closesodoo/odoo#35206
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
Before this commit, the unit price in the so's portal, had the same
decimal precision as the currency and not the one specified for the unit
prices.
Now, the portal shows the unit prices with their specific decimal
precision.
related to : a1e6a0f0c5
opw-2042089
closesodoo/odoo#35171
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
The "lots & serial numbers" feature can be deactivated at any point.
If there are active products that are tracked, either by lot or serial number,
it can be confusing since deactivating it will hide the relevant fields.
Therefore we raise a warning at onchange if there are tracked active products.
opw 2036173
closesodoo/odoo#35108
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
On the users' view, groups are shown grouped by application (module category).
Deleting a module category should, therefore, regenerate the view.
closesodoo/odoo#35181
Signed-off-by: Christophe Simonis <chs@odoo.com>
Fine-tuning of commit 5621ae3d6b.
While it focused on fixing the 'mass_mail' mode,
it forgot to keep the correct behaviour for the case where only one mail is sent.
In the latter case, it is typical to overwrite the template values, especially
for the body, before sending the mail.
In that case, applying the onchange on the templates overwrites the user input.
Note that in the case where the template is undefined it would set the composer
values to empty ones; while standard use would not allow in mass mail to both
send content and have no template, it could be done via a customisation.
opw 2041631
closesodoo/odoo#35164
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
Before this commit, for the following view tree:
P (active)
|
I (inactive)
|
II (active)
When calling `get_related_views()` on 'P', it would wrongly return 'II'.
It shouldn't, since its parent 'I' is inactive.
Step to reproduce:
- Go to /shop
- Enable ecommerce categories
- Enable Collapsible Cateogories
- Disable ecommerce categories
- Collapsible categories is still shown even if its parent got archived
closesodoo/odoo#35154
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Error due to other module (e.g. purchase_stock, mrp) that will
define their own rules in order to merge or not moves together.
Usecase:
- Install purchase_stock
- Create a product MTO + buy with a vendor
- Create a SO of 1 unit
- On the PO receive 2 units
- On the delivery deliver 2 units
It will create an empty delivery and put the entire move in
a back order.
First issue the extra move is created as a MTO if it's copied from an
MTO move. So il will trigger all the pull rule. We won't it because it's
an extra quantity and the rules should be only trigger by the original
document (SO/MO).
Also an extra move in a picking do the hypothesis that the original move and
the extra move will always be merged together. But in the previous
usecase, the module purchase add the condition that 'created_purchase_line_id'
and 'purchase_line_id' should be the same in order to merge move.
'created_purchase_line_id' is also copy=False, so the move and the
extra move will not be merged. create_extra_move only returns the extra
move and _action_done only process the moves returned by _create_extra_move.
It result by an original move not merged and not processed by _action_done,
it will be automaticaly set in a back order and the extra move is
processed.
In order to fix it, check if the move and the original move will be
merged. If not, returns both moves.
opw-2008113
Close#34005closesodoo/odoo#34411
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
Before this commit, for the following view tree:
P (active)
|
I (inactive)
|
II (active)
When calling `customize_template_get()` on 'P', it would wrongly return 'II'.
It shouldn't, since its parent 'I' is inactive.
Step to reproduce:
- Go to /shop
- Enable ecommerce categories
- Enable Collapsible Cateogories
- Disable ecommerce categories
- Collapsible categories is still shown even if its parent got archived
Test writen in 12.0 with #35154closesodoo/odoo#35155
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Steps to reproduce the bug:
- Create a company C with currency = USD
- Create a vendor V with a supplier currency = EUR
- Create a PO for V with one line, the default currency is EUR
- Save
Bug:
The currency of the PO was USD when saving because the field currency is
in readonly when the state is draft.
opw:2035640
closesodoo/odoo#35144
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Before this patch, if a website is deleted, its redirections will stay, affecting other websites.
Now, website-specific redirections will disappear along with their corresponding website.
closesodoo/odoo#35130
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Since 5c9cea4ee7, it was not possible to remove an applied promo code
pricelist by adding an empty promo code on checkout (eg removing the one shown
in the promo code input).
Indeed, when sending an empty promo code, the `search()` done in the controller
would not find any pricelist as promo would be en empty string. For the rest,
check code on mentionned commit.
See `sale_get_order()` method docstring about `code` param: "If empty, it's a
special case to reset the pricelist with the first available else the default.".
Fixes#34633
Create an activity in a chatter, mark it as done, click inside the
textarea, the popover is automatically closed.
The `click` trigger both opens and closes the popover on click.
opw-2028399
closesodoo/odoo#34982
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Have a partner
Partner (A1)
/ \
Shipping Addr (A2) Invoice Addr (A3)
Give portal access to A1
Make a webshop order with A1
Make it possible for the front end user to edit his billing address (by having forgotten "country" on A1)
Note that the address being choosen as Billing is A1, NOT A3
Save
In the backend check the order. The customer is A1
The shipping address is A2
Before this commit though, the invoice address is A3, which is plain wrong
usability-wise since at no point in the flow the front end user chose that address
After this commit, the billing address stays A1, and A3 is just ignored
This goes with the spirit of https://github.com/odoo/odoo/commit/6e69de67071f2618e00856a74716d861b7f47391
Also, something smarter is possible if we let the user choose the billing address
just like we let him choose the shipping address
OPW 2034976
closesodoo/odoo#35105
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Create an invoice for a customer, send him an email from the chatter, in
the mail template set a specific "Reply to" and send the email. The
"Reply-To" template mail header is ignore and the one generated by
`mail_thread._notify_get_reply_to` is used.
See also 1c57d5e and 7b0806b
opw-2041640
closesodoo/odoo#35127
Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>
Steps to reproduce:
1) Make sure you don't have any piece of the product you're about to
sell on hand.
2) Create two sale order, each with 10 pieces of the product and
validate them
3) Do a RFQ and buy 15 pieces.
4) On the earliest sale order, check the availability, it should
autofill the desired quantity with 10
5) Do the same on the second, it autofills 5.
6) On the later delivery, scrap one.
=> The product is scrapped from the early picking.
Sort the candidates so the current picking is on top, this ensure the
current picking is the first scraped.
opw-2036381
closesodoo/odoo#35021
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
Create a product template Pt with attibutes A1, A2,
respectively with values Va1_1, Va1_2, and Va2.
This should make 2 variants, V1 and V2.
Sell some of these variants.
Then they can't be deleted since they are linked to orders/invoices/...
Now delete attribute A2. We know that:
Warning: adding or deleting attributes will delete and recreate existing
variants and lead to the loss of their possible customizations.
In fact, old variants are only archived instead of deleted:
for variant in variants_to_unlink: ... variant.write({'active': False})
as a fallback.
Now add again the attribute A2 to Pt.
It creates a new variant with the correct attributes.
Since the product is not active and has valid attributes and attribute values,
it is reactivated.
As a result we get the same variant twice.
Here we can simply add a check: if there is already an existing variant with
the same values, we can skip this activation.
We add a tiny little test to make sure that we have correct number of variants.
It's basically unreadable but somewhat commented.
fix coauthored with @rco-odoo
opw 2029985
closesodoo/odoo#35013
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
Set up the POS config to use a default pricelist that is archived.
Open a new POS session.
The constraints are checked, and an exception is raised:
"The default pricelist must be included in the available pricelists."
However, if the session is already opened, the check is not done at resume.
If the pricelist is archived, the session fails to load entirely:
after loading phase, the screen turns black and nothing happens.
Since the constraints are really useful to load the POS, we trigger an explicit
check of all constraints (there are a lot more than our example) when opening
the POS.
opw 2033453
closesodoo/odoo#35077
Signed-off-by: Richard Mathot (rim) <rim@openerp.com>
Before this commit, the unit price of the quote template line were
hidden.
Now, the unit price are shown. This is necessary because the unit price
is used if :
- the template is selected before the customer (price_list) is selected.
- the price_list is "Show public price & discount to the customer"
This commit revert 9416483465
opw-2039071
closesodoo/odoo#35069
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This section of log mentionned two profilers making think they were the
same.
The odoo/tools/misc.py `profile` logs a method calls inside a file that
can be used to generate a graph of method calls.
The odoo/tools/profiler.py `profile` logs a method lines calls, queries
and time spend inside the log.
fixes#31278
opw-2038941
closes#35074
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Fine tuning of this commit: d0f3e896d4
To ensure that the date_invoice is a date object because a comparison is
made with date_due
opw:2033438
closesodoo/odoo#35058
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
The states for the expense are:
- draft
- reported
- approved
- done
- refused
So in the definition of the `payment_mode` field, these states must be used.
Before this fix, wrong states were used in the definition of the field
`payment_mode`.
opw:2038715
closesodoo/odoo#35051
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Steps to reproduce the bug:
- Install accounting.
- Go to Accounting Settings and activate multi-currencies and margin analysis.
- Company currency in EUR
- Currency rate for EUR is 1.0 and 1.5 for USD
- Create two invoices, one in USD and the other in EUR. Both for 30 and for product P.
- Confirm and register payment to make them fully payed.
- Go to Accounting > Reporting > Product Margins > Open Margins.
Bug:
The average sale unit price for P was 60 instead of 25
opw:2035968
closesodoo/odoo#34998
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
You are not able to choose an image for the customer display because of
the bold tag, so we removed it and applied a css class instead.
closesodoo/odoo#34854
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
When opening a dialog using mouse and closing it, form_dialog_discarded is
triggered, which tries to set focus on form while lastActivatedFieldIndex
is -1, as dialog is opened using mouse directly
do not set focus back to form widget if lastActivatedFieldIndex is -1
task-2031706
closesodoo/odoo#34684
Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
Before this commit, when a snippet was cloned, its animation was not destroyed
first. The flow was:
1. Clone the snippet (DOM) - web_editor trigger `snippet_cloned`
2. Start cloned snippet animation - website listen `snippet_cloned`
This was causing bugs, eg facebook snippet for which the animation is to create
an iframe containing the facebook widget.
When cloning this snippet, its iframe would be cloned to, then its animation
would be started, creating another iframe.
To fix such flows, the snippet cloning flow should be:
1. Strop the snippet animation
2. Clone the snippet (DOM) - web_editor trigger `snippet_cloned`
3. Start cloned snippet animation - website listen `snippet_cloned`
4. Restart the original snippet animation
task-1951466
closesodoo/odoo#35029
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Before this commit: 15fa0c23d9
It was possible to encode negative amount for an hr.expense.
Before the fix, it raised a Error saying:
"Cannot create unbalanced journal entry."
opw:2036620
closesodoo/odoo#34953
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>