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>
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>
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>
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: 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>
If there is no token to be shown, don't show the stat button as this
might confuse the end user
closesodoo/odoo#32548
Signed-off-by: Romain Libert (rli) <rli@odoo.com>
Some modules expect the users having the sales_team.group_sale_salesman group
to be able to read payment tokens (credit cards).
Payment tokens are defined in payment.
Both are a dependence of sale, which is thus the lowest common denominator.
opw 1965213
Have a partner, who is an individual, but also a child of a company
Make a deferred revenue as that partner as customer
Validate, and make some entries
Before this commit, the literal partner (the individual) was the one set
on the account.move.line
after this commit, and following what is done for invoices entries,
the commercial partner is set on the account.move.line
OPW 2038774
closesodoo/odoo#34969
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
The terminology of the boolean_button is translated with
_t(opt_terms.string_true)
which can work only if the variable content is already present in the
translation map.
This commit adds js files that do nothing but add the terms in the
translation map. This way it will be exported by babel js export and
the translation will be loaded by the web client
Closesodoo/odoo#34774closesodoo/odoo#34954
Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
Step to reproduce:
- Create a transfer T with quantity for the initial demand
- Scrap all the products
Bug:
At this point, it was impossible to validate or cancel the transfer.
opw:2032714
closesodoo/odoo#34950
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Enable the subtasks in the settings. Create two project "A" and "B",
create two tasks "A.a" and "B.b". Set the parent task of "B.b" to "A.a".
╭─ Project A ─╮ ╭─ Project B ─╮
│ │┏━parent━┿━━━▶ B.b │
│ A.a ━━━━┿┛ ╰─────────────╯
╰─────────────╯
In normal situation, each task and subtasks are in the same subproject,
in such case, the parent task has been duplicated and it is important to
relink duplicated subtasks to the new parent task. In the case the
parent task is not within the current project, the subtask cannot be
relinked to a duplicated parent as it does not exist.
We could either let the link as is or remove it, we decided to remove
the link.
opw-2037623
closesodoo/odoo#35023
Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>
Select invoices with partners with different languages.
Execute the 'Send' action, and choose send_mail.
The mails are all sent in the same language.
The composer extracts the template's body to put it as self.body
(note that everything also applies to the subject field).
This is done with one language.
Down the line, mail_compose_message renders the values with the object,
using self.body (which can be manually edited).
Therefore the lang parameter is ignored at this point.
This should ideally be fixed at the mail level, which is riskier in stable,
so it may be fixed either later or in master.
So this fix only intends to fix the consequences for this specific use-case,
in a much safer way, but it could be removed once the true fix is one.
opw 2035525
closesodoo/odoo#34975
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
This was working fine previously in v11.
Now in v12 it stopped working because Bootstrap 4 adds `!important` to `.text-muted`.
Adding `!important` makes these styles useful again.
closesodoo/odoo#35011
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Let's assume the following scenario:
- open a pos session, sell a product, leave the session and close
it
- on the session form view, validate it and open the
account.bank.statement
- in the dialog, click on the "Journal Entries" stat button
A traceback is raised, because context keys specific to the current
action (e.g. *_view_ref) are propagated to new action.
The python method should only put new keys in the context, and the
JS framework combines them with the current context, from which
action specific keys are filtered out.
Closes#34893
Issue 2034970
closesodoo/odoo#34970
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
When there is a sale_order_line that has either no product_id nor
product_uom nor product_uom_qty (typically a section line),
the computing of the product_qty used in delivery return 0 for each
line below that sale_order_line.
OPW-2034915
Steps:
Create a SO
Add some lines
One should be a section (not the last line)
Save
Check product_qty on each line. The lines after the section will
have a product_qty = O
closesodoo/odoo#35010
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Before this commit, there was a different when opening the quants (the
'On Hand' button) from the product or from the product template. Only
from the product template, the functions _merge_quants and
_unlink_zero_quants were called. This means that when opening from the
product, the quants were not merged, and the empty quants were not
removed.
Now, from the product or from the product template when opening the
quants both functions are called.
Fine-tuning of cdd5b78c63
opw-2035001
closesodoo/odoo#34987
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
Backport from 12 to saas-11.3 (original commit : 97b44806f5)
Having 4 products and 3 BoMs:
BoM 1:
product = Finished
quantity = 100 units
- Semi-Finished 10 units
BoM 2:
product = Semi-Finished
quantity = 10 units
- Assembly 10 units
BoM 3:
product = Assembly
quantity = 10 units
- Raw Material 10 units (product.product 5$/unit)
Before this commit, the price for 100 units of Finished product was
500$, which is wrong. The price was calculated using 100 units of
Semi-Finished product and not 10 units as it should be.
Now, the price is 50$
opw-1973347
closesodoo/odoo#33115
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
closesodoo/odoo#34900
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Register a payment on a vendor bill.
From the menu Account > Purchase > Payment, clik to see that payment
click on the smart button to see the invoices
Create a new Bill
Before this commit, the default type and journal of the new bill were actually the ones of a customer invoice
After this commit, those defaults are the ones of a vendor bill
OPW 2038786
closesodoo/odoo#34967
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Activate option to pay invoice on the portal
Activate an acquirer with the mode: handle payments in Odoo
Make an invoice for a partner
Access that invoice through the route with the access_token
You should not be logged in !
Try to pay, with stripe for example
Before this commit, there was a cryptic error syaing that the credit card ID was invalid
This was because the transaction token was created on the public user
While we tried to access it as the invoice's partner
After this commit, there is no error as the transaction token is on the invoice's partner
OPW 2034691
closesodoo/odoo#34919
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
This commit extends the changes introduced by 88de93114 to adapt
Odoo payment flows to the switch in transaction signature done
by Authorize.net.
The initial fix was not sufficient for flows that mixed redirection
payment flows and server-to-server flows (e.g. paying a quote with a
card that gets saved then using the token to pay for a subscription).
The problem comes from the fact that the server-to-server API uses
the API Transaction Key and API Login ID as credentials to authenticate
requests; there is no need for a signature since this data is never
publicly exposed on the website and a MITM is mitigated by the fact
that it would need to be done between the Odoo server and the
Authorize.net servers (both of which use https in a normal deployment)
which is admitedly more complex than doing a MITM on a Starbucks wifi.
On the other hand, the 'redirection' flow will include all transaction
parameters as inputs in an html form, therefore the signature is
required to ensure that the values have not been modified by a website
user or a mitm.
Since both flows can coexist on the same configuration, we cannot use
the same field depending on the payment flow configuration - we need
both fields to be stored for the provider.
This commit therefore has to introduce new fields on payment.acquirer
record that can store the signature key for authorize in addition to the
usual authorize fields. Instead of adding a new module, this commit uses
non-stored computed fields that will generate System Parameters entries
for any acquirer of the 'authorize' kind when set through the interface.
closesodoo/odoo#34670
Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
If "Recurring Cost Amount" is set on a frequency and the date field
"Contract Expiration Date" is not set, the configuration makes no sense
since we would have an infinite cost, and infinite fleet.vehicle.cost
records and so on which is not possible.
With this changeset, the expiration will be required if there is a
recurring cost set.
opw-2036071
closes#34883
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Enable "eCommerce Categories" in the website shop customize menu, select
a category, sort by catalog price, filter on an attribute, the category
is lost.
When you sort the records, the url changes from `shop/category/x` to
`shop?category=x`. As the attribute form is a plain get action, the
elements from the query string are lost.
We include the category in an hidden input so it is used by the get.
opw-2032477
closes#34603closesodoo/odoo#34877
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>