When validate an invoice, if the user is member of the timesheet user
group and the billing user group, it is forbidden to create an analytic
line without a project set. The previous commit (81218a8) allow the user
to create an analytic account line by adding a record rule in the
sale_timesheet module.
If only the account and timesheet modules' are installed, before this
commit, an error was raised when trying to validate an invoice in the
account module. This issue occurs because the record rule to allow the
user to create an analytic account line is found in sale_timesheet
module, and this one is not installed.
As an invoice can be validated without the need of the sales module's,
from the purchase module, or directly in the account module.
In this commit, the record rule was move to the account module.
opw-1948132
closesodoo/odoo#31661
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Rev. odoo/odoo@9fbb4fb wrongly removed the fixed width on handle and
button width on list views.
This commit restores it.
closesodoo/odoo#32467
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Since rev. odoo/odoo@015958d it is possible to add buttons in list group
headers. These buttons are defined in <groupby> nodes, pointing to m2o
fields. Modifiers specified on these buttons thus use fields on the m2o
comodel.
There was a traceback in editable list view, when grouping by a m2o
that defines a groupby button with modifiers as the modifiers are not
registered with the same datapoint. When updating the modifiers, one
must ensure that the modifier are related to the updated record.
closesodoo/odoo#32456
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Task#1964518
This commit removes es6 code that was unintentionaly introduced
by the product configurator for better compatibility
closesodoo/odoo#32452
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Steps to reproduce:
- Create a sale.coupon.program with a discount of 10% and generate coupons for it
- Go on the shop and add a product of 100€ in the cart
- Go in your shopping cart and add a promotion code
- A new line has been created in your cart with a discount of 10€
- Click on "Process to checkout"
Bug:
The discount had been removed from the cart
Technically:
When clicking on button "Process to checkout", the function "recompute_coupon_lines" is called several times.
The second time, in function "_remove_invalid_reward_lines", the valid applied coupon program couldn't be retrieved
due to the sale price of the discount_line_product_id = -1000000 €. The function _filter_on_mimimum_amount filtered
the targted program because the untaxed_amount of the order was equal to -999900€. So the program._compute_program_amount
was all the time greater than untaxed_amount or untaxed_amount + tax_amount
It s not consistant to set a default value to -1000000 to prevent pricelist strikethrough because in some currencies,-1000000 is not enough.
Now the reward lines are not strikethrough.
X-port/cherry-pick of odoo/enterprise@2748249c0b
opw:1957671
Task#1958723
This commit fixes the survey form to allow creating, testing and sharing
surveys that don't have sections as long as they don't use the "page_per_section"
layout.
closesodoo/odoo#32159
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
- when answer is correct, then score should be +1.
Related to Issue: 1967506
closesodoo/odoo#32612
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
In the manifest must be auto_install instead of auto-install
complementary to commit f14092cclosesodoo/odoo#30980
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Buttons "Send message / Log note / Activity" are on two lines instead of
one. In addition there is a 1px glitch on the attachment icon.
Also long attachment name on tiny screens (i.e. iPhone 5) breaks the
composer layout: horizontal scrollbar appears.
The two-line buttons effect is related to a change (fix) in Bootstrap
4.2 which removes the white-space: nowrap on .btn. It was originally
introduced in Odoo through https://github.com/odoo/odoo/pull/29949.
Reference: Original Bootstrap PR https://github.com/twbs/bootstrap/pull/27010
Task ID: 1946573
closesodoo/odoo#31939
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
fine-tuning commit 1120bffb66
Before this commit, the search on message_has_error (used when clicking
on a failure notification) only display errors linked to message of the
current user. Also, the filter Has_error is true, in the messages view
in technical menu only display the message with errors of current user.
Now, the filter Has_error is true display the message with errors of all
users. The search on message_has_error behave as before.
opw-1958813
closesodoo/odoo#32462
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
Before this commit, the code would try to loop over all possible combinations
following their sequences, until it found the requested one, which could be
extremely slow if there was a lot of combinations.
Now if the given combination is possible, we skip that useless looping and
yield it directly.
To reproduce this: create a product template with millions of possible
combinations (using dynamic attributes) and try to add to cart a combination
that would be found late in the looping. Before the commit, the request would
take too much time.
opw-1958623
closesodoo/odoo#32433
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
On a quotation template, the "Terms and conditions" (note) field may
override the company terms and conditions.
The company terms and conditions is translatable is translatable at
least since 2013 (a510050ba) but the quotation template terms and
conditions has never been translatable.
With this changeset the quotation template terms and conditions are
translatable (so when used on a partner in the lang of the partner for
the quotation).
opw-1960728
closes#32236
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
If an user unlinks an attachment,
it doesn't remove it as message_main_attachment_id.
opw 1950403
closesodoo/odoo#32347
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
When post_refresh is set to 'always', the displayed record is entirely reloaded
each time a message is posted in the chatter.
However no such thing exists for when attachments are uploaded.
This is of use e.g. when in the view there are fields that have attributes that
depend on computed fields, themselves dependent on the record's attachments.
One such case is the OCR.
opw 1950403
Commit a26496b6e7 registered an attachment added through the widget as record's
message_main_attachment.
This to make the OCR feature available for such attachments.
However we copy more closely the behaviour in message_post,
which only puts the attachment as main if there isn't already a main.
opw 1950403
Avoid overlap between address and title in case of a long address.
opw-1966325
closesodoo/odoo#32546
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Commit 9214d78152 is a bit old and made
huge white spaces between graphs
Commit 89931d1749 introduces
a dedicated svg container, on which we can set a fixed height
The 250 px comes from what is being done in the web_dashboard app
with commit odoo/enterprise@1638e5d481
OPW 1944857
closesodoo/odoo#32522
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
In e2e27b41a variable `colspan` and several `<t t-set="colspan"/>` were
removed replacing `t-att-colspan="colspan"` with `colspan="99"`.
- sale_management.sale_order_portal_content_inherit_sale_management has
`<t t-set="colspan" t-value="colspan+1"/>` overidding the portal view
sale.sale_order_portal_content which so may result in error 500
because colspan variable does not exist
- when doing a customization adding a column, adding:
`<t t-set="colspan" t-value="colspan + 1"/>` was the expected behavior
which after colspan change would break
So this changeset reintroduce `<t t-set="colspan"/>` tag up to not
including master, they will have no effect but possible existing xpath
or use of the variable colspan will no longer cause an error.
note: for 12.0 up to saas-12.3 (not necessary in master)
opw-1965886
closes#32539
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
In an editable (main) list view with modifiers depending on the
record id, add a new record. While the record isn't created yet,
the modifiers were correctly evaluated. However, they weren't
re-evaluted when the record was saved (thus getting an id), and a
reload of the view was necessary for the modifiers to be correctly
applied. With this rev. they are now correctly re-evaluated when
the record is saved.
closesodoo/odoo#32483
Signed-off-by: Martin Geubelle (mge) <mge@openerp.com>
Before this rev., navigating with shift-tab didn't produce the
expected result when there were readonly fields on the way. For
instance, pressing shift-tab on a field:
- to the right of a readonly field: the focus was kept in the
current field, whereas it should have been moved to the first
editable field to the left of the readonly one
- in the editable first cell of a row, with a readonly field in
the last column: the focus was moved to the previous line,
which is ok, but on the first editable cell of it, whereas it
should have been on the last editable cell.
@KangOl this commit needs to be forwardported up to saas-12.2, not
later (the code slightly changed in saas-12.3, and we did another
version of the fix).
4612d50bae fixed 9eac6c6377 as _run_valuation did not returned any result
4612d50bae was however returning a value only in one case
Move the return statement to alaways return value_to_return, whatever the state
of the move
closesodoo/odoo#32401
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Due to incompetence, previous commiter used user_has_groups instead of has_group
However the latter is not a higher-level version of the former,
since it checks the groups on the self.env.user, not on self.
As a result, the filtering on the whole recordset was wrong,
since it did the check on the env user for each record.
closesodoo/odoo#32655
Signed-off-by: Christophe Simonis <chs@odoo.com>
Move the code from commit ea1fc124 to the onchange on purchase_id.
The field vendor_bill_purchase_id is a technical one added in v12 to allow using
old vendor bills as template for new vendor bills.
However the logic on purchase_id was already in v11, so we match commit 14239733
opw 1962364
closesodoo/odoo#32661
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
Like other models with a chatter (sales, stock, ...) it is possible to
schedule activities on employees. Scheduling an activity add the
activity to the activity menu (top-right *clock* button) where activities
are classified as *late*, *today* or *future* and grouped by
application. Clicking any of the three class on an employee activity
shows all activities regardless of their class.
opw-1957013
closesodoo/odoo#32657
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
Since f4fbaf1efa the structure of checkboxes has been improved, now we
have something like:
```
<input type="checkbox" id="checkbox-18" class="custom-control-input">
<label for="checkbox-18" class="custom-control-label">​</label>
```
With the first input invisible (whilst before it was visible and the
clickable element).
This cause an issue in an editable list view:
- we have a boolean readonly field in a cell
- we are on focused on a line (not in the boolean field cell)
- we click on the boolean field
=> the check mark is toggled
This is because when we switch cell, we try to activate the widget of
the other cell. Before f4fbaf1efa this issue did not happen since the
browser do not generate a click event when clicking a disabled checkbox.
With this changeset, a disabled FieldBoolean is not focusable as is the
case for other fields, so we can't "activate" it.
Without the fix, the added test fails with:
[clicking disabled checkbox did not work]
opw-1958433
closes#32652
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Since the merge of JQuery 3, the building of systray icons is non
deterministic.
After this fix, the menus are loaded correctly in order.
Task-ID: 1960741
closesodoo/odoo#32382
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
For existing installations, creating indices might not always be
possible, e.g. if you have a Text/Char field that has an index=True
set on it in a field override and pre-existing rows longer than
the pg supported size , the index creation will fail.
Instead of failing miserably during the schema modification, simply
log the problem instead and keep going.
closesodoo/odoo#32442
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
When making a manual payment with account_sepa we want to allow people to add a bank account as it might display the European QR code for banking app, but this should stay optional.
So we made sure that the conditions making the field visible and required weren't the same.
part of task #1918423closesodoo/odoo#32198
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
simplification of payments objects and refactoring of the code
* registering payment(s) from the list of invoice now generate a single payment per invoice selected
* no more abstract object for payments/payment wizard as the logic is now really simple:
- group_invoices option is now removed and we never try to group payments based on the currency/customer of whatsoever (see above),
- the payment amount is the full residual amount of invoice and users cannot change it anymore
* partner_bank_account_id not required as soon as visible (depends on the payment method)
* refactoring to name tags and allow easier inheritance via xpath
part of task #1918423
On a manufactoring order, 'checking availability' will make the reservation of
the components to consume. If those components are tracked by lot or serial numbers, the
reservation will also set a available lot/sn on the move lines and workorder lines.
The reservation already works on product produce wizard lines and workorder line
(form view). We need this commit as preliminary work to being able to suggest them
on the workorders tablet view too.
In case of requesting the reservation after planning the production (applying
reservation on already created workorder lines and checks), we deleted all lines
not yet consumed. They are then recreated with the reservation.
The user can obiously still use the lot/sn he wants by changing it onto the
workorder.
Task : 1891864
closesodoo/odoo#28020
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
This commit allows the user in charge of manufacturing products to
split his production into different lots if this production is done via
workorders. Using a lot in a workorder will adds constraint to all the
other ones. It will also prefil the final lot field and matching quantity
to produce for futur workorders.
This commit uses workorder lines (in another one2many as standard workorder_line_ids)
to register lot/serial number and produced quantity. Prefill lots and
quantities are all read from those lines
Task : 1891864