Commit Graph
100 Commits
Author SHA1 Message Date
Nicolas Viseur (vin) 68f706bcd0 [FIX] account: credit limit inverse
While in practice you would never get this inverse
called with more than one record at a time, it is
still wrong to get the company of self in the loop.
Fixing it to keep good conscience :)

closes odoo/odoo#161979

X-original-commit: 56fe4f71f0cca2ca11624bd267e1dec4de2ac929
Signed-off-by: de Wouters de Bouchout Jean-Benoît (jbw) <jbw@odoo.com>
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
2024-04-16 00:41:54 +00:00
Nicolas Viseur (vin) 7b4624b078 [ADD] l10n_my_ubl_pint: Malaysian Peppol PINT specialization
Add support for the Malaysian Peppol PINT specialization,
allowing to generate the related XML file.

This also adds a few additional features that are in the
specifications:

- SST registration number, needed in the xml and on the
invoice.
- TTx registration number, needed on the invoice.

Both numbers are optional, but if the business is registered
in any of them they are required to display these on the
invoices and they are required to enforce some rules. (cannot
send taxes that are not 0% "Out of scope" if not registered with
SST, ..)

Task id # 3647922

closes odoo/odoo#159407

Signed-off-by: Julien Van Roy (juvr) <juvr@odoo.com>
2024-04-10 11:45:53 +00:00
Nicolas Viseur (vin) 829058b5a0 [FIX] l10n_id_efaktur: used partner.
At the moment, the partner being used to get the information
for the efaktur module is the partner set on the invoice.

This is wrong, since if the partner set on the invoice is a
child record of a company partner you cannot set most of these
fields.

To fix this issue, we will update in order to fetch the efaktur
related fields from the commercial partner instead. (vat, along
with all efaktur specific information used in the process)

closes odoo/odoo#160267

X-original-commit: 108a87407b7c46cc1682d93524398a968b025441
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
2024-04-06 07:27:58 +00:00
Nicolas Viseur (vin) b104a50d6d [FIX] account_qr_code_emv: fallback error
The account_qr_code_emv module has an issue at the
moment where it will only return errors in
_get_error_messages_for_qr for the country the qr
code is intended for.

This makes sense since you want to check all countries
in later versions where we have multiple of them.

But it causes an issue with the standard implementation
where if you are using a country that is not supported
by an EMV QR, _get_error_messages_for_qr will just
return None.

This means that:
    - The default QR CODE selection on the invoice that
    depends on that may select EMV QR for unrelated
    countries.
    - If it gets selected, this method will not check
    that the currency is correct for said countries.

To fix this issue, we will simply return an error
message in the common module, which will serve as a
fallback once all the EMV QR methods have been checked.

Task id # 3758668

closes odoo/odoo#156847

X-original-commit: 5290fb7a2d400ce1c9732e8d835f6b7990c0d145
Signed-off-by: de Wouters de Bouchout Jean-Benoît (jbw) <jbw@odoo.com>
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
2024-03-07 05:07:08 +00:00
Nicolas Viseur (vin) d387f3d0d5 [IMP] l10n_nz: onboarding improvement
This tasks aims to improve the out-of-the-box configuration of the NZ
localization by updating some tax groups, taxes, accounts and default
COA settings.

Task ids 3647518 & 3647460

closes odoo/odoo#154541

Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
2024-03-06 14:30:37 +00:00
Nicolas Viseur (vin) 9e6afbd114 [ADD] Starshipit as a delivery provider
Starshipit is the leading provider of integrated
and automated fulfilment solutions for online businesses
integrating with the main carriers used in Australia and
New Zealand, such as Australia Post, DHL, Aramex, CouriersPlease and more

This PR will add support to integrate with starshipit directly in Odoo,
providing rates and shipping for users who need it.

Task ID # 3041982

closes odoo/odoo#135839

Related: odoo/enterprise#47569
Related: odoo/documentation#7798
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2024-02-27 17:40:49 +00:00
Nicolas Viseur (vin) 65617bd7ea [IMP] l10n_my: SST tax update
As of the first of March 2024, the SST tax
will increase from 6% to 8%.
To that end, the current 6% tax will be set
to inactive by default, and we will add
a new 8% service tax to replace it.

Task id # 3748127

closes odoo/odoo#154966

X-original-commit: 772d16bc6da7a696681805be42ca48e8cfd13db2
Signed-off-by: Cedric Snauwaert <csn@odoo.com>
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
2024-02-22 09:06:12 +00:00
Nicolas Viseur (vin) 4a8b6ca62e [ADD] l10n_ph: tax_report
Adds the tax report, associated tax grids along with new taxes,
required in order to generate a tax report as well as a SLS/P report

Task id # 3211351 and 3468278

closes odoo/odoo#150619

Related: odoo/enterprise#54908
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
2024-01-26 09:13:03 +00:00
Nicolas Viseur (vin) 0707637924 [FIX] l10n_id_efaktur: default kode transaksi
Kode transaksi is a required field on account moves.
This field is either set on the move itself, or is
taken from the partner.

It NEEDS to be set when invoicing, but customers
cannot provide this values by themselves when
registering for example. This would cause issues
with automatic subscriptions amongst other systems.

In order to fix this issue, we will define the code 01
as default value.

closes odoo/odoo#151265

X-original-commit: 846f7cc9a7dbec4f9c6631ae2ccd484f9af47dd8
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
2024-01-26 01:17:57 +00:00
Nicolas Viseur (vin) 74d7ad5185 [IMP] l10n_au: Update 100% EX Taxes
The computation of such taxes were wrong, thus we
update the tax template to correct the computation
and the tax tags.

Task id # 3645628

closes odoo/odoo#149978

X-original-commit: 4fb468be5b40a4eb426dee293526ef48eb826e15
Signed-off-by: John Laterre (jol) <jol@odoo.com>
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
2024-01-20 02:42:58 +00:00
Nicolas Viseur (vin) 1c8a0824da [FIX] base_vat: ID vat validation
Recently, the vat validation was changed to
support 16 digits vat introduced in Indonesia
in January 2024.
This change replaced the stdnum validation,
but did not handle vat numbers written using
the standard presentation format.

This is fixed here, where we will remove the
characters used in this format and strip the
vat before doing the validation on the digit
amount.

closes odoo/odoo#148386

X-original-commit: 4c8629228f7842501d5a067451abca24d1089bf9
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
2024-01-07 02:52:21 +00:00
Nicolas Viseur (vin) cfa987933c [FIX] account: trusted account lock
Fix a small issue with the trusted account lock system, where we would raise an error
when you change the partner or account number on a record at the same time as you untrust it.

Before this fix it would be blocked, and you would need to untrust, save, and then redo the
change in a second edition for it to work.

At the same time, we will allow the process to untrust an account and change values at the
same time.

Task id #3647635

closes odoo/odoo#147089

X-original-commit: 3815ccea98c95130a770772aa29c87112e695914
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
2023-12-22 02:53:07 +00:00
Nicolas Viseur (vin) 61fbd95e6d [IMP] l10n_id_efaktur: add translations
In an effort to make the module more accessible
in its target country, add translations to the
module. This mostly concerns error messages.

Task id # 3570055

closes odoo/odoo#145116

X-original-commit: 8b504af3226ed1e2581e19736a7f7675aa7a30ee
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
2023-12-06 02:26:19 +00:00
Nicolas Viseur (vin) 33e837d429 [FIX] account_payment: Better uninstallation
Improve the uninstallation of payment providers by allowing to
uninstall payment providers which have a payment method line on
a journal but no payment yet.

Task id #3595006

closes odoo/odoo#142112

Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
2023-11-27 08:39:47 +00:00
Nicolas Viseur (vin) 5c4868e126 [IMP] l10n_jp: tax group name update
Update the japanese tax group template names to
better fit the needs.

Task id #3315696

closes odoo/odoo#143091

X-original-commit: 580495a53cf61bd57c609856b48772c6b5c9fe25
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
2023-11-22 03:24:33 +00:00
Nicolas Viseur (vin) 31566dfe29 [IMP] l10n_my: add tax report
Adds the SST-02 tax report to the Malaysian
localisation

Task id # 2868179

closes odoo/odoo#140030

Signed-off-by: de Wouters de Bouchout Jean-Benoît (jbw) <jbw@odoo.com>
2023-11-13 07:26:00 +00:00
Nicolas Viseur (vin) f3a2ba5e7e [IMP] account: AU Remittance Advice
On top of the change in the template done in
https://github.com/odoo/odoo/commit/5dc625fada8ac07ba419f60a7d416210d7b1cb89

This will change the Payment Receipt string when
using the en_au language in order to also display
that this will print a remittance advice.

Task id #3465257

closes odoo/odoo#141144

Signed-off-by: John Laterre (jol) <jol@odoo.com>
2023-11-07 19:32:24 +00:00
Nicolas Viseur (vin) 5dc625fada [IMP] l10n_au: Remittance Advice
In AU, it is customary to name proof of payments document
with different headers if the partner is a customer or a
supplier.

If the partner is a customer, the current "Payment Receipt"
is expected.
If the partner is a supplier, "Remittance Advice" is expected.

This change will bring this to the payment receipt report
if:
- the australian localisation is installed
- either the company or the partner are from Australia

Task id # 3465257

closes odoo/odoo#139543

Signed-off-by: Laurent Smet (las) <las@odoo.com>
2023-10-26 08:45:57 +00:00
Nicolas Viseur (vin) 451f4cea3e [IMP] l10n_id_efaktur: do not consume numbers if no taxes
At the moment, the efaktur system will consume a number even
for invoices not using any taxes.
This change will try to avoid that by not consuming numbers
for invoices when no lines has a tax_ids set.

task id #3130665

closes odoo/odoo#139757

X-original-commit: 59c434773c17f81d3a1c160407e8b4533f48e911
Signed-off-by: William André (wan) <wan@odoo.com>
2023-10-25 20:56:15 +00:00
Nicolas Viseur (vin) 67b52999f2 [IMP] account_edi_ubl_cii: update eas list
Update the eas list in preparation for the Peppol PINT format
that will come to 17 in the near™ future

closes odoo/odoo#139005

Signed-off-by: Laurent Smet (las) <las@odoo.com>
2023-10-18 13:39:14 +00:00
Nicolas Viseur (vin) dfd59627d2 [FIX] account: position of tax edit pencil on bills
The commit https://github.com/odoo/odoo/pull/128376 fixed an issue related to rtl languages,
but at the cost of the pencil position.
By making the span containing the value a display: block the pencil could no longer be placed
on the side of the value and was instead pushed on top.

This small fix will just place the pencil inside the span, in order to get it back aside the amount.

Task id # 3548687

closes odoo/odoo#138408

X-original-commit: 718fe9396aebec1c0a15c5064202f6350cdf346a
Signed-off-by: William André (wan) <wan@odoo.com>
2023-10-11 18:03:31 +00:00
Nicolas Viseur (vin) a1d670ca30 [FIX] l10n_id_efaktur: rounding improvement
The efaktur export has rounding issues due to the fact that
we need to display both the amount_untaxed and amount_tax rounded to 0 decimals
as well as the detail of each line.

As the rounding of the sum will most of the time be different to the sum of rounded
lines, the government website refuse the resulting file.

This fix will try to improve things a bit by:

- Avoiding to round the values while we are still manipulating them.
- Round the values once when the initial computation is done for the lines.

Once all lines have been computed, we will:

- Find the difference, if any, between the rounded amount_untaxed and amount_tax
and the line totals and round that too.
- Update the first line with enough value in the result with that value in order to correct the total
- Finally, round the values for representation to two decimals.

If we cannot correct it in a single line, the correction is split in multiple lines.

Hopefully, these steps will help ensure that the sum of the lines will be equal to the
rounded values of the amount_untaxed and amount_tax and thus be correct.

Task id # 3420220

closes odoo/odoo#136996

X-original-commit: 65e7446ffad5c87ec44f1012e709606b44f3af39
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2023-09-29 01:02:06 +00:00
Nicolas Viseur (vin) e575b66114 [FIX] l10n_sg: demo company vat number
The demo company vat number would fail the check in base_vat
and thus always cause the demo company to not be added when
installing l10n_sg.
So we replace it with a number that passes the check to ease
testing and avoid throwing errors in the face of our users if
they want to try that localisation.

Task id #3366323

closes odoo/odoo#124948

X-original-commit: c5bc8673b661e3ab6c17d6988e56a014a5b915cf
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
2023-06-14 04:46:54 +02:00
Nicolas Viseur (vin) 12473cb0c0 [IMP] l10n_au: The opening statement should be dated to the 30th of june
Since the fiscal-year end this day.

Task id #3338971

closes odoo/odoo#124607

X-original-commit: c2640430874771d7db9cd587e7a9a04a01f7ae42
Related: odoo/enterprise#42349
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
2023-06-12 12:41:52 +02:00
Nicolas (vin) ba6ff1b616 [FIX] account: res partner bank bugprovement
Improve some aspects of the recent res partner bank improvement:
    - the url toward the docs open in a new tab
    - fix the account creation by disabling the readonly when trusted
      while the record isn't existing in the database yet
    - improve the visual of the setting by putting it in the accounting
      section

closes odoo/odoo#120423

Signed-off-by: Quentin De Paoli <qdp@odoo.com>
2023-05-03 13:57:29 +02:00
Nicolas (vin) 2104df1ab0 [FIX] account: tax total computation fix
Fixes an issue with the tax total computation that would happen
if the tax of type group has the same tax_group_id as one of the
children taxes.
This would lead to a tax total computation where the other child
of the tax will be summed into the child sharing the same tax
group.
As it is no longer possible to set a tax group id on a tax of
type group, we do not need to take it into account when computing
the tax total anymore.

To reproduce before the fix:
    - Make a bill with the Australian tax au_tax_purchase_10_service_tpar_no_abn.
    - Save.
    - You will notice that the amount in the tax total widget for the tax
      "GST 10%" is wrong as it takes into account the amount of the other
      tax.

After the fix, the amount will not be wrongly grouped anymore. And the
tax total will correctly represent what is in the line_ids.

Task id # 3252271

closes odoo/odoo#117093

X-original-commit: aa736d7d0189784e6ff81b7acfcd0ac0e1cbe6b7
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
2023-03-30 08:50:08 +02:00
Nicolas (vin) 783733cf33 [IMP] hr_expense: avoid adding wrong expense_line_ids
You cannot validate and expense report having expense_line_ids of
different payment mode.
But so far, it was possible to select these lines, and it would
be blocked upon saving.

We will improve this behavior by extending the domain on the
expense_line_ids field and disallowing to add lines that would lead to
an error later in the process.

It will also correctly handle the creation of new line via the expense
report form view, and add the paid by field as optional hidden in the
view in order to allow to find more easily the expense line that are
causing issues.

task id # 3221780

closes odoo/odoo#116077

X-original-commit: ec18bd414c831a9af67802dcd5d7181ef8d43049
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
2023-03-23 08:01:08 +01:00
Nicolas (vin) 8259cf76ce [FIX] hr_expense: search panel categories fix
There is an issue with the search panel categories that has a limit=20;
It means it will only display the categories matching the expense
reports in the view if they are in the 20 first records fetched.

As this search field isn't really useful, it was decided to remove
it completely.

Task id # 3224719

closes odoo/odoo#116074

X-original-commit: 376e6aac2854f291c0b919451c34595b2c2d3060
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
2023-03-22 08:19:00 +01:00
Nicolas (vin) ae835037fc [FIX] account: no default taxes on accounts
So fat, the default sale and purchase taxes were so on the
account.accounts depending on the user type id.
These taxes were meant to be used as default taxes on products
and not accounts, so this is not right.
It also is an issue since the default tax isn't visible
on the COA list until the user add it from the optional fields.

Task id # 3223731

closes odoo/odoo#116111

X-original-commit: f1a9414f3cbe83bfde7e401e90b641668bd0ca14
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
2023-03-22 07:21:10 +01:00
Nicolas (vin) 09383bd8b3 [FIX] account: fix populate
Fix the populate script of account bank statements that
would try to create statement lines with an amount set to 0.
This is wrong, and also causes the populate to fail because
of a constrains

closes odoo/odoo#115597

X-original-commit: 273b99adc34d478d62d107040eae1db3ca883f6e
Signed-off-by: William André (wan) <wan@odoo.com>
2023-03-16 21:48:59 +01:00
Nicolas (vin) 9461d2d52b [FIX] base: disable same vat warning when using single-char vat
In order to ease the process of setting vats for some users, it was
decided to allow to use a vat number of a single character ('/' for
example) without checking it. This allows to differentiate between
partners for which we did not set VAT yet, and partners exempted from
VAT/without a number.

The VAT check was recently adapted to handle this use case, but the
"same vat" warning was forgotten in the process.

This additional change will disable the "same vat" warning that appears
when two partners share the same VAT number if that vat number is
only a single character, aligning the behavior of the warning to the
changes done in the vat check itself.

closes odoo/odoo#114640

X-original-commit: 4d80d30d0db6993a2fbbab59b935abe07080074b
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
2023-03-08 10:31:18 +01:00
Nicolas (vin) c25341ed0c [IMP] account: payment scamming protection
Odoo does not have much in terms of payment protection; you can create
payments to any account you want without many checks.

This changes it by requiring users with the right groups to trust an
account before allowing it to be used for payment methods requiring.
Also adds some warnings on the bank account view, and checks at the time
of creating a payment.

Task id # 3210415

closes odoo/odoo#114278

Related: odoo/enterprise#37789
Related: odoo/documentation#3737
Related: odoo/upgrade#4397
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
2023-03-07 01:59:51 +01:00
Nicolas (vin) ab14228f01 [IMP] account: Improvement of accounting dashboard kanban
Rework the button displayed on the kanban.
Part of task 3086715

closes odoo/odoo#108024

Related: odoo/upgrade#4394
Related: odoo/enterprise#34992
Signed-off-by: Cedric Snauwaert <csn@odoo.com>
2023-03-07 01:59:25 +01:00
Nicolas (vin) d4edf55949 [FIX] partner_autocomplete: fix name placeholder
The placeholder on the partner name was working for a partner that is
an individual but not company. This will fix that.

Task id #3138441

closes odoo/odoo#111324

X-original-commit: 00256249f880b1b6de3fc768beb0a2bc56191ada
Related: odoo/enterprise#36452
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
2023-01-30 22:27:15 +01:00
Nicolas (vin) af771e263c [FIX] base: partner view improvement
Improve the partner view by reorganising the city/state/zip row, making
the order of the fields dependant of the country address_format.
This is done to ease the use of these view for our users by displaying
a format they are already used to.

Task id #3138441

X-original-commit: c646f7bb80cb7f9af689082752608b554f1a648b
Part-of: odoo/odoo#111324
2023-01-30 22:27:15 +01:00
Nicolas (vin) 1688b1be4c [FIX] account: accounting date in list view
The accounting date was only visible in list view for misc entries.
For fiduciaries, we would like to have it also visible in these views.

As there is no simple way to only have the column visible when quick
edit mode is enabled, we compromise by having it always available, but
with optional=hide

Task id #3138441

X-original-commit: c208a91e926ec2a98bfbaee068284222fbc0ff05
Part-of: odoo/odoo#111324
2023-01-30 22:27:15 +01:00
Nicolas (vin) ba8cb088e3 [FIX] account_edi_ubl_cii: tax import supports rounding
A common use case for fiduciary is to use the available tax edition tool
on the tax total of an invoice to round the total of an invoice.
This is not supported by ubl, which will re-compute the taxes upon import
and thus lose that manual rounding.

This change aims to correct that, by post-processing the invoice after
creation in order to correct the tax amount to the one in the XML if the
different isn't superior to 0.05.

Task id #3138441

X-original-commit: 5bc87804bf5bba49ffd939c844439b87e08b499e
Part-of: odoo/odoo#111324
2023-01-30 22:27:14 +01:00
Nicolas (vin) b444e5671a [FIX] account: allow to delete part of a sequence chain
This was until now blocked by the_unlink_forbid_parts_of_chain ondelete.
It was still possible to do it manually by removing the
sequence name before deleting the invoice, and will now
be possible without that extra step.

Task id #3138441

X-original-commit: 6112f4f59aeb5dc5a3b698edd861b19f25da7017
Part-of: odoo/odoo#111324
2023-01-30 22:27:14 +01:00
Nicolas (vin) 98a225f4d2 [FIX] base_vat: VIES check should not be blocking
To that end, we will now do the VIES and regular VAT
check separately.
The VAT check stays as a constrains, while the VIES
check will now be done in an onchange and simply
display a warning if it fails.

We will also now allow VAT with a single character to
ignore the checks. This will allow users to better
distinguish partners for which they didn't enter VAT
against partners which are not subject to VAT by setting
the later's VAT to '/' or any other characters.

Task id #3138441

X-original-commit: eff3b140cc88dd48b77948a577f195f2e1910fd8
Part-of: odoo/odoo#111324
2023-01-30 22:27:14 +01:00
Nicolas (vin) d39396c728 [IMP] account,l10n_*: remove company currency symbol in reports
There is a lot of use case where reports are exclusively in the company
currency, or have columns only in this currency. In these case, showing
the currency symbol is redundant, takes space and makes the reading
slower.

With this change, we will avoid displaying the symbol in a variety of
use case where it is not needed.

Task id #2868674

closes odoo/odoo#109666

Related: odoo/enterprise#35671
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2023-01-17 19:55:50 +01:00
Nicolas (vin) 8ed53c5a57 [FIX] base: ir ui views word break
Fix an issue in the form view of the ir ui view where,
in the edit view dialog, the right group labels would be
all squished up if the xml_id of the view is long.
E.g. the bank reconciliation view.

This is fixed by adding the text-break class to the field.

Task id # 3133662

closes odoo/odoo#110039

X-original-commit: cd1a75f6e9349d8a9ff59c4e65e1d52403e531e9
Signed-off-by: Julien Castiaux <juc@odoo.com>
2023-01-17 01:10:12 +01:00
Nicolas (vin) cb9e936dc8 [IMP] account: bank statement report improvement
Improve the bank statement report by reducing the amount of
blank lines in it, as well as adding more information about
the partner and bank account when we have it.

Task id #2860753

closes odoo/odoo#93162

Signed-off-by: Quentin De Paoli <qdp@odoo.com>
2023-01-16 18:14:48 +01:00
Nicolas (vin) 44e5cf501b [FIX] account: Disallow to post move using deprecated account.
A move in draft created with an account that is later deprecated can
still be posted, while it shouldn't be allowed.
Thus, we add a new error blocking this wrong behaviour.

Task id #3087763

closes odoo/odoo#107354

X-original-commit: d8c2ad469299349e5184bc8986183cb205beb16a
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
2022-12-07 07:02:47 +01:00
Nicolas (vin) 0e958ccd85 [FIX] l10n_pe: fix the report invoice template
At the moment, a wrong xpath is causing the l10n_pe
modules installation to fail.
Correct it and ensure that it works.

See https://github.com/odoo/enterprise/pull/34464

closes odoo/odoo#107096

Related: odoo/enterprise#34603
Signed-off-by: William André (wan) <wan@odoo.com>
2022-12-02 15:34:48 +01:00
Nicolas (vin) 3d58e967ef [FIX] website_sale: fix products_snippet_recently_viewed tour
The tour is failing undeterministically, seemingly because a step is
done too soon after the previous one without giving the time for the
website to reload everything as expected.

By reordering the steps a bit, this issue can be avoided and fix the
test issue.

closes odoo/odoo#105891

X-original-commit: ff91efcda8cb80da4c376e74714f4c0dedad63c1
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-11-16 21:43:52 +01:00
Nicolas (vin) 9168a8e73b [FIX] website_sale: make add_to_cart_snippet_tour run as expected
Add a setUpClass with a dummy payment provider to ensure that at
least one is always available when the tour is running, and set
the company country_id to None before starting the tour to avoid
any country dependant fields to block the tour during the checkout
process.

closes odoo/odoo#105700

X-original-commit: 779965fbf0471f2b003692f1afa541864a396651
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
2022-11-14 17:18:11 +01:00
Nicolas (vin) f0eb6f3906 [FIX] website_sale_*: fix a few tests
Some tests are running tours, which have triggers on the amount.
The issue is that if the test is running on a company with another
currency than usd, and these tours ends up using a pricelist in USD for
example, then the prices in the website will be adapted and no longer
match the trigger in the tours.
This change aims to correct that by ensuring that only one pricelist
can be used when these tours are running, and that this pricelist
currency matches the one from the company. As such, the prices will be
as expected and the tours will run properly.

closes odoo/odoo#105523

X-original-commit: 9a81cf604bbbc626a0fa68219a4fe017cd781bc7
Related: odoo/enterprise#33836
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
2022-11-10 09:50:40 +01:00
Nicolas (vin) e8f699428d [FIX] l10n_ar: avoid renaming products in demo data
Because it causes them to be inconsistent with their images,
and causes issues with some website tours depending on them.

X-original-commit: cfbe95ae05fd0c87e24668fc8550da9fdd7ee70d
Part-of: odoo/odoo#105523
2022-11-10 09:50:39 +01:00
Nicolas (vin) 9d4dd8a742 [FIX] website: avoid timeout on website switching in testing suite
The tour snippet_cache_across_websites is at some point switching
between websites. The selector would be taking the second option in the
website list, which may not be correct if a module is adding a website
in its demo data.
This change aim to always switch from website 1 to website 2, without
caring about any other potentially existing website.

closes odoo/odoo#104596

X-original-commit: 7f756cfd5abc740e1a93a3225481c36279f094ed
Related: odoo/enterprise#33444
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
2022-10-31 12:42:25 +01:00
Nicolas (vin) 6bc685def1 [FIX] l10n_gcc_pos: avoid traceback if company has no country
There is a check done during the receipt generation in the pos that
checks the country code of the company, assuming it is set. But it
is possible to have a company without a country set so we need to handle
this use case.

X-original-commit: 19849c61f0f8b1cb3ddc588885953158482a079f
Part-of: odoo/odoo#104389
2022-10-28 08:22:56 +02:00
Nicolas (vin) 678c769706 [IMP] l10n_nz: accounts improvement
Improve the NZ localization by enabling the anglo saxon accounting by
default, and adding a new default stock output account.

task id #2993527

closes odoo/odoo#104081

X-original-commit: b1f4b19fa1fd27892430ede363358cf0f17fc796
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
2022-10-25 16:12:15 +02:00
Nicolas (vin) 418a0c734d [FIX] account: fix the label for due date
The label for due date was targeting invoice_payment_term_id
instead of due date, thus not profiting from the readonly rules
and being muted when it should not.

closes odoo/odoo#103344

X-original-commit: 9da25683e918838609ffdac87c979f883d11d027
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: Nicolas Viseur <vin@odoo.com>
2022-10-20 08:23:49 +02:00
Nicolas (vin) 1561747629 [FIX] account: avoid receivable accounts on bank journals
You cannot set a receivable or payable account as a bank account of
a bank journal directly, but it is very possible to just set an
account of another type, then change the type of this account to
receivable.
This new constrains will make sure that you cannot change the type of
an account.account set as bank account on a bank journal to any of those
two types.

closes odoo/odoo#102790

X-original-commit: f9500ca4c898cd86681cc2e48ec2c66cf5670917
Related: odoo/enterprise#32579
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
Signed-off-by: Nicolas Viseur <vin@odoo.com>
2022-10-09 19:49:53 +02:00
Nicolas (vin) d765b0301e [FIX] account: fix resequence form view
The resequence form view css has been broken, this aims to restore
it as it was in previous versions

X-original-commit: aa1fc47cc52b7ae51fb66ba077eb8b2691d0dbff
Part-of: odoo/odoo#102790
2022-10-09 19:49:53 +02:00
Nicolas (vin) 94beb218ea [FIX] account: do not allow to create a country in the settings
The fiscal country field could be used to create a new res country or
open the form view and allow to change things such as the country code.
This is obviously an issue and shouldn't be allowed.

closes odoo/odoo#102708

X-original-commit: 0881199fba43e01d6d7613eff00549eac5827480
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
Signed-off-by: Nicolas Viseur <vin@odoo.com>
2022-10-09 16:34:42 +02:00
Nicolas (vin) 84ac486524 [IMP] account: Add a form view for tax groups
The tax group model doesn't have a form view leading to a left side
bigger than the right side and some fields showing that we don't
want to see.
Thus, we add a form view and hide the field country_code, that is
not needed here since we already see the country_id.

closes odoo/odoo#101519

Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
2022-09-30 11:36:13 +02:00
Nicolas (vin) ee6c6c1b9e [IMP] account: bank statement misc improvements.
In order to better display the functionalities, we will change how
the demo data for bank statement are created. There will now be one
bank statement and multiple bank transactions not linked to a statement.
Also rewords one error to be clearer.

closes odoo/odoo#101466

X-original-commit: 5e14b28905fc00bad2c2ccd40328c676d049917d
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Nicolas Viseur <vin@odoo.com>
2022-09-29 08:05:42 +02:00
Nicolas (vin) 59e14989f7 [IMP] account: Opening the journal item on analytic line open the move
Opening the account move line form view from here is not useful,
as most would do it only to access the move behind it.
In order to display more relevant information, the move line
on the analytic line form view will instead directly open the
account move of the move line.

closes odoo/odoo#101491

X-original-commit: 1a861bd5d9f9a01e815e53f147c950f1535789c5
Signed-off-by: William André (wan) <wan@odoo.com>
2022-09-28 19:32:02 +02:00
Nicolas (vin) 12307ed3b5 [FIX] account: move analytic items menu
Move the analytic items menu under the management section of
the Accounting menu.

closes odoo/odoo#101109

X-original-commit: 79e3f311ed9129fadc484446efd320fa58c7b5bd
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Nicolas Viseur <vin@odoo.com>
2022-09-26 14:43:09 +02:00
Nicolas (vin) b2d00200e7 [FIX] account, analytic: account.analytic.distribution.model views
Improve both tree and form views for the account.analytic.distribution.model

closes odoo/odoo#101001

X-original-commit: bb2820ad585ceed0f0562de3cd5f9ef8f1fac7d1
Signed-off-by: Ayob Habib (ayh) <ayh@odoo.com>
Signed-off-by: Nicolas Viseur <vin@odoo.com>
2022-09-26 08:38:32 +02:00
Nicolas (vin) 7260962f5a [FIX] account: move line list js
The move line list js has a set thread method that tries to
get the move_id from the list view.
But in the list view, the move id was now missing so it
couldn't find it when a filter on journal entry was set.
This adds it again so that the code can get the information
again.

closes odoo/odoo#100974

X-original-commit: 8857d31bfa6f2e330d296ab6f3ed9223e228f54e
Signed-off-by: Cedric Snauwaert <csn@odoo.com>
Signed-off-by: Nicolas Viseur <vin@odoo.com>
2022-09-23 13:34:36 +02:00
Nicolas (vin) 2a023206c6 [FIX] account: fix domain of account_id on account move line
The domain was looking for a company with the name 'company_id' instead
of a company with the id in the field company_id.

closes odoo/odoo#100939

X-original-commit: b2d69fbdc48abde082bf7685b112796933921eb2
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Nicolas Viseur <vin@odoo.com>
2022-09-23 07:21:45 +02:00
Nicolas (vin) 77f3953e1a [IMP] account,l10n_*: cleanup reports menu items.
Following reportalypse, reorder the menu items in order to bring
some consistency to the report menu.
Also clean the menu items by removing all the menu items no longer
used since most reports are now selectable by going  on the generic
reports and then switching to localized ones.

Task id #2965755

closes odoo/odoo#99210

Related: odoo/enterprise#30854
Related: odoo/upgrade#3831
Signed-off-by: William André (wan) <wan@odoo.com>
2022-09-13 13:53:04 +02:00
Nicolas (vin) 1418388343 [IMP] POS: allows to create invoices for a pos order at a later time
Some countries, such as mexico, require a seller to be able to
generate an invoices from a ticket from a sale done in a shop,
even after a few days.
This change aims to allow this, by allowing to create an invoice at
a later date after the POS has been closed.
This is done by partially reversing the POS closing entry, and then
generating an invoice the same way it would be done at the POS closing.

The customer can scan a QR code if enabled in order to request the
invoice by himself, requiring him to fill a for to give the customer
information required for the invoicing.

Allows to fill additional fields dependent on the localization that are
required to be set on the partner or the invoice.

Task id #2946604

closes odoo/odoo#97675

Related: odoo/enterprise#30599
Signed-off-by: Laurent Smet <las@odoo.com>
2022-09-01 19:16:34 +02:00
Nicolas (vin) 623d3bfe0f [IMP] account: ensure account's code compatibility with reportalypse
The new account report engine requires account codes to only contain
alphanumeric characters and dots.
(see https://github.com/odoo/enterprise/blob/f435654f70f3d6a1fec7fa696945f2c0eb9a7056/account_reports/models/account_report.py#L2523)
Add two new constrains on account_account and account_account_template
to block the creation of accounts with codes that would cause issues
in account reports.

Task id #2960486

closes odoo/odoo#98900

Related: odoo/enterprise#30841
Related: odoo/upgrade#3824
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
2022-08-31 16:05:10 +02:00
Nicolas (vin) 3bac0f9d68 [FIX] account: Do not add tax grids for CABA taxes upon reversal
When using CABA and reversing a move, we expect the CABA move to
be the one impacting the tax grids, and not the reversed move.
Thus, we now avoid setting the tax grids for CABA taxes on
move lines created when making a reverse move.

Task id # 2895267

closes odoo/odoo#98789

X-original-commit: 5dd50ac1433be262ddd49d8b165e240afd16e675
Signed-off-by: Laurent Smet <las@odoo.com>
2022-08-25 12:05:10 +02:00
Nicolas (vin) 35e107bcbd [FIX] account: fix accounting dates
Fix the accounting date in a few scenarios, such as exchange difference
or CABA moves reversal.
Also avoid updating the currency rate when reversing exchange difference
moves.

closes odoo/odoo#98543

X-original-commit: 2b8df0c111a785a9e51dc2f528ac5b00cb0eadb9
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Nicolas Viseur <vin@odoo.com>
2022-08-25 01:54:01 +02:00
Nicolas (vin) 42e9502ffc [FIX] account: improve demo data
Improve the demo data for bank statement in account by formatting the
payment_ref amounts using the company currency, and fixing the due
amount in one payment_ref to match the statement line amount.

Task id #2855485

closes odoo/odoo#98510

X-original-commit: 4b23d11184be9bac5ef9790cc7f38bc4d637b47a
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Nicolas Viseur <vin@odoo.com>
2022-08-22 08:57:47 +02:00
Nicolas (vin) d40a118250 [IMP] l10n_fr_facturx_chorus_pro: new module for Chorus PRO
Add a new module that makes three new fields available on the invoices.
These fields are required when using facturx to send invoices to
public services through Chorus PRO.

The original template is updated to make it easier when integrating
the ubl refactoring coming soon, and avoid template issues that would
happen with an inherit if the inheriting module isn't updated after the
refactoring deployment.

opw-2714544

closes odoo/odoo#93877

X-original-commit: 4978d90cda34fd6c0b21bacb8462e1b9d4fb1241
Signed-off-by: Laurent Smet <las@odoo.com>
2022-06-17 09:18:20 +02:00
Nicolas (vin) d83ce882b8 [IMP] account: journal audit report improvement.
Improve the tax report section of the journal audit by adding a
background color to it, as well as reducing the width of the tables.
Ease the navigation from the journal audit report by adding three
new actions:
    - Taxes in the tax applied section can be clicked to audit them
    - The tax applied and the impacted tax grid sections now have an
      audit button to open a group-by view of journal items grouped
      appropriately according to the information we need.

closes odoo/odoo#92846

Related: odoo/enterprise#28025
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
2022-06-03 14:36:39 +02:00
Nicolas (vin) f5541768a6 [IMP] account: new journals audit report
Improvement in two ways:

- Implement a new, accounting report version of the existing journals audit
pdf report, and remove the old journal audit report (PDF only).
- Remove the menu items in "accounting" that opens the group by view of journal
items with different filters. Now, these will be linked to actions on lines in
the different reports available to the user.
Also render the "journal items" menu visible without debug mode.

Task id #2838182

closes odoo/odoo#92438

Related: odoo/upgrade#3560
Related: odoo/enterprise#27840
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
2022-06-02 12:05:07 +02:00
Nicolas (vin) 9453ce2b74 [IMP] account: add price total measure to invoice report
This feature isn't available as of now, and users that wants to do
this would have to use the similar report in Sale as a workaround.
As this is not always possible nor great, introduce this new measure
to display the line total tax included.

task id #2831312

closes odoo/odoo#89654

Signed-off-by: Florian Gilbert <flg@odoo.com>
2022-05-20 09:54:00 +02:00
Nicolas (vin) e8f8b93bd1 [FIX] base: don't assume res_ids is a list
https://github.com/odoo/odoo/pull/85150 introduced the method
_render_qweb_pdf_prepare_streams called from _render_qweb_pdf
giving it its res_ids.
Two places in this method are assuming res_ids will be a list, but
it is not always the case. Plenty of call to _render_qweb_pdf is
giving it a single id as a parameter.

This will ensure that res_ids is a list by creating one for single ids
too before proceeding with the logic of the pdf rendering.

closes odoo/odoo#91631

Signed-off-by: Laurent Smet <las@odoo.com>
2022-05-18 13:08:26 +02:00
Nicolas (vin) 3b86e2a864 [FIX] account_facturx: fix uom unece code fetch
The _get_unece_code method does not work in case where a specific uom
has multiple xml_ids.
Change it to handle such case and try to match every xml ids with a
unece code if possible.

closes odoo/odoo#91076

X-original-commit: d488b3cde3701b5eb69ac36cb6bbcc913956a0d4
Signed-off-by: Florian Gilbert <flg@odoo.com>
2022-05-11 14:54:36 +02:00
Nicolas (vin) 1ff279f11c [FIX] account_facturx: make factur-x xml compliant
The xml we generate for factur-x is no longer compliant with all
the latest standards. With these changes, we are providing the tools
to make it work once again and make sure it is validated by the
factur-x and zugferd validators in all aspect (PDFA/3, XMP, XML)
It should also be valid to be sent to Chorus pro if applicable.

This adds a mapping to the UNECE unit of measure codes for uom, that
are required for factur-x.

It will also calculate a category for each taxes as such:
    - If the tax is an export from EU to outside EU, G.
    - If the supplier and customer are both in EU but different country,
        K
    - If both are in EU, in the same country but the tax amount is 0, E
    - Otherwise, it will be S.
See https://unece.org/fileadmin/DAM/trade/untdid/d16b/tred/tred5305.htm

opw-2714544

closes odoo/odoo#90105

X-original-commit: e1bfb363bccd7b84f660d1e6c5b1e4d4fe02d398
Signed-off-by: Laurent Smet <las@odoo.com>
2022-05-04 13:53:42 +02:00
Nicolas (vin) f34d863257 [FIX] account,*: Ensure tests using TestInvoicingCommon runs
Add a check in 'AccountTestInvoicingCommon' to ensure that all
tests using it are run in post_install.
These tests cannot be run at install, thus they would be ignored
and wouldn't run on the Runbot.

X-original-commit: 659ee179e1beed962026e3abac1bda322c2ac964
[FIX] account,*: Ensure tests using TestInvoicingCommon runs

Add a check in 'AccountTestInvoicingCommon' to ensure that all
tests using it are run in post_install.
These tests cannot be run at install, thus they would be ignored
and wouldn't run on the Runbot.

closes odoo/odoo#90242

X-original-commit: ec36b403edda3fbe3b5bd5f30f31ef6bad680967
Related: odoo/enterprise#26791
Signed-off-by: Florian Gilbert <flg@odoo.com>
Signed-off-by: William André (wan) <wan@odoo.com>
2022-05-02 18:48:52 +02:00
Nicolas (vin) cb63a0bc52 [FIX] account: duplicate bank account redirect action
There is an issue where we redirect to a list view/form view of
res.partner but with id's from res.partner.bank, thus redirecting to
the wrong views.

closes odoo/odoo#88865

X-original-commit: a1cce790fcd2d1823fb9e3d5c3c3e916d34568e5
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: Nicolas Viseur <vin@odoo.com>
2022-04-15 15:28:55 +02:00
Nicolas (vin) 66e0e4086b [FIX] account_*: payment method journal filter
Fix two issues linked to payment methods and their journal link.

SEPA Credit Transfer was marked as only available on EUR journals, but
from what we have been told, and we have seen, it should also be made
available for other currencies (CHF/SEK).
So we are changing the rule used to determine if SEPA Credit Transfer
is available on a journal to allow to use it on journals using CHF or
SEK as a currency.

There is another issue, where the filtering is done differently at the
journal creation and when the user add the payment method manually in
the lists.
The filter rules were not respected at the journal creation, which
would lead to incorrect default inbound and outbound payment method list.
For example, a new journal would have the company currency (let's say,
USD) but still have SEPA Credit Transfer (EUR,CHF,SEK) added on it by
default while it should not be available there.

opw-2777522

X-original-commit: 0ad8faf3bfc7b28e5668c3445fcc06c24ad98354
[FIX] account_*: payment method journal filter

Fix two issues linked to payment methods and their journal link.

SEPA Credit Transfer was marked as only available on EUR journals, but
from what we have been told, and we have seen, it should also be made
available for other currencies (CHF/SEK).
So we are changing the rule used to determine if SEPA Credit Transfer
is available on a journal to allow to use it on journals using CHF or
SEK as a currency.

There is another issue, where the filtering is done differently at the
journal creation and when the user add the payment method manually in
the lists.
The filter rules were not respected at the journal creation, which
would lead to incorrect default inbound and outbound payment method list.
For example, a new journal would have the company currency (let's say,
USD) but still have SEPA Credit Transfer (EUR,CHF,SEK) added on it by
default while it should not be available there.

opw-2777522

closes odoo/odoo#88677

X-original-commit: e2cd91ad8339f73b2547bc839e675443528f3adf
Related: odoo/enterprise#26172
Signed-off-by: Florian Gilbert <flg@odoo.com>
2022-04-14 15:11:27 +02:00
Nicolas (vin) e2b3ec6d5c [IMP] account_*: some Back2Basics improvements
Improve a few things in accounts modules:
    - Users wants to be able to change the account in the general ledger
    list view
    - Do not group by date by default when auditing a tax line.
    - Make the currency fields only show in debug mode for accounts and assets
    - Disallow to delete taxes linked to a tax repartition line, and
    clarify the error message when trying to delete one linked to a
    fiscal position's account mapping

Task id # 2810379
[IMP] account_*: some Back2Basics improvements

Improve a few things in accounts modules:
    - Users wants to be able to change the account in the general ledger
    list view
    - Do not group by date by default when auditing a tax line.
    - Disallow to delete taxes linked to a tax repartition line, and
    clarify the error message when trying to delete one linked to a
    fiscal position's account mapping

Task id # 2810379

closes odoo/odoo#87659

Related: odoo/enterprise#25770
Signed-off-by: Laurent Smet <las@odoo.com>
2022-04-01 17:56:38 +02:00
Nicolas (vin) d9ee3a019e [FIX] l10n_fr_fec: allows exporting FEC without TVA number.
Not all company needs a French TVA number but still needs to provide
FEC file.
Improve that by making the TVA number optional, allowing to export the
FEC file without it. The only difference is that in such case, the vat
number won't be appended to the file name.

Task id #2801629

closes odoo/odoo#87620

X-original-commit: 59937bbea86a9d01bb7038f7e307fd88fbb82976
Signed-off-by: Olivier Colson <oco@odoo.com>
Signed-off-by: Nicolas Viseur <vin@odoo.com>
2022-03-31 07:55:40 +02:00
Nicolas (vin) 7d0e3cd7e3 [FIX] account: remove default journal in cut-off
The journal in a cut-off has to be of type general. But there is an
issue at the moment where a default_journal_id would be provided in
the context (coming from the dashboard for example) and thus, fill
the journal in the cut-off wizard with a wrong value (vendor bill for
example).

This change make sure no default values are provided to the wizard.

closes odoo/odoo#87179

X-original-commit: 5b099bf6135b2ff517078d1839b513da7830f718
Signed-off-by: Florian Gilbert <flg@odoo.com>
Signed-off-by: Nicolas Viseur <vin@odoo.com>
2022-03-24 17:12:30 +01:00
Nicolas (vin) 9f4c66107e [IMP] account: allow trying to upload the same file
Since https://github.com/odoo/odoo/commit/cb6c6224be4eaa80091f51f957059de889332e68
we are now raising possible errors when uploading an invoice.
In 14.0+ we are allowing via a redirect warning to change the status of
the currency without changing the page but the upload only starts when
you change the uploaded file.
So the following flow does not work:
    - Try to upload a bill with MXN currency
    - With MXN being inactive, it raises an error. Using the redirect warning action
      we activate the currency, clos the modale window and try to upload
      again.
    - The upload won't work until we refresh the page, because the value
      of the input file does not change (or we need to select another
      one, then the first one again)
This change reset the file input if there is an error raised during the
upload allowing to select the same file more than once without reloading.

closes odoo/odoo#86539

X-original-commit: 4bfc75075217adc32de8df008128bbaa8c6c158d
Signed-off-by: William André (wan) <wan@odoo.com>
2022-03-16 17:58:08 +01:00
Nicolas (vin) f462335592 [FIX] account_report: fix update of account report
see https://github.com/odoo/odoo/pull/77771
https://github.com/odoo/enterprise/pull/23738

These PR are updating a template and adding a new dependency in
account_report. This has the side effect of making account report
raise a traceback when invoicing has not been updated prior to that.

With this change, we will bump the version of account and use it to
make sure that it has been updated as we would expect prior to updating
account_reports. If not, we will raise a user error with an explicit
message asking the user to update invoicing.

closes odoo/odoo#86217

X-original-commit: 0ec9e16cae0cdaa99cfb181b40658e15e34e0b14
Signed-off-by: Olivier Colson <oco@odoo.com>
Signed-off-by: Christophe Simonis <chs@odoo.com>
2022-03-11 09:50:54 +00:00
Nicolas (vin) 9b3decf5f4 [imp] account: add unique constraints on journal group names
Journal groups name are used as an identifier in reports,
namely on financial reports when a company has different reporting requirements
- on company level
- on consolidated level
- according to IFRS standards

This will add a constraints to ensure that groups name are unique.

Task id #2759252

closes odoo/odoo#85958

Signed-off-by: Laurent Smet <las@odoo.com>
2022-03-08 14:58:52 +00:00
Nicolas (vin) 0e601b8b0a [FIX] account_edi_facturx: fix upload with inactive currency
Retroactive fix for an issue in 15.0+
In 15.0+, importing an invoice with an inactive currency will raise
a traceback. Before this it was handled by not setting the correct
currency on the invoice if not active.

With this change, we'll raise an error instead of creating an invoice
with the wrong currency.

closes odoo/odoo#85678

X-original-commit: 14c61c2563efeed1ca14294da32e2eb6d1855c5b
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: William André (wan) <wan@odoo.com>
2022-03-03 16:17:46 +00:00
Nicolas (vin) 745ad763a5 [FIX] account: invoice accounting date.
The accounting date and the related warnings were in some cases not
being set properly. This change aims to improve that by displaying
warnings in the view and updating the date on post instead of raising
user errors.
This will mostly affect sell documents.

Task id #2778958

closes odoo/odoo#85744

X-original-commit: 51ddb870d346ff61a6ae36c8c3b545eaca9736cb
Signed-off-by: William André (wan) <wan@odoo.com>
2022-03-03 12:58:01 +00:00
Nicolas (vin) 81f94e1d65 [IMP] account: improve discount fields in move view
As of now, the discount field is either only shown in
debug mode or if the sale module is installed and a
setting is set in sale.
This field should be shown in the view, and not depend
on a setting from another app.
This is especially true as it could be filled by the ocr
or when uploading from an edi, and it would be inconsistent
if the user couldn't display it.

Task id #2758965

closes odoo/odoo#85737

X-original-commit: eb1a77753debdb034ad00ce10d908f4b9ee264ad
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Nicolas Viseur <vin@odoo.com>
2022-03-03 11:04:37 +00:00
Nicolas (vin) 9983fa064a [FIX] account: call _onchange_price_subtotal on demo data
The demo data created by account did not call _onchange_price_subtotal
on the created account_lines, making the total debit
and credit not matching the state of the lines.

closes odoo/odoo#85188

X-original-commit: 403939ea7b460b95cc31993613f5cba5f5fefcfa
Related: odoo/enterprise#24651
Signed-off-by: Olivier Colson <oco@odoo.com>
Signed-off-by: Nicolas Viseur <vin@odoo.com>
2022-02-23 11:00:48 +00:00
Nicolas (vin) e8063c6657 [IMP] account: journal audit improvement
Improve the journal audit report by adding information about impacted
tax grid for each computed journal.

Task id #2658937

X-original-commit: 09848ba2ae5bd0f25c20a20e73089a5a0f1c8f74
Part-of: odoo/odoo#85188
2022-02-23 11:00:48 +00:00
Nicolas (vin) 9e27a1fd4a [FIX] account_reports, l10n_it_reports: carryover fix
There is an issue with the Italian carryover, line vp14b.
Use case:
 - Month 1, have a value of 25 in this line => will trigger a carryover to line vp7
 - Month 2, add more value to vp14b so that it goes above 25.82.
   This will set the bound as None, and thus this will not impact the carryover.
This is wrong, because then the next month we will see a value of 25 in vp7
while it should be 0.

closes odoo/odoo#84938

X-original-commit: ffbc7af321a36d4fd0aebb94d7a636cb1fc34b88
Related: odoo/enterprise#24555
Signed-off-by: Olivier Colson <oco@odoo.com>
Signed-off-by: Nicolas Viseur <vin@odoo.com>
2022-02-21 07:49:49 +00:00
Nicolas (vin) c915373920 [FIX] web: BasicModel: contexts order
When combining the context for an RPC, the
additional context is being added before the raw
context.

Because of this, a use case such as:
   - A o2m field with a context {'field': 'a'}
     with a tree editable view below it
   - That view defines controls to create lines,
     which would change the context key 'field' to
     another value.
=> The field context key would take precedence on
the creates key, making it impossible to override
that key in specific circumstances.

closes odoo/odoo#83996

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-02-07 10:07:50 +00:00
Nicolas (vin) d0c3e6cba1 [FIX] account: fix tax line partner assignation
When creating a new invoice by giving it an invoice_line_ids list for
which the last line is a note, the tax line may be created wrongfully
without partner_id, which is totally wrong.

To reproduce :

Create a SO
Set a customer
Insert a product with tax
Insert a note
Deliver the product
Invoice the SO and confirm the invoice
The partner_id is not set on the created tax line

While the issue only arises in 15.0, it brings to light that the partner
is not in the grouping keys while it should, so it will be changed in 13.0+

opw-2750851

closes odoo/odoo#83999

X-original-commit: 2ce994d279126aa0356b86d3fa38b699e9035e54
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Nicolas Viseur <vin@odoo.com>
2022-02-04 17:56:35 +00:00
Nicolas (vin) 45666139ee [FIX] account: bank account config company_id
When trying to set up a new bank account using the bank account wizard,
there is an issue with the check company on the linked_journal_id field.

The check will make sure that the company on that field is either false
or the same as the company on the record. But with a recent change in
68f4534aa5 the bank account company_id will be the one from the linked partner.
As the partners for companies have an empty company_id, this check does
not make a lot of sense anymore, as it would be wrong in most cases.
(We expect a journal with the currently selected company, but the bank
account will in most cases have an empty company_id)

closes odoo/odoo#83852

Signed-off-by: Josse Colpaert <jco@odoo.com>
2022-02-03 15:21:39 +00:00
Nicolas (vin) 62f0a3e0ff [FIX] account: fix the tax template test
In master, the tax template consistency test
is broken since 8fb53c53c3
Fix this to make sure we add an exception for
that new computed field as it should not be in
the template.

closes odoo/odoo#83724

Signed-off-by: Florian Gilbert <flg@odoo.com>
2022-02-01 08:03:00 +00:00
Nicolas (vin) 9d94724fad [IMP] l10n_fr: coa adjustment.
While updating financial reports to help avoid misconfiguration,
slightly update the coa to fix some wrong account types or name.

Tax id #2585627

closes odoo/odoo#83268

Related: odoo/enterprise#19835
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
2022-01-31 13:58:03 +00:00
Nicolas (vin) 24282f5b23 [IMP] l10n_es: change the type of the account 5585
Change the type of the account 5585 to be current
liabilities instead of non-current as it makes more sense.

Task id #2585627

closes odoo/odoo#83266

Related: odoo/enterprise#19833
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
2022-01-31 13:57:55 +00:00
Nicolas (vin) 6481eca020 [FIX] factur-x: fix line chargeAmount export
The current behavior is that we are exporting the line subtotal as
chargeAmount of the line.
This is an issue as this field is expecting the unit price instead.
A bugfix was done for importing extern invoices properly that broke
importing factur-x files from Odoo as it doesn't support that custom
behavior anymore.
Thus, this will correct the export to properly store the unit price
in the GrossPriceProductTradePrice ChargeAmount.

At the same time, add the NetPriceProductTradePrice ChargeAmount,
which is required and should contain the unit price with discount
applied.

closes odoo/odoo#83647

X-original-commit: c93f7dba0720e5e4f7d0a26ce05a854094e6a279
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Florian Gilbert <flg@odoo.com>
Signed-off-by: Nicolas Viseur <vin@odoo.com>
2022-01-31 10:07:34 +00:00
Nicolas (vin) 008ef45e91 [IMP] l10n_mx: set tags on suspense and outstanding accounts
Set a default tag on the bank suspense account, outstanding accounts
and transfer accounts so that they are found and used by the trial
balance and COA reports.

TAsk id #2612900

closes odoo/odoo#82532

Related: odoo/enterprise#23383
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
2022-01-25 19:07:03 +00:00
Nicolas (vin) b96640785d [IMP] l10n_lt: Update account types
Update the type of some accounts to better represent their use in the
financial reports.

Task id #2612900

closes odoo/odoo#82531

Related: odoo/enterprise#23381
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
2022-01-25 19:06:59 +00:00
Nicolas (vin) 68f4534aa5 [IMP] account_*, l10n_*: allows the same bank account on multiple partners
Some use cases require the use of the same account number on multiple
partners. This will relax the constraints to allows such use cases, and
adapt to avoid setting the partner or bank when we cannot be sure of the
one we should take (on bank statement line, and during reconciliation)

Task id #2692025

closes odoo/odoo#81362

Related: odoo/enterprise#22881
Signed-off-by: Laurent Smet <las@odoo.com>
2022-01-25 13:52:29 +00:00