In case of a move where source location = destination location, the result of
SUM(quantity) would be 0 and ending up with a division by zero.
Closes#12247Closes#12423
The view yields one line per stock move, with a price/unit on each line.
It doesn't make sense to sum price/units, the avg will be only meaningful when
grouping per product but it's correct in the default state.
Closes#11309
We don't mount /boot in fstab to prevent systemd-udev looking for
corresponding kernel modules in /lib/modules. We need to do this
because the modified kernel-qemu image we use for emulation is usually
not 100% the same version as in the Raspbian image. Therefore
systemd-udev won't be able to find the 'correct' kernel modules in
/lib/modules.
This causes issues when the raspberrypi-kernel package is updated
however. apt will update /lib/modules and will write the new
kernel{7,}.img files to /boot. Before this patch /boot was just a
directory on /dev/sda2, not the 'real' /boot which is on /dev/sda1. So
you'd end up with old, not updated kernel images but new, updated
kernel modules in /lib/modules.
This mounts /boot after the system booted. /boot gets mapped to
/dev/sda1 by /etc/udev/rules.d/90-qemu.rules.
Fixes#12650
opw-682320
When an applicant is moved from a stage to another, an email is sent to the
applicant(s) if an email template is specified on the stage.
The active_ids is correctly set in the compose context to be used by the
send_mail method to send a message to all the applicants in the new stage.
However, a potential active_id may be propagated from a previous action.
This is the case when a user goes from a Job Position record to the list of
applications and change the stage using the kanban view (active_id & active_ids
is the id of the hr.job).
The default_get method of mail.compose.message will use the active_id as the
default value for the field res_id which is wrong as it is the id of another
record).
Forcing the value at False instead of ids[0] as it would not work in batch mode.
The list of records is correctly used in send_mail anyway.
Closes#12494
When a product is a kit and a discount is applied thanks to a pricelist,
the discount is counted twice if the invoice is created from the stock
picking.
This is because the pricelist will modify the price unit, but moreover
the discount will be applied a second time by the method
`_compute_price` of the account move line.
opw-676838
Do not redefine the view arch but do a proper inherit.
It was a problem as the redefinition removed some fields (headers,..).
It was also a problem if crm_profiling was uninstalled as the redefinition was
not removed.
Closes#12454
The group_lines method didn't make the sum of the quantity field, hence resulting in incorrect results when making product based statistics from the account.move.line records.
Courtesy of Luc De Meyer. Was PR #10551
The `related_usage` field of `purchase.order`
is a related field to the location `usage` field,
which is defined in order to display/hide
some other field in the PO according to the location usage
This is purely a technical field, which is set only
to change the form view according to the location
usage.
This is not expected to change the location usage
through this field, this field must therefore
be set to readonly.
A change on the location usage could happen because
of the `onchange_picking_type_id`:
If the user changed the picking type, and then the location,
the usage returned by the `onchange_picking_type_id` was
applied on the location, and this must not have happened.
In addition, since `related_usage` is a related to the location
usage, it should be changed as well when the location is changed.
(in the new api, this is no longer required, the related field
is updated automatically).
This revision therefore adds an onchange on the location as well,
to handle this.
opw-676428
[FIX] anonymization: default anonymization fields
res_partner.name was twice : remove one
res_users.name doesn't exist (now, it use the partner name) : remove
remove training.* fields that do not exists
Closes#11806
Partial backport of ef19830. The error message cannot be included for
compatibility reason, but the browser will highlight the field in red,
which should be enough to locate the error.
opw-677121
Fixing the error ValueError: "name 'date_from' is not defined"
while evaluating '[date_from, date_to, employee_id, contract_id]'
This commit close#12383, close#8883, close#3116
To match the behaviour on sale.order.line.
Purchase line form is expected to be open in popup (where parent is defined),
not individually when creating a line alone is not useful.
Fixes#6644Closes#12325
* v5.2: Añadida retención 19,5% arrendamientos.
* v5.1: Renombrado todo lo relacionado con arrendamientos para no incluir la
palabra "IRPF", ya que no es como tal IRPF.
* v5.0: Se ha rehecho toda la parte de impuestos para dar mayor facilidad de
consulta de los datos para las declaraciones de la AEAT y para cubrir todas
las casuísticas fiscales españolas actuales. Éstas son las características
más destacadas:
* Desdoblamiento de los impuestos principales para bienes y para servicios.
* Nuevo árbol de códigos de impuestos orientado a cada modelo de la AEAT.
* Nuevos códigos para los códigos de impuestos para facilitar su
actualización.
* La casilla del modelo viene ahora en la descripción, no en el código.
* Posiciones fiscales ajustadas para el desdoblamiento.
* Nuevo impuesto y posición fiscal para retención IRPF 19%.
* Nuevo impuesto para revendedores con recargo de equivalencia.
* Nuevas posiciones fiscales para retenciones de arrendamientos.
* Pequeños ajustes en cuentas contables.
Closes#8453
The hw_scanner module not only supports barcode readers (although that
was it's original intention). It also happens to support certain card
readers (like the MagTek Dynamag we use for Mercury) because they act
the same way as barcode scanners (like a keyboard and end sequence with
ENTER).
Before we supported Mercury there was no real reason to support multiple
devices on the POSBox, because it didn't make much sense to attach >1
barcode reader to the same POSBox. With Mercury however, this is a real
use case, as users want both a barcode reader and a card reader.
This commit implements support for this, while keeping the functionality
as close as possible to how it was before (eg. care was taken to not
break plug and play support).
When an invoice is created automatically thanks to the cron task, the
superuser is used. However, this implies that the company of the
superuser will be used for the account invoice creation, leading to
potentially incorrect taxes and fiscal positions.
opw-669714
The test `test_balanced_exchanges_gain_loss`
failed on Jun 6, because it created a specific rate
for today's date at midnight
(e.g. on Jun 6, 201x-06-06 00:00:00) for the test purpose,
but a rate is created in the demo data for Jun 6 midnight exactly:
`base.rateUSDbis`, making the test confused about which rate
to use.
We solve this by making the test use the rate `base.rateUSDbis`,
modifying the rate for its own need, instead of creating a new
rate.
HTML content should be escaped before being sanitized. Any content (link, image,
code,...) that is acceptable in usual mail.message but should not be interprated
when posted on a comment of the forum.
Fixes#3737
If we take the below facts:
- The country select is set as disabled
when Shipping is set to "Ship to the same address"
- The disable property of select inputs is
removed when shipping is set to
`create a new address`:
In `website_sale.js`:
```
$selects.attr("disabled", value <= 0 ? null : "disabled" ).prop("disabled", value <= 0 ? null : "disabled" );
```
We can safely assume that the select input "State / Province" was supposed
to be set as `disabled` in the first place, not as `readonly`
Before this revision, State / Provice was greyed when choosing
"Create a new address" for shipping, and selecting the United States
(but the select input was still usable, though, it was just greyed)
opw-675739
When subscribing a user to a mailing list, the `mail.mass_mailing.contact`
created is processed to identify it's name and email from the address (method
`get_name_email` called in `add_to_list` and `name_create`).
For a better consistency, the search of existing contacts should also be done
using the method `get_name_email`.
This avoids that subscribing twice `Example <example@example.com>` fails to
detect duplicates and creates two subscriptions.
Closes#12265
xml template was using color name, because color index was empty.
It works in English, but once translated (in french e.g.) we have background-color:noir
Fix#12251
The field generation is most of the time following the pattern
`field_<table name>_<field name>`
but in case of name clash (e.g. res.partner.category - id and res.partner -
category_id), the id of ir.model.field is added at the end of the external id
during the field creation.
The more flexible way to link to an ir.model.field is to use the syntax
`search=[('model', '=', <model>), ('name', '=', <field name>)]`
to avoid errors as in #12192 when the "first" external id no longer exists.
Fixes#12192Closes#12198