If two addons path have a common part in the folder name (e.g. `/home/alice/dev`
and `/home/alice/devodoo`), the `get_module_from_path` method may match the
wrong folder.
A file `/home/alice/devodoo/bob/models.py` would wrongly match `/home/alice/dev`
path (due to the lack of separator) and the returned module would be `odoo`
(`"odoo/bob/models.py".split('/')[0]`).
In such scenario, the translations of files (code, static folder, report) would
not be included in the exported translation file.
Force the module path to ends with a folder separator to avoid wrong matching.
Closes#12757
When launching a server with two similar addons path, e.g.:
- /home/alice/dev
- /home/alice/devodoo
launching the server in dev mode may crash due to the poor matching using
`path.startswith(...)` method which may make `/home/alice/devodoo/bob/main.xml`
match in addons folder `/home/alice/dev` and with a non-exitant local path
`odoo/bob/main.xml`.
Instead of relying on the name, use the `os.path.commonprefix()` method to match
on real paths and avoid partial matching.
commonprefix will only work if the folder name ends with the appropriate
separator (which is not guarantee for a user provided addons-path) so force a
trailing `/` using os.path.join(..., '')`.
Closes#12359
Steps:
-Go into Slides (into Website Admin main menu)
-Find the Slide "Odoo Explained"
-Change the channel to "Employee Channel"
-Disconnect or open a private session
-Go to the menu "Presentations" on website
-Click on "Public channel"
Bug:
Error 403
Fix:
When changing the channel_id of a slide, the custom_slide_id of all
the channels using this slide as "Slide to Promote" has to change
in False to avoid access rights errors.
opw:682063
A mechanism already exists to select the appropriate currency and was
introduced in commit 1b04b1d. However, it requires a purchase journal in
the currency of the PO to work.
Note that this commit is likely to not work correctly since the method
`_onchange_journal_id` is triggered after `_default_currency`.
Therefore, even if the currency is correctly set in `_default_currency`,
it is changed to the journal currency right after.
This reverts commit 7f1d7c1cce.
Before the commit, the dt was forced to 160px of width by bootstrap.
Now we allow this size to be bigger, to avoid glitch in UI.
When you was inserted a long keyword, the 'delete' button was in the
overflow hidden part and so was undeletable.
We set min-width by default to 160px to keep the same behaviour by default.
And see 2 columns, but if a keyword it too long, we display it, and 'break'
the column style.
This commit closes#12703
So @sig-odoo is not the only one to revert his own fixes :-)
Anyway, we want to be able to get statistics about archived applications
as well.
This reverts commit 7e0e27ea79.
After upgrading the `hr_attendance` module,
it was no longer possible to use the
`Attendance Error Report` link in the `More`
menu of employees.
This is because there were two binding actions
added in the code under the samename
(`Attendance Error Report`):
- `hr_attendance_error_values`
- `action_report_hrattendanceerror`
The first launch a wizard which will print the report
after filling the required data,
The second tries to directly print the report, but it
fails because required data (from the wizard) is missing.
Before update, it's the first binding action that was displayed.
After update, it was the second, which failed.
We solve this issue by changing the way the report is
created through the data, by not using a `<report/>` tag,
this one creating automatically the action binding.
Instead, we use a classic `<record/>` tag, which
doesn't create automatically the action binding.
opw-682720
Steps to reproduce:
-Set your company in USD
-Create a SaleOrder with a pricelist in EUR
-Create an expense in USD, with the analytic account of the SO
-Confirm the expense and post journal entries.
Bug:
The unit price of the new SO line was wrong: it was stil in USD as in
the expense.
Expected behavior:
The price unit must be converted in EUR
opw:682378
When the lead step is activated (`group_use_lead` is true), 2 dinstinct
tree views can be selected to display the opportunities.
Indeed, when the action "Your Pipeline" is selected, the tree view
`crm_case_tree_view_oppor` is displayed thanks to the method
`action_your_pipeline`. However, when the page is reloaded or the tree
view is saved in the custom dashboard, the tree view
`crm_case_tree_view_leads` is selected instead.
The fix is to specify explicitly in the action which view should be
chosen, accordingly to what is done in method `action_your_pipeline`.
opw-681488
opw-681734
In v8, we had a BoM price report in xsl format which was removed in v9.
As it is still needed, we added a report in the new qweb format, but this
time it is on the BoM instead of the product variant.
It also makes sense to have a similar report for v10 as the cost structure report
on the mo is for the real cost and not the standard cost.
Removed assertion statement that was making a useless browse on account.move. This single patch is enough to divide by 4 the time of preprocessing a bank statement when opening its reconciliation widget.
That removed assertion is now a supposed prerequisite when calling the function and should be tested first (on batch of records).
When using the abbreviated month in the language
date format (`%b`),
e.g. `%d %b %Y`
in some languages, the parsing of the date
from this format to the database format (YYYY-mm-dd)
failed because of a dot `.` added from time to time
to the end of the abbreviated name
e.g., in French, `5 juil. 2016`
This is a bug of `moment.js` < 2.13.0,
handling badly this dot.
This is solved from `moment.js` 2.13.0,
thanks to the below revision
moment/moment@41fdb58572moment/moment#3078
Unfortunately, we cannot update this library to its latest
release in stable release of Odoo (e.g. 9.0),
as this is seen as an unstable change
(if some API changes occured in the given library)
Instead, if the parsing of the date fails with the
strict mode (meaning the date must respect the format
exactly), we perform a second pass without the strict mode,
so this dot will be ignored,
and the date can be correctly parsed.
The issue can be reproduced by loading the French language,
and setting `%d %b %Y` as date format, and then performing
an advanced search on a date field. The value of the date
in the advanced search will be empty without this revision
(for the months having more than 4 chars,
other than `mars`, `mai`, `juin`, `aout`).
Fixes#11854
opw-682534
It is possible (in very rare cases) on rereservation that the new reservation will trigger other stock moves
than the first reservation. In order to be sure to send the correct stock moves involved to done, it is better
to do the rereservation before the splitting of the moves on the total picking.
Also rereserve is optimized as it should only reserve for what is given by the pack operations,
as the backorder will be reserved later on anyways.
If you are in a view whose action defines a default team (for
example in a pipeline view), the default should take the context
into account instead of simply forcing the team of the current
user.
opw-682577
Tax Paid(Hacienda Pública. IVA soportado) and Tax Received(Hacienda Pública, deudora por IVA)
must be respectively under Current Asset and Current Liabilities in BS report.
opw:681998,681252
The compute method of the `counterpart` field only keeps a maximum of 2
account codes. However, it attempts to do [0:2] on a set, which is not
syntactically correct in Python.
opw-682373
The "else" has to be removed because if a tax group named "X" is
the group of tax "A" and "B", the journal item corresponding to the invoice line
has the taxes "A", "B", and "X" set.
Introduced by 5a5ac1d7a5
in details:
[FIX] added analytic account in grouping key of because we need to create different journal items for each of the lines having a different analytic account.
[REF] added a function on account.tax that returns the grouping key and that could be inherited in another (community) module
When an account move line(aml) is created for an include base amount tax,
all the other taxes are impacted with this tax then the field tax_ids of
the created aml must contain the other taxes.
Example:
Considering an invoice line with:
-A price=90
-A fixed include base amount tax=10(incl_tax)
-A 21% tax(called tax)
The base amount for the 21% tax is equal to:
100 = 90 + 10(incl_tax)
When the invoice is validated, three amls are created:
One for the product with:
-Debit=90
-Credit=0
-Tax_ids=(incl_tax, tax)
-Tax_line_id=()
One for the incl_tax with:
-Debit=10
-Credit=0
-Tax_ids=(tax)
-Tax_line_id=(incl_tax)
One for the tax with:
-Debit=21
-Credit=0
-Tax_ids=()
-Tax_line_id=(tax)
In this way, the base amount of 21% in the "Declaration periodique TVA"
report is the sum of all the amls balance(credit-debit) linked to tax with
the field Tax_ids.
opw:681102
In the below revision:
c0db6aec56
The dialog close `reason` was introduced
to not reload the current form if the dialog
has been closed for a reason
(e.g. a window action was returned by the server).
This is to prevent the record reload, which:
- Is useless, as another action has been launched
and the user therefore redirected elsewhere
- Can fail, in the case the initial action deleted
the current record
(e.g. when merging a lead in an opportunity, the
lead is removed, and therefore this is not possible to reload
it).
opw-680180
When a product is received in the lot reception view, a new lot is
created. If the user receives at least one lot, closes the lot selection
window, then reopens the window, he will not be able to create a lot
anymore, but only choose existing lot.
The fix is to make sure that the lot selection is available only in the
case of a returned product.
opw-681925
Before this commit, the return of a delivered product with a lot number
is problematic because the user cannot select the lot from the list of
delivered lot numbers. Therefore, the user needs to create a new lot
number for the returned product since the combination product/lot must
be unique.
opw-681925
The FEC control check does not like rows
with debit = credit = 0
```
º Structure fichier incorrecte, débit/crédit ...
renseignés sur une même ligne ... , ou débit=crédit=0
```
opw-682365
Using a frozendict as context breaks the `t-lang` mechanism, as
the `loader` is not aware of the changes of a copied frozendict
and thus is still using the values from the original context,
including the lang one.
This reverts commit e1deae7eab.
When a kit is sold, the unit price of the COGS recorded is the sum of
the unit prices of each component multiplies by the quantity sold.
Obviously, this is not correct since the unit price should not take into
account the quantity sold.
opw-681403
The previous wording was inaccurate and made users think it
was impossible to setup "Net EOM" payment terms.
Updated POT file accordingly, but not PO files because this
requires a proper new translation.
The field bom_count appeared twice in product.template form view and
then the smart button for "Bill of Materials" always displayed 0 as
number of BoMs.
opw:681830