In `_compute_qty_delivered` function
Python `all` function returns `True` if list is empty; thast why check
if `moves` is not empty to set `qty_delivered` to `product_uom_qty`.
Before the fix, if you had multiple accounts for a specific service, the
settings page was crashing.
(eg: for a service, you have one account specific to a company and
another account with no company set).
We now prefer accounts specific to the current company and tie-break on
the most recently created one
opw-2003744
closesodoo/odoo#33736
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
The stable behaviour of the mail composer is the following:
- if a template adds new attachments, the composer only has this list
- if a template doesn't add attachments, the list is unchanged
- if no template is set, the list is cleared up
In the case of templates, we also check that both static and dynamic attachments
are added to the list.
We clean up after c6d718f211 and subsequently 516f22c398 which failed to take
into account the fact that the attachement list could be a blend of commands
and ids.
Transforming that is taken care of by _convert_to_write, which semantics was
changed by c6d718f211.
To keep the second behaviour, we thus need to add a (5,) command.
opw 2003197
closesodoo/odoo#33707
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
If a field is inherited from another model, the attribute context_dependent
was not propagated correctly.
Example of bug:
>>> product = self.env['product.product'].search([], limit=1)
>>> product.name
'Whiteboard Pen'
>>> product.with_context(lang='fr_FR').name
'Whiteboard Pen' # cache used
>>> template = product.product_tmpl_id
>>> template.name
'Whiteboard Pen'
>>> template.with_context(lang='fr_FR').name
'Marqueur pour Tableau Blanc'
>>> product._fields['name'].context_dependent
False
>>> template._fields['name'].context_dependent
True
Fixesodoo/odoo#33641Closesodoo/odoo#33722
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Having :
- a pricelist with 10% of discount for all the products.
- the discount policy in the pricelist set to : "Show public price &
discount to the customer"
- a product with negative price (ex : -$125)
- add the product in a SO with the 10% pricelist
Before this commit, the unit price was the price with the discount
already applied: -$112.5, and not the original price as expected; The
subtotal price was $101,25 (the discount is applied twice) which is
wrong.
Now, the unit price is -$112.5 as expected, in Odoo surcharge are always
included in the display price.
opw-1986582
closesodoo/odoo#33717
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
oe_view_nocontent_smiling_face does not exists in css
when using this classname, the smiling face does not appear
closesodoo/odoo#33519
Signed-off-by: Christophe Simonis <chs@odoo.com>
When recreating the auto-generated view of user base.user_groups_view (e.g.
with a '-u base'), the view was generated in the language of the admin.
In case the database was in a different language than English, the source arch,
stored in database in arch_db field, was translated.
Instead, the source must be in English and translations must change the content
based on the user's language.
This was introduced at 894143cb4c as the view content was not translated.
At that time, the arch field was not translatable and the xml_translate mode
did not existed yet
Fixesodoo/odoo#33482closesodoo/odoo#33566
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
- Create a lead without Salesperson assigned
- Edit the lead, set a Salesperson => the Assignation Date is set
- Edit the lead, change the Salesperson
The Assignation Date is reset.
There is no reason to change the Assignation Date in the second case.
Indeed, in many cases the Salesperson is modified for a good reason
(e.g. the first person left the company). From a customer perspective,
that doesn't change anything: he was always in contact with a
salesperson and the lead was handled. Moreover, the reporting becomes
incorrect.
We only change the Assignation Date if no Salesperson was assigned.
opw-2001912
closesodoo/odoo#33640
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
- Create a SO for a stockable product
- Validate the SO
- Change the 'Delivery Address'
Nothing warns the user that the address was not changed on the
corresponding pickings.
opw-2002084
closesodoo/odoo#33636
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Usecase to reproduce:
- Install stock, mrp, purchase
- Go on warehouse form view
- Click on Routes button
Either one of the route manufacture or buy is missing.
All implementations/overrides of stock.warehouse._get_all_routes()
call their parent's implementation of get_all_routes_for_wh().
which is a reference to stock.warehouse._get_all_routes() but that means
that the route 'mixin' behavior can be skipped.
(the reference is to the base implementation of _get_all_routes())
Fixes#33286Fixes#33288
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
- If the current user doesn't have write access to `hr.leave` or
`hr.leave.allocation` and tries to modify the manager (`parent_id`) of
a `hr.employee` record, an access right issue is raised.
This commit fixes the issue.
OPW-2000569
closesodoo/odoo#33542
Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>
- Install the sales and stock applications
- Create a stored product tracked with unique S/N
- Create an initial inventory for this product with 2 SN 001 and 002 and
validate it
- Create a SO for 1 unit of the product, and deliver it using SN 001
- Display the product form view
In the form view of the product, the quantity on hand is 1 (correct).
But when we click on the smart button, we see that the Stock location
has a quant for SN 001 and a quantity of 0.
The vacuum should be run when we access the stock information from the
'On Hand' stat button.
opw-1999545
closesodoo/odoo#33687
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Before this commit, the help of the product_email_template module said
that the email is sent when the invoice is paid. This is not the case,
the current behaviour of the module is that the email is sent when the
invoice is validated.
Fine-tuning of : 4b5265b9b9,
10eee18a04
and 33a413eb29
opw-1973946
closesodoo/odoo#33686
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
When checking the rights when creating a new activity, c38a0d6768
made the choice to bypass the check if the multi-company case.
However the "multi-company case" was determined by checking that
len(target_user.company_ids) > 1; however if target_user.company_ids contains
companies to which the current user doesn't have access, then this is wrong.
Let the active user be Ua in companies C1, C2, currently in C1,
and the target user be Ut in C2, C3, currently in C3.
Then target_user.company_ids == [C2] for Ua, so the check would be False.
This shows that we need len(target_user.sudo().company_ids) > 1.
opw 1998709
closesodoo/odoo#33681
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
Follow up of 51ef8514ea
The RPC would fail to return the correct value for `is_combination_possible` if
a product_id is given instead of a combination.
opw-2003069
closesodoo/odoo#33677
Signed-off-by: Sébastien Theys <seb-odoo@users.noreply.github.com>
The test assumes that the company currency is in USD. However, if it is
not the case, the test fails.
We make the test more robust by simply checking the amount.
opw-2000681
closesodoo/odoo#33680
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Due to a forward-port, the code updating the vendor_ref has been duplicated
a few lines apart.
Closesodoo/odoo#33334closesodoo/odoo#33676
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
When an allocation have as leave type hours, and have the mode different
from 'By Employee', the stored duration (in days) is calculated dividing
the filed number of hours by 8 (number of hours per days).
During the validation, an allocation is created for each employee that
match the mode chosen.
In these allocations, before this commit, the number of hours displayed
is calculated by multiplying the stored duration (in days) with the
average number of hours of the employee.
The problem is that in may cases the average number of hours of the
employee is different from 8, and the display number of hours is not
correct.
Now, the number of hours is calculated with 8 when the allocation is
created from another allocation.
opw-1972133
closesodoo/odoo#33675
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
Fine-tuning of 516f22c398.
This commit missed attachments that are linked to a mail.template,
which should be added to every mail sent using the template.
To make sure that we both fix the duplicates and the generation issue,
we add a test.
opw 2000515
opw 1998782
closesodoo/odoo#33653
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
If a translation has an empty src and value, the value in the dictionary
after the search_read is False, not ''
When doing an insert, False is converted to 'false'
Before 489494e733 the translations were inserted using the ORM which correctly
converts False to ''
opw-1999723
closesodoo/odoo#33649
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Since b0ff033d69
To reproduce this issue: give to the processing method a PNG with transparency
and which is already encoded in palette mode.
In 12.0 such image could be `addons/payment/static/img/codensa_easy_credit.png`.
In earlier versions of Pillow, adding an alpha channel to such image would have
no effect, but since version 6.0.0 they raise an exception when that happens.
The PNG spec forbids the use of a full alpha channel with palette-based images
according to http://www.libpng.org/pub/png/book/chapter08.html#png.ch08.div.5.2
task-1998639
closesodoo/odoo#33628
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
toggle full width of calendar not working, this is because getItem of
localstorage service now returns parsed value, AbstractStorageService now
return JSON.parse(value)
this commit fixes that.
task-1975004
closesodoo/odoo#33570
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Priyanka Kaakdiya <pka@odoo.com>
Task 1961719
type was set to False when called in the create method. This yielded
always the same account when importing invoices. Getting the value of
type from the context corrects that issue.
closesodoo/odoo#32579
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
When setting the partner of a lead, on the form view the email_from
is automatically populated by the onchange on the partner_id.
This is not the case when created programmatically,
and this is not even the case when created from the kanban view.
This can lead to an unexpected failure to send emails down the line.
We apply the onchange in the create to fill all values consistently in all cases.
In case the values were already set, this simply won't change anything.
Note that we need to adapt the test from website_crm_partner_assign.
It uses demo data that makes little sense.
The opportunity crm.crm_case_21 is set in the UK,
with a partner base.res_partner_4 in the US, in the state Escuintla of Guatemala.
With the change from above, all the address fields on the opportunity are
populated by the onchange, from the partner.
opw 2000241
closesodoo/odoo#33622
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
Performance issue
-----------------
In databases with a lot of POS order lines, the Sales Analysis report is
quite slow. This impacts performances in the report itself and in the
form views of products and product templates. Indeed, they use the
`sale.report` model to compute the `sales_count` field on products.
opw-1987368
Bug on UOM
----------
- Activate Units of Measure
- Create a product A, set its UOM to 'g' (grams)
- Sell one product in the POS
In the Sales Analysis report, the amount is multiplied by 1000.
opw-1978462
Bug on taxes
------------
See issue #24746
All issues originates from the SQL view which is quite complex for no
good reason. Indeed, in v12 the fields `price_subtotal` and
`price_subtotal_incl` are stored and contain the necessary amounts.
closesodoo/odoo#33304
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Co-authored-by: Nicolas Martinelli <nim@odoo.com>
When receiving an email, an attachment is created for every base64
embedded image. We got an invalid image which caused the attachment
generation to fail with a traceback due to a base64 decode error.
The attachment creation has been wrapped into a try/catch in order to
remove problematic images.
opw-1987224
closesodoo/odoo#33620
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
Commit a0dd81b added 'magic' support for ir.config_parameter
to res.config.settings fields.
However for boolean fields, we have:
IrConfigParameter.get_param(icp, field.default(self) if field.default else False)
if value is False we do nothing.
If icp is defined we get a str.
Now if field.default(self) is truthy, it will be called with value.lower().
In particular if value is the boolean True, it will crash and thus settings are
rendered inaccessible.
Note that commit odoo/enterprise@39fb3be0ef gave a default '' value to a
boolean field, sidestepping the issue.
By convention, config_parameters encode booleans using bool(str),
i.e. '' encodes False, while anything else encodes True.
We follow this convention here;
which means that "False" would be be interpreted as True (to Tarski's dismay).
Note that passing a default True value would mean that the config_parameter
would be False before the first settings save, which could be avoided by putting
the value in the module data.
opw-2000718
Closesodoo/odoo#33517
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Co-authored-by: Martin Trigaux <mat@odoo.com>
For many2many_tags widget 'o_tag_color_0' class apply box shadow, in form
view it looks good but in kanban view, it does not look good so I have
removed box shadow from kanban view.
Before this commit in kanban view when no attributes are used in the field
at that time tags will be in box-shadow but after this commit even if no
attributes are used in the field, tags will be without box shadow.
Task ID: 1963188
Closes: #33503
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
- On the invoice pdf, if the invoice is in USD, we
need to specify conversion rate and amounts in AED.
Also, if it is between certain Gulf states, you need
to mention this on the invoice. 'Invoice' also
needs to replaced with 'Tax Invoice'.
- Taxes changed to 0% and 5% / AED symbol on currency
adapted to the real situation of UAE.
- A tax by state automatically adapted with the fiscal
positions in order to have the tax amounts correctly
split by state in the tax report.
opw-1931322
closesodoo/odoo#33385
Signed-off-by: Cedric Snauwaert (csn) <csn@openerp.com>
Suppose you make a reconciliation on an account having a foreign currency being
the same as the company one.
Suppose also you are making a reconciliation of three lines without currency_id set on this account:
- A with debit = 11
- B with credit = 10
- C with credit = 1
Before this commit, the reconciliation was wrong because all computation are made using the foreign
currency due to the account's configuration. As A, B & C have their amount_currency set to 0,
an account.full.reconcile is well created but only one account.partial.reconcile is created instead of
2 leading to an inconsistent state.
opw:1984684
closesodoo/odoo#33445
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Co-authored-by: Goffin Simon <simon.goffin@outlook.com>
The action to send cart recovery mails is really made to be automated.
However it was written in a way requiring either manual input, to use
action_recovery_email_send.
To make an automated action, you basically need to put the code of it
directly into the action itself, or it would be made incorrectly.
opw 1981665
closesodoo/odoo#33185
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
- generic CoA
- Sars VAT ready structure
Thanks to Paradigm Digital
separate pr for 12.3
opw-1893580
Closes#32685
Signed-off-by: Cedric Snauwaert (csn) <csn@openerp.com>
In the accounting dashboard, click on the hamburger menu of a purchase
or sales journal, then click on View Bills. Both vendor bills and
refunds are displayed.
This is because the `use_domain` key of the view is replaced in the
`open_action` method.
opw-2000904
closesodoo/odoo#33562
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
In order to force the user to select a new leave_type when requesting a
leave for someone else. We reset its value in the `_onchange_employee_id`
Task : 1984487
Closes#32697Fixes#29806
Courtesy of @sswapnesh
closesodoo/odoo#33178
Signed-off-by: Romain Libert (rli) <rli@odoo.com>
- Create 3 products, add 2 sales tax to each product
- Create a quotation template with the se 3 products
- Switch to mobile mode
- Create a SO, add the quotation template
- Modify the first line and change the quantity
The taxes of the two other lines are removed.
This is due to the missing `tax_id` field in the mobile kanban view.
opw-1998493
closesodoo/odoo#33527
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
When opening the weight screen in PoS it can take up to 10 seconds
until the weighting starts. This can be resolved by using a
Threading.Event instead to reset the 10 second sleep time.
Using exit_flag.wait(timeout=DELAY) will be more responsive, because
you'll break out of the while loop instantly when exit_flag is set. With
time.sleep(timeout=DELAY), even after the event is set, you're going to wait around in
the time.sleep call until you've slept for DELAY seconds.
closesodoo/odoo#32389
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
This commit fixes a js crash that occured when the user was trying to
edit a new record while the chatter was not completely loaded
(this.field.thread.$el was not in the dom yet)
Behavior before this fix:
Traceback js & impossible to edit the form afterward.
Behavior after this fix:
no traceback, still possible to edit the form normally.
The thread will display on next chatter re-render. Could be forced by
triggering an onchange.
opw-1986061
closesodoo/odoo#33381
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Since b5a12b4aac the website_id was not set anymore.
Indeed, before this commit website_id was the field from the inherits, thus
when writing on website_id from res.user, we would write on the partner field.
But with b5a12b4aac the website_id was explicitely overrided on res.users as a
related to res.partner (its inherits) with readonly=True.
Thus, writting website_id on res.users was not working anymore.
closesodoo/odoo#33521
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
* properly handle 3-args version of odoo.define(): just ignore the
second argument, pretty much the only use-case is dynamic
dependencies (otherwise it should be using static require() calls)
so there's little the extractor can do
* fix an issue with sys.path ordering meaning sphinx would pick up an
odoo installed into the current virtualenv (editable or not) over
the local copy it's part of
closesodoo/odoo#33538
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
- When validating payments on the payment process polling page
errors can occurs and the tracebacks aren't logged which doesn't help
when trying to understand the issues.
With this commit we display the traceback instead of shadowing them.
closesodoo/odoo#33537
Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>