Commit Graph
421 Commits
Author SHA1 Message Date
Mathias Mathy (MAMA) a57b3e9872 [IMP] repair: inventory kanban view repair improvements
1. Add Confirmed and Under Repair section to repair kanban cards.
2. Modify default filters for repair orders.
3. Modify the repair's location_id field's name
4. Following recent changes on stock.picking.type, adapt return option
   creation on repair operation type defined as return.
5. Only return transfers are proposed on the repair orders.
6. Filter product_id selection based on set picking_id and vice-versa

Task : 3369400
Upgrade : odoo/upgrade#5108

closes odoo/odoo#133932

Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-10-04 19:40:09 +00:00
Tiffany Chang (tic) dfdaa9e5fe [FIX] repair: avoid running test without necessary module
Previous fix odoo/odoo#135784 added a test to repair that references
a sale_order_line field that only exists when the sale_margin module is
installed. Unfortunately there isn't already a common module that
requires both repair + sale_margin and runbot doesn't do single module
app tests so this test slipped through the cracks.

To avoid the error when the nightly single module tests occur, we avoid
running the test when sale_margin is installed since it will still run
during standard runbot tests and ensure that the bug doesn't return.

closes odoo/odoo#137490

X-original-commit: 6343e2f3125bb48b01bf5b1ef7be36d86ae35f86
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Tiffany Chang (tic) <tic@odoo.com>
2023-10-04 08:39:20 +00:00
Rémy Voet (ryv) a9dd388a11 [IMP] *: use private _read_group for efficiency/consistency.
Since https://github.com/odoo/odoo/pull/110737, it is better to use
`_read_group` instead of `read_group` in the backend. In fact, the
public method is less efficient (it computes display_name of relational
groupby, extra order, ...) and more verbose.

This commit replaces these new uses of `read_group` with `_read_group`.

closes odoo/odoo#136381

Related: odoo/enterprise#47826
Signed-off-by: Raphael Collet <rco@odoo.com>
2023-09-29 14:48:13 +00:00
Mathias Mathy (MAMA) f63055b772 [FIX] repair: restrict service consumption in Sale Orders
When calling action_repair_done on a Repair Order that has been created
from a Sale Order (which is done by adding a product.template with field
'create_repair' set to True), we should update the delivered quantity of
the product responsible of the creation of the Repair Order if and only
if this product Invoicing Policy is in ['Ordered Quantities',
'Delivered Quantities', 'Prepaid/Fixed Price'].

closes odoo/odoo#136195

X-original-commit: fcbc689dc37cafd5a0cba7b57a2f40ad6acf4e26
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Mathias Mathy (mama) <mama@odoo.com>
2023-09-25 09:38:37 +00:00
snd 4ac541ba9b [FIX] repair: correctly select repair lines
With the removal of the repair.line model, we must now use the stock.move model instead.
The smart button on stock.lot should only show repair orders where the related product is used as a component however it shows all repair orders containing the product.
Now, it will correctly only select repair orders where the product is a component based on the repair_line_type of the stock.move.
Also renamed repair_order_ids and repair_order_count for easier differentiation with new fields.

Part-of: odoo/odoo#129933
2023-09-21 08:59:42 +00:00
snd 7230d53964 [IMP] repair: smarter smart buttons
Added a todo count field on the button where the lot is the product being repaired.
Changed the texts to better fit the buttons.

Part-of: odoo/odoo#129933
2023-09-21 08:59:42 +00:00
Touati Djamel (otd) 406102a329 [FIX] repair: clean default keys from context before creating stock.move
Steps to reproduce the bug:
- Create a storable product “P1”
- Create a Transfer:
    - Operation type: delivery order
    - Product: “P1”
    -  Validate the delivery
- Create a return of the delivery:
    - Confirm and validate the return
    - Create a repair order from the delivery
    - Set the product “P1”
    - Confirm, start and end the repair

Problem: A stock move is created when the repair is completed, but it's
linked to the return picking what is wrong. When a 'repair' order is
created, the 'default_picking_id' is passed into the context to be set
in the 'repair.order'. Consequently, when the repair is completed and
the stock move is created, the context isn't cleared, leading to the
utilization of the 'default_picking_id':
https://github.com/odoo/odoo/blob/5d25900cd88ebc1fd16b0bd6ebba4602a13e9d76/addons/stock/models/stock_move.py#L317

In the button, no context is passed as a parameter:

https://github.com/odoo/odoo/blob/86aa7b78aadee5747c93b4bd27046cfaed1e438d/addons/repair/views/repair_views.xml#L36

opw-3269813

closes odoo/odoo#135939

X-original-commit: 558c647d5c70f7729c663ec3d45fb0cae813db04
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
2023-09-20 07:21:11 +00:00
Djamel Touati 21ee079741 [FIX] repair, sale_*: set cost in SO when creating SO from repair
Steps to reproduce the bug:
- Create a storable product “P1”
    - cost= $100
- Create a repair order:
    - select any product in the product to repair
    - add “P1” as component
    - create the quotation from the repair order

Problem:
The cost is not computed correctly and is set at 0 in the
`sale.order.line`

opw-3502317

closes odoo/odoo#135822

X-original-commit: b95ed3617f465a655c8f918bee8edc673c8f202b
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-09-19 08:48:38 +00:00
Mathias Mathy (MAMA) 167c51b1f9 [IMP] stock{_dropshipping},mrp,repair: remove onchange('code') from stock_picking_type
Legacy code still use 'onchange' on the 'stock.picking.type' field code
to compute the different xxx_location_id.
As it is no more viable, this commit replace all these onchange by
compute methods.
These changes also has a side effect as some already existing compute
methods now get a set of 'stock.picking.type' in input, such that these
methods are also updated to handle this case.

closes odoo/odoo#134650

Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2023-09-15 12:15:14 +00:00
Mathias Mathy (MAMA) adfa9a4fcf [FIX] repair : editable destination locations on picking type
As the `default_remove_location_dest_id` field of the stock.picking.type
model is required, it is intended to be set by the user, and so it
must be editable rather than readonly.
Moreover, for accounting purpose, we want the ability
to modify `default_location_dest_id`.
Finally, we ensure to set a default value on all locations when
selecting 'repair_operation' as code.

closes odoo/odoo#134587

X-original-commit: 7504484ba2ebc93963bc0dec6441e351caee2638
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: Mathias Mathy (mama) <mama@odoo.com>
2023-09-07 10:29:44 +00:00
Tiffany Chang (tic) 8a3a13d821 [FIX] mrp,purchase,repair,stock: cleanup of modifier refactoring
Minor cleanup after odoo/odoo#104741 thanks to edge-cases and the fun
complexity of logistics code. Fixes include:

- removing some readonly=False that were added on computed/stored fields
  that already have an inverse func or were already not readonly (i.e.
  redundant => cleanup)
- fixed visibility of qty to prod in subcontractor portal view of a MO
  (i.e. yay they know how much they're supposed to make again)
- remove unused imports
- adding back in readonly functionality of default dest of repair
  operation type (and removing the now useless field override that used
  to add in the readonly functionality)
- adding back in the `_set_product_qty` inverse function since it was
  probably removed by mistake (and is still important to have)

unrelated to viewpocolypse change, also fixed:
- mobile view of PO was for some reason allowing products to be changed
  in already confirmed/done POs, which could lead to some inconsistent
  data => made this consistent with existing desktop view behavior

closes odoo/odoo#133502

Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2023-08-29 14:09:53 +00:00
abd-msyukyu-odoo 44b53f6de3 [IMP] *: add name to Form notebook pages to be used in Knowledge
Knowledge macros rely on the `name` attribute of a notebook page to switch
between tabs in a Form notebook. That attribute is not mandatory, so some views
with a valid `html_field` did not have one. This commit adds the `name`
attribute so those fields can now be manipulated by Knowledge macros.

See `searchInXmlDocNotebookTab` in `abstract_macro.js` for more details about
the usage of the `name` attribute in Knowledge macros.

task-3410128

closes odoo/odoo#132824

Related: odoo/enterprise#46146
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-08-24 18:37:51 +02:00
niyasraphy 8cd9db0923 [IMP] calendar, repair: move action from root menu to new menu
before this commit, the repair orders is directly
linked with the root menu of repair application and if you user opens the repair app, repair orders
action is shown as it is linked with the main menu.

similarly in the calendar app, the calendar is linked
with the root menu calendar.

but now if user move to reporting or configuration menu of repair app, there is no menu to access the repair orders.

with the new milk redesign on clicking the root menu user will be taken to home screen, where us there is hamburger menu in previous design to navigate to home screen.

so only way for user to access the repair order menu is to go back to home screen and come back.

similarly in the calendar app, if user takes the
configuration menu, in order to access the calendar, user
has to go to home screen and come back.

after this commit, a new sub menu is introduced in both
app and moved the action linked with root menu to
the newly added sub menu.

closes odoo/odoo#126329

Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-08-23 10:03:25 +02:00
Raphael Collet 5b146bdeca [FIX] repair: split the computation of some fields on repair.order
This fix splits the compute method of fields location_id,
location_dest_id, parts_location_id, recycle_location_id.  This enables
to independently compute those fields at record creation when some of
them have a default value.

closes odoo/odoo#124614

Signed-off-by: Raphael Collet <rco@odoo.com>
2023-08-18 19:16:51 +02:00
Gorash 774a3fad0e [REF] base,all: Update modifier syntax: view migration
Apply of the migration script to update all view modifiers.

Part-of: odoo/odoo#104741
2023-08-18 09:49:13 +02:00
Gorash 75a105f46a [REF] base/all: Update modifier syntax: remove 'states' from fields
These changes are made as a result of simplifying attrs and 'states' in
views. However, they should have remained in a separate commit. When
applying the script making the xml changes (used later for the migration
script), the script checked the definition of the python fields in order
to convert the information into a python expression. Therefore, this
commit is not applied when the script is applied to xml changes.

During this attribute deletion pre-existing errors were found. Part of
the code was using the boolean values of 'states' and another part of
the code was not. The behavior could therefore be different (in cases
where readonly on the field had the same value as the ballan in
'states').

Following the deletion of 'states' and without the application of the
view migration, the js tests (tower) were no longer functional. Tests
using the Form view suffered the same effect. There are few tests that
had to be adapted, including two tests in business accounting (updated
by the accounting team). A test for column_invisible did not work. Test
checking if the test system triggers an error if we try to write on an
invisible field. It turns out that Form was testing on the value of
invisible but not taking into account if the column was invisible. The
test system fix is applied separately because there were a lot of tests
that were incorrect.

Part-of: odoo/odoo#104741
2023-08-18 09:49:11 +02:00
Gorash 5419d0ef7a [REF] base,all: Update modifier syntax: clean fields keys
Part-of: odoo/odoo#104741
2023-08-18 09:49:10 +02:00
Tiffany Chang (tic) 33cc629001 [FIX] mrp,repair,stock{_dropshipping}: correct show_operations visible
PR #106911 added the new picking.type for repair and hide the
`show_operations` field from its form view. Unfortunately this writes
over the existing invisible attr for mrp_operation (depending on the
order of module installation, otherwise mrp will do the same to repair).
Therefore we update the attribute logic to only include the picking
types that should have the field visible (incoming, outgoing, internal,
and dropship).

closes odoo/odoo#132012

X-original-commit: 1688a8d82ce7aec32f17fc8c35295cccbb682dd6
Signed-off-by: Steve Van Essche <svs@odoo.com>
Signed-off-by: Tiffany Chang (tic) <tic@odoo.com>
2023-08-16 17:47:27 +02:00
Louis Wicket (wil) 7da30c7d14 [FIX] mail, *: fix grammar error in field help
This commit fixes a really old grammar error in the help message of the
message_needaction_counter field.

Before this commit: “Number of messages which requires an action”
After: “Number of messages requiring action”

The subject of “require” is “messages”, which is third-person plural, so
it can't take the -s suffix.

closes odoo/odoo#129468

X-original-commit: 0d10cfeaa56d5df23df05f436d353978043f4a71
Related: odoo/enterprise#44509
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-07-25 17:36:08 +02:00
Mathias Mathy (MAMA) eaa6e1a08c [REF] repair, *_repair: Separate Repair from Sales/Invoicing scopes
Main changes include :
 - Separate Repair and Sales/Invoicing functionalities
 - Possible binding between a Sale Order and many Repair Orders
 - Specific 'repair.line' model is now replaced by a 'stock.move' inheritance
 - Added a new 'Repairs' Operation Type to warehouse(s)

Task : 3046560

Enterprise : odoo/enterprise#36088
Upgrade : odoo/upgrade#4391

closes odoo/odoo#106911

Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2023-07-20 17:01:00 +02:00
william-andre 0479b2b594 [IMP] account,*: manage subsidiary companies
Allow sharing records between company
* accounts
* taxes
* fiscal positions
* products
* ...and some related models

These records can be read and used in children companies.

This can be used to
* have different branding for different businesses
* allow more complex security rules
* consolidate branches differently
* manage different tax reports with different tax ids in the same
  country

task-3371677

closes odoo/odoo#125642

Related: odoo/enterprise#43215
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
2023-07-20 11:49:06 +02:00
Julien Carion (juca) 6c412be2ea [IMP] *: coherent hotkey uses
This commit makes hotkey uses more coherent throughout the entire
codebase by setting alt+q as main shortcurt for confirm and default
actions and alt+x for cancel actions.

task-3370463

closes odoo/odoo#127469

Related: odoo/enterprise#43694
Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
2023-07-19 18:24:15 +02:00
Mahdi Cheikh Rouhou (macr) 699ba2d782 [FIX] repair : send email to author when included
When we include the author in the recipients of the quotation email of a repair order he doesn't receive the email.

Steps to reproduce the error :
1- create a repiar order
2- add the author in the list of recipients
3- send the email

The origin of the problem is that mail_notify_author=False , se we need to add it as True when we have the author in the recipients.

Similar old fix : https://github.com/odoo/odoo/commit/f49dbf595c870b682f36c11443c9cf1a9a027474

opw-3295744

closes odoo/odoo#126986

X-original-commit: d4d48526867e93295d93d4504e824cfdc2b146a7
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Mahdi Cheikh Rouhou (macr) <macr@odoo.com>
2023-06-30 20:13:43 +02:00
Pieter Claeys (clpi) ccb41edf2b [IMP] stock: better returns
Improve the returns process by adding the following improvements:
- Removal of the 'return' operations type. Returns of deliveries now
become receipts.
- Update of the `stock_picking_return` wizard by removing the onchange
on picking_id.
- Show returns in the sale portal, with a new 'return label' PDF report
- Enable returns for multi-step receipts on purchases

Community PR: https://github.com/odoo/odoo/pull/118568
Enterprise PR: https://github.com/odoo/enterprise/pull/39761

closes odoo/odoo#118568

Task: 3081370
Related: odoo/upgrade#4660
Related: odoo/enterprise#39761
Signed-off-by: Tiffany Chang <tic@odoo.com>
2023-06-23 18:00:05 +02:00
snd c57f9efe83 [IMP] stock, stock_repair: various features
add the following features:
- add location in form , kanban and list view. Change location creates move
- add smart button for repairs
- add next activity widget in list and kanban
- from the lots/SN smartbutton on the product form, open the kanban view
- show the last delivery partner on serial

closes odoo/odoo#117316

Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2023-06-09 13:49:40 +02:00
Martin Trigaux 2afdda2576 [I18N] *: export saas-16.3 source terms
closes odoo/odoo#123046

X-original-commit: 137f5ca0cb703ee953cb01db525362f7a778e6bd
Related: odoo/enterprise#41703
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-06-01 11:43:51 +02:00
Louis Wicket (wil) 04189318cc [I18N] *: update master translations
Currently, only stable releases see their translations updated. This has
resulted in master accumulating outdated stuff for years, which can be
confusing for users testing master on runbot.

This one-shot commit resynchronizes master translations based on the
content from 16.0 and removes empty PO files (i.e. no longer containing
translations).

closes odoo/odoo#121629

Related: odoo/enterprise#41171
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-05-22 17:52:07 +02:00
Brieuc-brd fa60bac197 [IMP] *: app icons : add viewBox attribute
Prior to this commit, the SVG's viewBox attribute was missing, which
prevented svgs from being scaled.

This commit fixes this issue.

task-3326633
Part of task-3326263

X-original-commit: 30300c373ad1c63a6cf8b035cae0785a09c6933f
Part-of: odoo/odoo#121886
2023-05-22 13:54:08 +02:00
Brieuc-brd ee75969979 [IMP] *: app icons: replace svg to png
The introduction of Milk has brought new app icons.
Using the svg format creates a lack of anti-aliasing on the edges of the
shapes, which makes the icons look bad.
Since the png size has been reduced, we can afford to use the png format
to have the best possible quality without having a lack of performance.

task-3326633
Part of task-3326263

X-original-commit: e07cb722f2b11407a3ad093bd688b7d37afd5a88
Part-of: odoo/odoo#121886
2023-05-22 13:54:07 +02:00
Martin Trigaux 077bbd0b0b [I18N] *: export master source terms
closes odoo/odoo#121563

Related: odoo/enterprise#41140
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-05-17 10:34:00 +02:00
Elisabeth Dickinson 45b9e04db4 [IMP] *: status buttons fix
Part-of: odoo/odoo#116641
2023-05-12 22:59:23 +02:00
Brieuc-brdandElisabeth Dickinson 21d87a3da5 [REF] *: milk graphical assets
- apps icons
- base: replace demo avatars Mitchell, Marc and Joel
- mail: replace odoobot avatar

Part-of: odoo/odoo#116641
Co-authored-by: Elisabeth Dickinson <edi@odoo.com>
2023-05-12 22:59:14 +02:00
niyasraphy fd9a4c2101 [FIX] repair: hide cancel button in done state
Before this commit, the cancel button is visible in the done state and
on clicking showing the validation that it cannot be cancelled.

by the commit:
https://github.com/odoo/odoo/commit/8d37cf462badc25d911d3fa6d3382c6f7418904f
one of the cancel button in the form is made hidden in the done state,
similarly applying for the other cancel button also.

also currently on trying to delete a done repair order, it says to
cancel first and then delete the order, from the commit:
https://github.com/odoo/odoo/commit/8d37cf462badc25d911d3fa6d3382c6f7418904f
cancelling a done record is prevented, thus modifying the warning
message and its related pot file

After this commit, the cancel button will not be visible in the done
state.

closes odoo/odoo#118726

X-original-commit: 981f804ff507f693a395bb1146a33eb5f06d84a3
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-04-18 09:24:33 +02:00
Louis Wicket (wil) 0c53d28133 [IMP] *: remove "French spacing"
According to Wiktionary, French spacing is "the archaic practice (though
still current in French) of inserting a space around colons, semicolons,
question marks, and exclamation marks". This is not standard practice in
English and most languages of the world.

The purpose of this commit is to start purging the code from this typo,
as it may reflect poorly on the software for some people.

closes odoo/odoo#116167

Related: odoo/enterprise#38542
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-03-24 12:50:13 +01:00
Martin Trigaux 1be5eae8ef [I18N] *: remove nl_BE files
They dates from < 2027 and are quite outdated. Favour the nl
translation instead.
n_BE is not on Transifex so it was not possible to correct bad
translations.

closes odoo/odoo#115845

X-original-commit: d04c8b7e484db8306d858c891a7a2b11885fdcd9
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-03-20 16:51:30 +01:00
Victor Feyens 24ccf7d9b0 [CLN] *: useless type info for actions
The type fields of actions already defaults to
the model name in the base model definition.

Therefore, specifying `ir.actions.server`, `ir.actions.act_window`
& so on as type is useless (and adds noise since it's the same as
the action model).

closes odoo/odoo#114539

Related: odoo/enterprise#37855
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
2023-03-08 17:33:37 +01:00
niyasraphy c6359dc342 [FIX] repair: display description of tax in repair report
before this commit, even if the tax description is set in the tax, in the repair report it always displays the tax name.

after this commit, as in the sales, purchase and invoice reports, if tax description is set, repair order will display the tax description in the report.

closes odoo/odoo#114670

X-original-commit: e9ba4ae9608f6139d3fb1633d0e3287cb7348cb7
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-03-08 13:49:11 +01:00
maximilien(malb) ee2c82700e [IMP] account,sale,repair,website,purchase: remove setting and display correction
Before this commit, the accounting module had a setting on the selection of taxes used by the sales, purchase, website_sale, ... modules. In addition, the website_sale module had the same setting related to the accounting one.
This PR isolates the tax selection parameter in the website_sale module, and instead of using the tax selection, the accounting module will use rounding method (round per line, round globally).
Selecting one of the two will change the display of all account_move or other view using the tax selection setting.

Display changes:
In round per line, a column tax excluded will always be displayed while a column tax included will be in optional hide.
On the other hand, in the round globally, only the tax excluded columns will be available.

closes odoo/odoo#99209

Task-id: 2954332
Related: odoo/upgrade#3826
Related: odoo/enterprise#30853
Signed-off-by: William André (wan) <wan@odoo.com>
2023-03-02 19:24:45 +01:00
wan 5125748616 [REF] account: remove chart template
Rewrite the whole chart template mechanism, removing the templates
stored in the database. The new format will mainly use CSV.

Speed up install time
---------------------

* About half of the time of installing a localization for the first time is
  taken by creating the template records. This new in code format gets
  completely rid of this.
* Creating the template records could often not be done in batch because
  of parent/children relations.
* The instanciation of the accounts on the company has been entirely
  reworked too, by
  - optimizing the order of creation of records to avoid UPDATE queries
  - using precomputed fields to avoid UPDATE queries
  - updating the translation in batch
  - deactivating logging in the chatter
  - avoiding access rights checks by checking the rights at the start

Overall, when installing a chart template for the first time, it is 4
times faster because half of the time spent on saving the template in
the database is not done at all anymore, and the instanciation on the
company is more than twice as fast.

Reduce technical debt
---------------------

There is no need to synchronize the templates with the real records
anymore. No need to use hooks to copy the data from one to the other.

It is easier to change a template in a stable version, which can often
be necessary due to legal reasons (i.e. a change of tax rates, reporting
tags,...)

Two modules have been removed:
* `l10n_generic_coa`: since there is nothing left datawise in this
  module, it can be integrated in `account` for free. It is just code
  and CSV.
* `l10n_multilang`: the fields that this module modified to be
  translatable are now always translatable:
  - there was an issue when updating modules that deleted all the
    translations because the fields were not translatable at some point
    during the loading of the registry, then they because translatable
    again but lost all translations because of the column type change.
  - most devs are not able to understand all the languages needed for
    all the localization available. Therefore, english has been added in
    the sources in most localization to understand better issues while
    debugging.
  - no need to call post init hooks anymore, doing the sync with the
    templates.
  - more: see "Translations" section

Because most of the data is now in CSV, it is also easier for product
owners to edit, audit, modify files themselves, removing one layer
during trivial development processes when only data should be changed.

More flexibility for declaration
--------------------------------

The data declaration can now be done easily in python or CSV.
A nice feature is that you can declare everything at once, even for some
more complex chart of accounts:
* if you have to set default taxes on accounts, would need to
  - declare the accounts because accounts are required on the taxes
  - declare the taxes
  - declare the taxes to put on the accounts
  This would lead to scatter information in multiple files. Now,
  everything can be declared in the same place and the loading of the
  chart of accounts will do the 3 steps automatically.
* if you have a relation of child/parent, you would first need to
  declare the parents then the children, and the loading would not be
  efficient because done one by one. Now, everything is done in batch
  automatically without having to think about it.

It is also easier to update fields on records where there was no field
for that on the templates, like
* setting a restriction for journals on accounts
* setting specific values on the company
* modifying journals and linking them easily by using the xml_id instead
  of having to compute it manually

Translations
------------

Some countries have multiple languages (i.e. Belgium uses officially
French, Dutch and German, and the CoA also has an official English
version) and we must support the languages in all these countries.
All these translations are known, and hard coded without using out
translation platform (Transifex). We also like to have the English
version (even if an official one doesn't exist) so that support can be
done more easily in databases using chart templates in other languages
(especially using a non roman alphabet).

Because the translations were not on Transifex for these records, it was
really hard to maintain: the translation templates (`.pot` files) were
not easy to extract as the automatic export would give values mixing
both the CoA and the menuitmes, the fields' strings,... But we don't
want to translate the CoA as we already know the value.
Managing the translations in the `.po` files was also annoying:
- it is easy to forget that the translations need an update too
- it requires a special editor, special terminal commands that everyone
  is not familiar with
- it is easy to make mistakes in the source string

The new format is the following: `field@en_US` where `field` is the
translatable field (usually `name`) and `en_US` is the locale code.
This allows to have the whole declaration on one line, everything in one
file. It also makes the process easier when debugging: instead of
searching for the translation in the `.po` files, it directly appears
next to the configuration of the account/tax/... .

Update of the code
------------------

The code can be updated using this script
https://github.com/william-andre/transform_coa
Forward ports can be managed too by stashing/resetting/checkout the new
modules or the changes in the modules updated in the same PR.

task-2687567

Part-of: odoo/odoo#110016
2023-02-17 19:30:40 +01:00
Touati Djamel (otd) c1eed37f12 [FIX] repair: prevent cancelling a completed repair order
Steps to reproduce the bug:
- Create a repair:
    - Add any product to repair
    - Add any other product as part of the repair
    - Confirm the repair
    - Start the repair
    - End repair

Problem:
The cancel button becomes visible and clicking on it won't cancel the
moves, so it doesn't make sense to cancel a finished repair.

opw-3146606

closes odoo/odoo#112191

X-original-commit: f8c489b7484c054a7b870b22cf610b615bab2cc8
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-02-08 14:30:53 +01:00
Martin Trigaux 776689b0f4 [I18N] *: export saas-16.1 source terms
closes odoo/odoo#110752

X-original-commit: 56b2b52287a8f2192d80ea417c7efac80a87c0a9
Related: odoo/enterprise#36173
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-01-24 10:20:30 +01:00
Demesmaeker 83c52575d0 [REF] product,repair,(*_)sale(_*): unrequired pricelist
Removes the constraint of using a pricelist and makes all sales flows
rely on the currency of the sale order (or repair order)

task-2735672

closes odoo/odoo#84920

Related: odoo/enterprise#24716
Related: odoo/upgrade#3642
Signed-off-by: Morgane Demesmaeker <edm@odoo.com>
2023-01-18 21:08:52 +01:00
Thibault Delavallée 28b4ba4049 [IMP] mail, various: allow to link multiple reports to templates
RATIONALE

Improve usage of composer in comment or email mode: support batch-posting in
comment, support more configuration from templates, improve global model.

SPECIFICATIONS

Update report_template field on template model to be a many2many field instead
of a many2one. It allows to attach multiple dynamic reports to a given template
instead of being limited to a single one.

Name should now come from the report itself, which should be considered as
complete by itself. Template cannot override report naming anymore.

Task-2868153 (Mail: Allow multi reports in mail templates)

Part-of: odoo/odoo#99482
2023-01-17 20:58:40 +01:00
Thibault Delavallée 1a1acabd7b [REF] mail: cleanup mono/multi record composer behavior
RATIONALE

Improve usage of composer in comment or email mode: support batch-posting in
comment, support more configuration from templates, improve global model.

SPECIFICATIONS

Support a real res_ids field on mail.compose.message model. Instead of relying
on active_ids from context, store it once for all at composer level and use
it in code. Active_ids usage is still done at default_get level, using it to
populate the field.

Improve usage of domain, renamed to res_domain to match other document related
fields naming. Add support of a res_domain_user_id field allowing to set the
user from which the domain should be evaluated.

Composer now runs on a list of IDs. Mass mail mode and comment mode are now
distinct from running on a singleton or on more records. Rendered or raw
mode is not triggered by

  * mass mailing mode: always display raw mode, whatever the number of records;
  * comment mode: display rendered mode when having a single record (like the
    previous comment mode). Display raw mode when having either no records
    either at least two records.

Task-3035101 (Mail: Support batch-posting from composer)

Part-of: odoo/odoo#99482
2023-01-17 20:58:39 +01:00
niyasraphy f61201fc76 [FIX] repair: show uom only when multi uom is activated
before this commit in the repair orders tree view, the unit of measure field is shown always without respecting the multi uom feature.

after this commit, the field will be shown only once the uom feature is activated in the settings.

closes odoo/odoo#109252

X-original-commit: 0796f8ee68c74e10b8f72531b64932e52b86cbef
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-01-06 12:29:43 +01:00
niyasraphy f9ec85614b [FIX] repair, sale, stock: translatable string and typo
currently the returned warning from the sale, stock and repair apps are not translatable to user languages.

this pr makes the string's translatable and correct the grammer of the warning.

closes odoo/odoo#108379

X-original-commit: 217115e68d117d7cf1eeb94794118819d6082547
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-12-22 12:45:48 +01:00
Jigar Vaghela 82c1443254 [IMP] mrp,mrp_*,repair: MRP back to basics 6
mrp
===
- no time has been recorded on operations then give warning with apply button

- do not allow to mass edit UOM in any manufacturing state

- set value of lot/serial from MO and set read only on unbuild from MO

- remove "archive operation" icon

repair
======
Currently it is not possible to select a return on a repair order unless save it first. so after this commit user can able to select it without save it.
only show picking related to selected product

closes odoo/odoo#106571

Task: 2845380
X-original-commit: dd60647ce41547ecd00bbde45ddf564a7ada91c7
Related: odoo/enterprise#34403
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2022-11-25 18:55:35 +01:00
Tiffany Chang (tic) 5b9c93ef04 [FIX] repair: handle uom without view exposure
Previous fix
https://github.com/odoo/odoo/commit/72dff43a4da277b002966f5fd4045b7f9a3855ad
re-exposed uoms in the view even if the setting is not active, but we
prefer to avoid this if possible. In order to do this we ensure that the
uom is set even if it is not visible in the view. Most of these are
already handled by compute methods, but except for `repair.fee` so we
only add in a guarantee for that model.

Note that the write case is included in cases when:
- the uoms were previously activated and set => deactivated again
- demo data has different uoms set and uoms setting is not active

X-original-commit: 7e64ebb3d8d3f3d3749304a325eb073777b129dc
Part-of: odoo/odoo#104900
2022-11-17 11:58:50 +01:00
niyasraphy 12b2aaeb57 [FIX] repair: total field label alignment
closes odoo/odoo#105145

X-original-commit: c5e910e9513a78b2b577c556080689c37a7fd40a
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2022-11-08 10:40:07 +01:00
Tiffany Chang (tic) ec63d36a77 [FIX] repair: include mandatory group dependent uom field
The group unification done by https://github.com/odoo/odoo/pull/95729
missed adding the often mandatory `product_uom` into some views when
`uom.group_uom` is False. This is the case for repair and blocks the
user from saving its form view in this case.

X-original-commit: 72dff43a4da277b002966f5fd4045b7f9a3855ad
Part-of: odoo/odoo#104067
2022-10-25 16:12:04 +02:00