Size attributes (e.g. `max-width`) are sometimes set in css (i.e. with classes,
see `oe_avatar`).
They must however be overriden if they are specified on the widget.
Example:
<field name="image" widget="image" class="oe_avatar" options="{'size': [180, 180]}"/>
The `max-width: 90px` set on oe_avatar must be overriden in this case.
Note that the attribute `img_width` and `img_height` have been depreciated as
`width` and `height` are fulfilling the exact same purpose.
Accounting entries made for invoices and stock valuation on the interim accounts (stock input/output accounts) are now reconciled together for both sales and purchases. This will definitively help to have those accounts zero-outed when all operations are processed.
The reconciliation is made as long as the stock valuation is set in real-time, whatever the costing method.
Note that change change also allow a particular use case to be solved: when a purchase is made in a foreign currency whose rate change between the incoming shipment reception and the bill validation (there will be an automated exchange rate entry created).
Was task 32331. Was PR #22483
Use case to reproduce:
- Create a picking containing 2 moves that have a quantity_done greater than reserved quantity
- Validate the picking with or without backorder
Traceback due to a record that do not exist anymore.
It happens due to 2 functionality that have a wrong behavior when used together:
- merge_move function that will try to merge moves with same characteristics inside a same picking.
- action_done functionality that will create an extra move if the quantity done for a move is greater
than reserved quantity. (the extra move is used in order to propagate changes)
With our usecase:
- MOVE A, reserved_qty: 10, qty_done: 20
- MOVE B, reserved_qty: 10, qty_done: 15
action_done on move A will create a new move thus we will have
- MOVE A, reserved_qty: 10, qty_done: 20
- A bis, reserved_qty: 10, qty_done: 0
- MOVE B, reserved_qty: 10, qty_done: 15
then merge move will not only merge move A and A bis but will also merge B
which result with inconsenstencies and traceback since system will try to
process move B after A
- MOVE A,A',B reserved_qty:30, qty_done:35 (the 5 extra qty is not propagated)
This commit adds a kwarg in action_confirm that is propagated to merge_move
this kwargs is a record set taht will limit the moves that can be used for the merge
in order to merge extra move in original move
opw-1825264
This merge make several application automatically generate activities based
on business requirements in order to ease the daily job of people using it.
In this merge
* methods allowing to create, reschedule, mark as done or unlink activites
are added in mail.activity.mixin;
* automated activities are flagged using the newly-added automated field
to distinguish them from other activities;
* mail.activity.mixin is added to some models to ensure activities are
activated;
* several main applications use this API to integrate activities automation
in their flow: hr_holidays (leave and allocation), hr_expense (expense
report), fleet (vehicle contract), maintenance (maintenance request),
sale (sale order);
Please see sub-commits for more details about the mixin update as well as
the integration in the various applications.
This merge is linked to task ID 39578. Closes#20799 .
This commit improves maintenance requests management through a better
integration of activities and addition of automated activities. Several
things are done in this commit :
* automatic activities generation is added for maintenance requests.
Activities are generated to remind assigned users about maintenance to
perform. They are also automatically removed or updated if the scheduled
date is changed or if the request is done to avoid bloating users with
unnecessary activities;
* a menu to configure activity types is added. Indeed equipment managers
should be able to see and configure activity types related to their job;
This commit improves fleet contracts management through a better integration
of activities and addition of automated activities. Several things are done
in this commit :
* fleet vehicle log contract does not inherit from mail.activity.mixin.
This commit adds the inherit so that fleet users and managers can now
schedule and manage activities on vehicle contracts. This will help them
in their daily job;
* automatic activities generation is added when contracts are nearly expired
and renewal is required;
* a menu to configure activity types is added. Indeed fleet managers should
be able to see and configure activity types related to their job;
* filters are added to be able to use the systray and to filter the kanban
view based on activities
Having automated activities allow to replace some messages posted on the
contract. Indeed currently there are messages posted on vehicles about
contracts to renew. As we now have automated activities on contracts to
remind assigned people to renew it the log can be safely removed. It will
lessen noise generated on chatter.
Currently there is no place to indicate who is responsible of managing
fleet contracts. As we plan to integrate activities to fleet app having
responsible to push notifications is necessary.
This commit adds a responsible field following Odoo convention, aka a
user_id field linking res.users records. It is also added on the view.
This commit improves sale management through a better integration of
activities and addition of automated activities. Several things are done
in this commit :
* automatic activities generation is added for sale order upselling.
They are also automatically removed or updated when the sale order state
changes from or to upselling to avoid bloating users with unnecessary
activities;
* a menu to configure activity types is added. Indeed HR managers should be
able to see and configure activity types related to their job;
Technically we choose to override _write in order to catch the invoice_status
computed field update and try to have a lightweight implementation. Indeed
sale.order is a complex model and we tried to have a low-level override
that do not mess with business overrides.
This commit improves expense flow management through a better integration
of activities and addition of automated activities. Several things are done
in this commit :
* expense sheet (report) model do not inherit from mail.activity.mixin.
This commit adds the inherit so that expense users and managers can now
schedule and manage activities on expense reports. This will help them
in their daily job;
* automatic activities generation is added for expense reports. Activities
are generated for approval. They are also automatically set as done when
validating or unlinked when refusing or resetting to avoid bloating users
with unnecessary activities;
* a menu to configure activity types is added. Indeed HR managers should be
able to see and configure activity types related to their job;
* filters are added to be able to use the systray and to filter the kanban
view based on activities
Having automated activities allow to replace some messages and tracking
that were implemented to warn people of expense reports to approve.
This commit therefore
* simplifies the tracking as tracking to confirm reports is not necessary
anymore;
* removes to approve subtype on report model as well as its parent subtype
on the department. This allows to simplify chatter in hr_expense app;
This commit improves leave request and allocation management through a
better integration of activities and addition of automated activities.
Several things are done in this commit :
* leave and allocation models do not inherit from mail.activity.mixin.
This commit adds the inherit so that HR users and managers can now
schedule and manage activities on leave and allocation requests. This
will help them in their daily job;
* automatic activities generation is added for leave and allocation.
Activities are generated for approval and second approval. They are also
automatically set as done when validating or unlinked when refusing or
resetting to avoid bloating users with unnecessary activities;
* a menu to configure activity types is added. Indeed HR managers should be
able to see and configure activity types related to their job;
* filters are added to be able to use the systray and to filter the kanban
view based on activities
Having automated activities allow to replace some messages and tracking
that were implemented to warn people of leave and allocation to approve
or validate. This commit therefore
* simplifies the tracking as only approved or refused state now trigger
a subtype;
* removes to approve and to validate subtypes on leave and allocation
model as well as their parent subtypes on the department. This allows
to simplify chatter a lot in hr_holidays app;
Commit a0f4f6548b splitted hr_holidays models and moved them
to different files according to guidelines. However some bits of code related
to views were not correctly put in separate files. This commit finishes to
order views and moves some of them in the right file. Other views or actions
are moved because of dependency between them.
When importing a bank statement containing an unknown bank account
number, the newly created account is automatically linked to the partner
of the current company.
This is due to the default value for `partner_id`.
Introduced in 6db235385a
opw-1816832
In a situation where `_action_done` is called on a batch of move line
when one of them is forced and there isn't enough quantity available
to reserve it, a call to `_free_reservation` is made in order to not
have move lines reserved on quantity now unavailable.
The issue is that the method looks for move line to unlink by making a
search on move line having a quantity reserved. As the `_action_done`
method defer the update of the reserved quantity at the end of the
batch, `_free_reservation` could try to find and unreserve move lines
that were juste processed, resulting in a traceback because there isn't
enough stock to unreserved (because the move line was processed and thus
moved at the next location).
We fix this issue by explicitely passing the move lines to ignore.
This commit adds tools methods related to activities in the mail.activity
mixin. It gives to models inheriting from the activity mixin an easy-to-use
API to schedule, unlink or mark activities as done. Purpose of those methods
is to avoid having people manually managing activities in the code to hide
the technical details of the activities model, notably access rights
or activity types.
A field is added on activity model to indicate they have been generated
automatically. This way when rescheduling or unlinking based on some
specific activity types we do not change user-created activities.
Those methods include scheduling activities, changing their dates, marking
them as done or unlinking them. Future commits will use those methods
in various addons to automatically generate activities based on workflow
we want to implement.
This commit also adds tests for the newly added code. Future commits should
probably have a look at activity security and add some tests cases to check
it is correctly taken into account. It is considered a bit out of scope for
this task.
Thanks to @jem-odoo for its in-depth review of this commit. Well thanks for
other commits also.
If people define several reminders, take first found one based on sequence
as default activity type when creating reminders. This commit is linked to
the recent merge of reminders done at f488dc58c3.
When you create a down payment invoice from an SO, the product that is used in the line is 'Down Payment'.
The description of this product, which is visible for the customer, was not translated to the language
of the customer in the SO and in the invoice. It was translated to the language of the user logged.
This fix is made to keep the same behavior for the description of an SO line and for the description
of the invoice line.
opw:1820081
This commit allows to create personal reminders and to manage them using
activities. It is done using activities not necessarily linked to a record
but only to a user. Reminders can be used for example as a personal todo
list.
Technically we choose to model a reminder as an activity related to no
record. This means having a void res_id and model. An activity type is
added to classify reminders in it.
Settings reminder as done is not done like classic activities. Indeed classic
activities are unlinked and a message is logged on the related document.
As there is no document for reminders those are archived instead. It means
an active field is added as well as an override of toggle_archive to update
systray counter.
Activities systray widget is improved to display reminders in activities
list. This entry leads to a kanban view of activities allowing their
management. It is also possible to create them directly from the systray
allowing a quick creation of reminders.
This commit is related to task ID 41745. Closes#22143 .
Co-authored-by: Dharmang Soni <dpr@odoo.com>
Co-authored-by: Xavier Dollé <xdo@odoo.com>
The ZIP code is an optional field. When saving a payment method, this
generates a traceback since `partner.zip` is `False` while the field
expects a `string`.
opw-1829829
- Create a product A configured as:
Invoice based on: Ordered quantities
Service Tracking: Create a task in a new project
- Create a SO with product A and another product (price != 0)
- Set a 100 % discount on A
- Confirm the SO
- Record 2 timesheet entrieson the created task
- Generate the invoice for the SO
- Validate the invoice
A traceback (zero division) occurs.
The method computing the timesheet revenue ponderates the revenue per
currency by the ratio price on invoice over price on SO line. Since the
price on SO line zero, it fails.
We assume a ratio of 1.0 in this specific case.
opw-1829893
Before this revision:
* Install a module, for this example we'll use `project`
* Create a o2m field or a related field whose inverse is a field from
the `project` module.
* Uninstall the `project` module.
Result -> BOOM! The registry can't be reloaded because it can't find the
inverse field of our custom field, ayayay!!
After this revision, this shouldn't break the registry anymore because
we create two m2o fields which will trigger cascade deletes for both o2m
and related fields upon the deletion of the inverse field, these fields
are both computed stored fields and they're not shown to the end user,
this is all done "under the rug".
Task-ID: 58808
Website Versioning module (website_version) is applied when displaying
views by interfering when doing the "render the view of this `key`" and
showing the view with the same `key` but of the currently displayed
version.
The website.page model when directly rendering a page would directly
specify its `id`, thus website version was bypassed and just the master
page was displayed.
With this commit website.page has a "get_view_identifier" that can be
overrided in website_version and has the same previous behavior
otherwise.
This changeset also solves a conflict (`website().get_current_website`
also modify `request.context`) when modifying the context which also
disabled versions.
opw-1824957
closes#23847
- Set the OS timezone to GMT-6
- Create a project task with a date deadline on D day
- The tasks appears at D-1 in the calendar
This was supposed to be fixed with 0c0fb63b0d, but actually no.
opw-1815446
opw-1828130
When modifying a translatable record, we try to keep close translations
However, we do not need to do it if there is already a translation for
the matched term.
This commit prevent VAT and company name edition if an user has already at
least one document (SO or invoice) for his partner or his related company
partner.
Any module can override this feature to add their own condition to prevent
campany name/VAT edition.
task-33088
Closes#23420