Commit Graph
2830 Commits
Author SHA1 Message Date
Laurent Smet 6d03583a82 [FIX] account,l10n_: Restore journal liquidity account hook
The overrides in l10n_ modules are broken since 14.0 because the hook no longer exists.

closes odoo/odoo#61610

X-original-commit: 1fe852e032876f2f3212a43fc3115e49f4de618d
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2020-11-10 16:55:31 +00:00
Martin TrigauxandXavier Morel 49838338e0 [FIX] *: sanitize action content reading
The open_action_with_context was not using _for_xml_id, producing an
error when reading the action content.

In open_action, the action_name was taken from the context and needs
sanity checks. Ensure only actions from the account module can be
read and only if the user has access to the target model.
This is a limitation of the previous behaviour but, at the moment, all
known calls are made refering to an action from the account module.
Limit the scope of this method while the 14.0 is still early to avoid
having a door open to ready any action, and difficult to close later.

Remove old action fetching from the context in create_move that is no
longer used.

closes odoo/odoo#61602

X-original-commit: a39e94f7e4dc74e850650ac90bbc5f85af130bc8
Related: odoo/enterprise#14695
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Co-authored-by: Xavier Morel <xmo@odoo.com>
2020-11-10 16:04:29 +00:00
Andrea Grazioso (agr-odoo) 4a0054a409 [FIX] account: fix total recomputation when having 100% tax
Create a tax as follows:
* Tax Computation: Percentage of Price Tax Included
* Tax Scope: Purchase
* Amount: 100%
* Included in Price
* Affect Base of Subsequent Taxes
Create a vendor bill with the tax on the line
Change unit price

The total does not change

This occur because when having 100% tax debit/credit are unchanged.
So the onchange `_onchange_mark_recompute_taxes` is not triggered and
the tax lines are not updated, thus not changing the
total (as in this case the invoice total is just the tax value)

opw-2370861

closes odoo/odoo#61555

X-original-commit: 9e203cc016b45875f699ffab24fe3f8382a97303
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
2020-11-09 16:04:03 +00:00
Nicolas Martinelli 5c57644ead [FIX] account: cash rounding precision
A cash rounding precision must be strictly larger than zero to follow
the restriction introduced in e270e9e0cc.

opw-2341804

closes odoo/odoo#61382

X-original-commit: 563752358d233d4fc9cf1d7e7abd0b1656dc82c1
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2020-11-09 08:53:46 +00:00
Nicolas Martinelli 57d76c8539 [FIX] account: extract fpos recomputation logic from onchange
We extract the `price_unit` and `tax_ids` recomputation logic from the
`_onchange_product_id` method. This way, it can be called
programmatically.

opw-2371934

closes odoo/odoo#61477

X-original-commit: ca6f25bef45137c032bc5cafd336c3f16a97a929
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-11-06 13:01:54 +00:00
wan 084690edc9 [FIX] account: deduce sequence reset
The order to find when to reset the sequence needs to be the following:
* find a sequence used before the date of this move
* if there isn't any, find the sequence of any move

Because we were not looking at the second step for bank statements, we
could have an issue since we were not checking the sequence relative to
the correct date.

closes odoo/odoo#61495

X-original-commit: b863b9cfedb3e7b4d1e3d409c829ffa0bfa1d9bb
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: wan <william-andre@users.noreply.github.com>
2020-11-06 16:57:41 +00:00
wan beec09e27e [FIX] account: don't change the payment date
This line seems to have been copied from before the refactoring
https://github.com/odoo/odoo/commit/caeb782841fc5a7ad71a196e2c9ee67644ef9074

It didn't work at first:
https://github.com/odoo/odoo/commit/ea3e39506a2b360545ec0cd1d3235e69ad16ea6c

It conflicted with the new constraint for matching the date with the
move name `_constrains_date_sequence` on `sequence.mixin`, and was right
to conflict.

closes odoo/odoo#61465

X-original-commit: 1aa0404966c6abc89d68a5118c2742de9e6b617b
Signed-off-by: wan <william-andre@users.noreply.github.com>
2020-11-06 11:24:27 +00:00
william-andre d4b4069dec [FIX] account: prevent changing date and journal of move with name
We need to ensure the name stays consitent with the journal_id and the
date when we try to change one of those fields.

X-original-commit: 634aaeeac36d2371743338536466a0bcc9ad6c69
2020-11-06 11:24:26 +00:00
Goffin Simon 49afd2f807 [FIX] account: Impossible to import a camt file with Stmt Id > 2147483647
Steps to reproduce:

- Let's consider a camt file F with Stmt Id > 2147483647
- Import F

Bug:

An index out of range was raised because range of an integer type in postgresql must be
in [-2147483648, 2147483647]

opw:2372401

closes odoo/odoo#61391

X-original-commit: 953d3069fb77605a8d69f80124d011144595d459
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2020-11-05 11:23:54 +00:00
wan c036af067f [FIX] account: do not prepend company name for mail alias
We still keep the behavior for later companies.
It was originally added here 41f119d532

closes odoo/odoo#61353

X-original-commit: 9ba396afa68884f477096d3e7f3c824ff97f3aac
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: wan <william-andre@users.noreply.github.com>
2020-11-04 16:50:34 +00:00
Laurent Smet 3f50f9ce39 [FIX] account,point_of_sale: Set invoice 'paid' directly when fully reconciled wo payments
When the invoice is fully reconciled but not using payments, set the 'paid' status on invoices.

closes odoo/odoo#61339

X-original-commit: 052324cca4ec8682f065a4158e86fc113b0242e0
Related: odoo/enterprise#14590
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2020-11-04 14:47:30 +00:00
Laurent Smet a498497962 [IMP] account: Allow skipping statement line on payments
A classic payment uses the outstanding account to create the line that needs to be matched later with a statement line.
In some cases, the user doesn't want to encode twice the same transaction, e.g. when encoding a cash payment, and want to create directly a payment impacting the cash account to skip the 'statement line' step.

X-original-commit: 2b472fd59e8eebbc2cf1f592cf6e657f2ae9e778
2020-11-04 14:47:29 +00:00
oco-odoo b66c4fd0f7 [FIX] account: reconciliation widget: make invoice matching reconciliation models work with write-off lines
Use case:

1) Create an invoice matching reconciliation model, matching 90% percent of the amount, with a write-off line applying a 100% write-off of the remaining amount.

2) Create a 100€ invoice

3) Create a bank statement with a 90€ statement line whose payment reference corresponds to the one of the invoice

4) Click 'reconcile' on the bank statement

On enterprise, this crashes when preparing the data to give to the reconciliation widget, as the write_off_vals key is not set properly by the call to _apply_rules.

OPW 2367754

closes odoo/odoo#61265

X-original-commit: 1dd6199519b4ad5b5b17dfa17965ededcecb6da4
Related: odoo/enterprise#14563
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2020-11-03 13:23:08 +00:00
oco-odoo 84c14fde05 [IMP] account: better handling of journal codes when duplicating
Before that, even though the code contained something about it, the duplication of account.journal objects handled their code field pretty poorly (as it was trimmed to 5 characters), leading to situations where journals could have the same code, leading to possibility for account moves to have the same name.

This commit improves the SQL constraint testing journal codes so that they  must now be unique per company. We also recompute the code in a more advanced way so that journal duplications works as smoothly as possible.

Task 2346404

closes odoo/odoo#59791

Related: odoo/enterprise#14447
Related: odoo/upgrade#1880
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2020-11-02 15:46:15 +00:00
wan be2f050993 [FIX] account: view statement correct action
The dashboard "View Statement" action on bank journals was using the
`open_action` helper, but it was badly computed for journals with
`bank_statements_source` set to `online_sync`. We were directed to the
statement lines instead of the statements; and there was no other way to
go to the list of statements.

closes odoo/odoo#61190

X-original-commit: 78286851034b8f3ef4dcab78e50b7220c0bdd213
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
Signed-off-by: wan <william-andre@users.noreply.github.com>
2020-11-02 15:50:34 +00:00
Goffin Simonandsmetl 0e4642db8f [FIX] account: Auto-complete with analytic account
Steps to reproduce the bug:

- Create a vendor bill VB1 with one line L1
- Set an analytic account AA on L1
- Post VB1
- Create a new vendor bill VB2
- Set VB1 on the field Auto-complete

Bug:

The created line L2 on VB2 had no analytic account

PS: In 12.0, the analytic account was kept when using Auto-complete field

opw:2359432

closes odoo/odoo#60962

X-original-commit: 5f46c50442dbe42bc534718719a6b19ee087eab0
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Co-authored-by: smetl <las@odoo.com>
2020-10-29 10:54:47 +00:00
Laurent Smet 095fb9d6c4 [FIX] account: Check the exchange diff journal only when needed
When the exchange difference journal entry shouldn't be created, don't check its configuration in order to avoid an UserError in single-currency company.

closes odoo/odoo#61047

X-original-commit: 3ab451f3c4ce8dd42337f43628c1335d2caee011
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2020-10-30 13:20:27 +00:00
Achraf (abz) 716ea67582 [FIX] account: Reconcile payment from the manual reconciliation
Issue

    - Install "Accounting"
    - Go to "Configuration/Reconciliation Models"
    - Create new reconciliation model "Test" with "620000 Bank Fees" account
    - Go to "Customers/Payments" and try to reconcile a payment via "Manual Operations"
        by clicking on "Test" button
Cause

    This instruction "st_line.company_currency_id.is_zero(residual_balance)"
    needs at least one element in st_line

Solution

    Skip this instruction if "st_line" is empty

opw-2370034

closes odoo/odoo#61045

X-original-commit: 161a6c494a412097468fca214817c42f022d29e2
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Signed-off-by: Achraf <abz-odoo@users.noreply.github.com>
2020-10-30 12:33:27 +00:00
Martin Trigaux c59c10f1bc [FIX] *: correct typos and bad English
Courtesy of translators
Reexport .pot of modified modules

closes odoo/odoo#61010

X-original-commit: 62a18bdb372e234107fd2099a2df5f9e3a442c96
Related: odoo/enterprise#14489
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-10-29 19:23:41 +00:00
Nathan de Pryck 8a12247211 [FIX] account: use _for_xml_id to read action
Use of '_for_xml_id' instead of read in order to avoid
access right issue on 'ir.actions.act_window'.

closes odoo/odoo#60946

X-original-commit: 4e65fbf14491ea97415ede6d10385222c8d4d074
Signed-off-by: ndeodoo <ndeodoo@users.noreply.github.com>
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-10-29 09:15:47 +00:00
oco-odoo f1f3366bc0 [FIX] account, hr_expense: show correct sign for tax_base_amounts of misc operations' lines
Before this, misc operations always used the balance of the base line as the tax_base_amount of the tax line. This was inconsistent with the invoices, for which we invert its sign when making a sale invoice or a purchase refund (as for those operations, positive amounts are put in credit). This commit should make everything behave in the same way.

closes odoo/odoo#60912

X-original-commit: 2ca3158ce2de596526067dbd86da2ef7d4ae85bd
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2020-10-28 14:56:20 +00:00
wan c514e54b9d [FIX] account: analytic default + add test
* Analytic defaults keep their old value
* The date_maturity is non-sense, it isn't set on lines needing analytic
* Analytic default should work for misc. operations too, but only for
  product/service lines on invoice documents.

closes odoo/odoo#60904

X-original-commit: 4d2b8dd1bef40c592215728fab6c31f192176e93
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: wan <william-andre@users.noreply.github.com>
2020-10-28 14:08:02 +00:00
std-odoo 01ceca36b2 [IMP] digest: change the logic from "Last day" to "Last 24 hours"
Purpose
=======

Change the logic of the KPI "Day-1" to "Last 24 hours", so new freshly
created data in the free trial are included in the statistics (same for
last week and last month logic). This requires to change from date-based
computation to datetime-based.

Change the URL of the "connect" button from "/web/login" to the root
URL (so the user is not stuck if he didn't activate yet his database).

Task ID-2359406

closes odoo/odoo#60166

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-10-27 11:11:54 +00:00
Laurent Smet 1738273e4a [FIX] account: Fix unbalanced journal entry when switching payment terms
When switching immediate payment term to 30% advance then back to immediate payment term, the receivable line is back to its previous value.
This is due to the '_get_fields_onchange_balance' that is not updating correctly the business fields since price_subtotal == amount_currency.
So, when `writing`, debit/credit are removed from the dictionary because the values are the same as before. However, `price_unit` hasn't be updated with the new value and remains as its previous value.
It leads to a recomputation of accounting fields regarding the business fields and then, trigger the unbalanced journal entry.

closes odoo/odoo#60654

X-original-commit: 18b5ad16a442404061b1028c2ffd82f179beaba3
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2020-10-23 15:51:28 +00:00
Laurent Smet bc76a2b9af [FIX] account: Fix reversal of journal entry with tax_ids on tax line
A tax line could have something in the `tax_ids` field.
Then, these condition needs to be inversed in order to not handle them as base lines.

closes odoo/odoo#60473

X-original-commit: eada9f91f3361f8335c23b3a27161803cfda6608
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2020-10-21 15:46:17 +00:00
Jorge Pinna Puissant 9f855ccb20 [FIX] account: duplicate method name
closes #59683

closes odoo/odoo#60343

X-original-commit: 1c0db7b2f4e5bdfba921e82e6872ac13d44f9d7a
Related: odoo/enterprise#14229
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2020-10-20 09:14:03 +00:00
Nicolas Galler 6c74444c96 [FIX] account: use commercial partner id for auto computed lines
Behavior before the fix:

- if you create a sales order for a customer invoice address (a child
partner record), then create the invoice for that order, the partner_id
is not consistent between the move_line (some get the child partner id,
some get the commercial partner id = the parent partner id)
- if you create the invoice directly from the accounting app for a
child partner, the commercial partner id is used consistently for all
move lines (the invoice itself keeps the child partner id)

Behavior after the fix:

- when an invoice is created from a sales order, the partner id is set
using the commercial partner id, consistently for all lines (in this way
the behavior is consistent with that of the accounting app)

It is more appropriate to use the commercial_partner_id for this purpose
as it is used pretty consistently in the account_move file

opw-2347878

closes odoo/odoo#60302

X-original-commit: cd299518ae45f2732d47788869b013be16b814e8
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
Signed-off-by: Nicolas Galler <nicocrm@users.noreply.github.com>
2020-10-19 15:57:20 +00:00
Wolfgang Taferner 2a7f5e25f1 [FIX] account: balance with line quantity > 1 and fiscal position
Currently the onchange is setting the price_unit to the price_subtotal to work out the proper price unit related to the tax, but does not have a different line quantity in mind.
The update of the price_unit was raising a balance difference UserError which is now resolved by the fact that we only update the price_unit if it is affected

OPW-2362066

closes odoo/odoo#60256

X-original-commit: 8c8d803992c31ba68a12801fa6dd4dcf909d9ed9
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2020-10-19 10:51:33 +00:00
Arnaud Joset fb875a3852 [IMP] account: add compute_fiscalyear_dates method on res.company
[IMP] account: add compute_fiscalyear_dates method on res.company

The following commits
  https://github.com/odoo/odoo/commit/576a69e29e98532aa5de78eb3fcbff0b94cea32d
  https://github.com/odoo-dev/enterprise/commit/ed383522791276b17ba68a4f0d08f9e3ed4e783c

move the  compute_fiscalyear_dates method from the community account module to the enterprise one account_accounting.

This commit ensures that the method can be used when account_accounting is not installed.
As the fiscal year is irrelevant when account_accounting is not installed, this commit displays the calendar year.

taskid: 2329108
See also: taskid 220194

closes odoo/odoo#60140

X-original-commit: 544cb3682033e9f644b48b97dd5197eaf9282ff5
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-10-15 20:23:20 +00:00
Laurent Smet 423f0c7148 [FIX] account: Fix price_unit with fiscal position to price included tax
Suppose two price_included taxes: 10%, 20%, a product having a sale price of 110.0 and a fiscal position tax 10% => tax 20%:

When onchange_product_id is called, the price_unit is computed as follow:
110 / 1.1 = 100
100 * 1.2 = 120
So price_unit = 120 and balance = 100.0

But in onchange_uom_id, we do the same thing and we call _get_fields_onchange_balance_model with balance=100.0.
However, in this method, an empty dictionary is returned because price_subtotal == balance.
Then, {}.get('price_unit', price_unit) will return the original price_unit (110.0) instead of the new computed one (120.0).

closes odoo/odoo#60108

X-original-commit: f2a5476c52c1312d3dfc558f92b4a678d6aa5e25
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2020-10-15 14:19:55 +00:00
Xavier Morel 23ef558689 [FIX] account: improve warnings.warn call
As-is, the warning will reports that post() is called from within
post, which is not very convenient when trying to find what calls
post() (as there are other "post" methods in the system).

By increasing the stacklevel from 1 (default) to 2, the warning will
report the method's caller, which is a lot more useful.

closes odoo/odoo#60043

X-original-commit: 5bc6eb9b387112138ac118726ff746bad6d00f8d
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2020-10-15 06:50:13 +00:00
Nicolas Martinelli 3319803a93 [FIX] account: wrong rounding with multi-currency
- Create a tax:
  5%
  Included in price
- Set the company currency to USD
- Set the currency rounding of CHF to 0.05
- Set the rate for CHF to 0.654065014
- Create the following invoice in CHF:
  Set a payment term
  Prod 1, 1 unit,  5.0 CHF, tax 5%
  Prod 2, 1 unit, 10.0 CHF, tax 5%
  Prod 3, 1 unit, 50.0 CHF, tax 5%

It is not possible to save the invoice because of an unbalanced journal
entry.

Indeed, the Receivable line is $99.30 while it should be $99.29. This
happens because we round the `total_balance` with the rounding precision
of the invoice currency while it is in the company currency.

closes odoo/odoo#58798

closes odoo/odoo#60035

X-original-commit: dad5e2a575448b68cc1b59880fecfe48dbe30a4e
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-10-14 17:24:32 +00:00
Nicolas Martinelli fa60131f9c [FIX] account: wrong computation with currency rounding 0.05
- Create a tax:
  5%
  Included in price
- Set the currency rounding of the company to 0.05 (e.g. CHF)
- Create the following invoice
  Prod 1, 1 unit,  5.0 CHF, tax 5%
  Prod 2, 1 unit, 10.0 CHF, tax 5%
  Prod 3, 1 unit, 50.0 CHF, tax 5%

The total amount of the invoice is 64.95 CHF instead of 65.00 CHF, even
in a 'Round per line' configuration.

It happens because `compute_all` rounds the amounts following the number
of digits of the currency instead of using the `rounding` field.

Note that there is a discrepancy between the POS computation and the
Account computation: the POS already uses the `rounding` field instead
of the number of digits:

https://github.com/odoo/odoo/blob/80073c5430f0ab562dfc27572c108114161ebb25/addons/point_of_sale/static/src/js/models.js#L1855-L1991

opw-2341566

X-original-commit: 94353ebd6b47a286157f0559b194ff03ea49ff68
2020-10-14 17:24:31 +00:00
Jorge Pinna Puissant d5242066bd [FIX] account: do not set default account
Do not set a default `account_id` for section and note lines. Indeed,
when set the constraint `check_non_accountable_fields_null` will raise.

fine-tuning of c22f99dd09

opw-2357415
opw-2355559
opw-2359283

closes odoo/odoo#59988

X-original-commit: b6791a5183ef1015b47312785501a99ed68e5718
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2020-10-14 11:24:34 +00:00
Laurent Smet 07b407822c [FIX] account,l10n_lu: Fix default suspense account generation
closes odoo/odoo#59660

X-original-commit: fa5231983d1af929a26c83f5d64461cf657fc88a
Related: odoo/enterprise#13964
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2020-10-13 08:09:15 +00:00
Goffin Simon 5d5c460784 [FIX] account: Updating currency on Vendor bill
Steps to reproduce the bug:

- Enable Multi-Currencies and Multi-Companies
- Create a vendor bill
- Remove the default journal
- Set an other currencies

Bug:

A traceback was raised

opw:2350490

closes odoo/odoo#59546

X-original-commit: d9f8efcc330bc7454411aad3546de663424724f7
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2020-10-13 07:51:27 +00:00
wan a942e7561f [FIX] account: bill default invoice date context dependent
The date depends on the user's locale, and needs to be consistent with
the `date` field.

closes odoo/odoo#59580

X-original-commit: ed06aab626cb51b86b4178705b45bbcbfbf2c0f2
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2020-10-09 09:03:19 +00:00
Wolfgang Taferner 8dcc8bc217 [FIX] account: wrong implementation of journal account check
In case we have an account type which is allowed it is not needed to check the account allowed as it would fail although the account type is allowed before, so we need to do the check correctly as it was done in previous versions.

closes odoo/odoo#59547

X-original-commit: 220a1ffe69ddd9e4b45f31bf2911f1b6c3bfdfd7
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2020-10-08 16:31:31 +00:00
Goffin Simon d2b0488fd9 [FIX] account: Update invoice_partner_display_name
Steps to reproduce the bug:

- Open a customer invoice I
- Click on the partner P set on I
- Change the contact name of P
- Go to the list view of customer invoice

Bug:

The name of P was not updated.

opw:2354492

closes odoo/odoo#59507

X-original-commit: be5d72974ad89c985e413f0eb84352a00a6cd043
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2020-10-08 12:33:26 +00:00
nie e174a2cd64 [FIX] account: editable export, traceback on "Tax Cash Basis Entry of"
Steps to reproduce the bug:
- Select an invoice in the list
- Click Action -> Export
- Select "I want to update data (import-compatible export)"
- Click the field "Tax Cash Basis Entry of"

Bug:
Traceback

Cause:
Crashes because of a KeyError here: https://github.com/odoo/odoo/blob/2d860cdddf29b9fbd1a5401082c9f743028d2fb5/addons/web/controllers/main.py#L1743
The KeyError occurs because AccountPartialReconcile hasn't got a `name` field; `rec_name` is therefore `None`. Setting it to any field fixes the issue and `id` is the safest.

opw:2349511

closes odoo/odoo#59273

X-original-commit: 6327c86d0ea30bc056c6db320d0a1413d5807b10
Signed-off-by: backspac <backspac@users.noreply.github.com>
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-10-06 12:47:33 +00:00
Benjamin Frantzen (bfr) cc255de85b [FIX]account: added country_code related field in account.bank.statement
closes odoo/odoo#59266

Related: odoo/enterprise#13844
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2020-10-06 12:13:10 +00:00
Arnaud Joset 9ace056714 [IMP] account,sale: html field for terms & conditions
Before this commit, the terms and conditions could not be html formatted text.

closes odoo/odoo#56512

Taskid: 2304199
Related: odoo/upgrade#1689
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-10-06 10:26:56 +00:00
Laurent Smet fc1fbd3fcb [FIX] account: Fix traceback when opening auto entries with multilines
Introduced by:
https://github.com/odoo/odoo/commit/f9ef2c8cd980ecb9eee22d4cc43d5291953471ef

`self.id` is making an `ensure_one` raising a traceback when trying to open the wizard with more than one selected line.

closes odoo/odoo#59088

X-original-commit: 587c1d0f9bddd7bcc3d8d165d6d3073387dfe73f
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2020-10-05 10:58:38 +00:00
Martin Trigaux 2683184aa6 [FIX] *: fix all the typos
And other reported English mistakes in source string
Courtesy of Transifex translators

And remove leftover from gengo

closes odoo/odoo#59022

X-original-commit: 26efc84c5cac47a2cc83d7b084f8b71528fec6c7
Related: odoo/enterprise#13781
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-10-05 09:36:34 +00:00
Nicolas (vin) c8f029744b [FIX] account: Fix automatic wizard issues
When coming from the dashboard (dashboard => Bills to pay => Bill)
The context contains information about the purchase journal and not the
move line, causing an issue in the wizard. This change will make sure
the context always contains the necessary move line information

Task id #2344722

closes odoo/odoo#58835

X-original-commit: f9ef2c8cd980ecb9eee22d4cc43d5291953471ef
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2020-09-29 14:53:57 +00:00
Nicolas Martinelli 67d632a565 [FIX] account: mail alias creation
- Install accounting
- Create a company with a '.' as last character of the name, e.g. 'Test
  Inc.'
- Set the Fiscal Localization for the company

An error occurs: "You cannot use anything else than unaccented latin
characters in the alias address."

This happens because we try to create the alias `test-inc..inv`: `..` is
not allowed by the RFC 3696.

We replace the `.` by `-` which is a supported character in the
localpart.

opw-2347965

closes odoo/odoo#58904

X-original-commit: 5053183ac7612d9cf2247b84ec6e0aac5974fd85
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-09-30 16:33:17 +00:00
Ivan Yelizariev 3007e72333 [FIX] account: correct hint about fiscal position countries
Only delivery address actually matters:
https://github.com/odoo/odoo/blob/f9da0a6c80ae68283f4ef9af736253352ff4e1d4/addons/account/models/partner.py#L158-L162

closes odoo/odoo#58685

X-original-commit: a08f0721e853854c7e97f5060fc39fccb4b6b4e5
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-09-28 14:06:59 +00:00
Nicolas (vin) 7c43d19c5a [IMP] account : Show company name on dashboard in multi-company
In a multi-company environment it can be difficult to see which journal
is from which company on the dashboard, when multiple company have been
selected.

This commit will update the dashboard to show the company names on the
journals in those cases

Task id #2337719

closes odoo/odoo#58574

X-original-commit: 64402d92e8e96350a909bd77818e70c40bdd29ae
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2020-09-28 10:10:14 +00:00
fw-bot dd2ac143f7 [FIX] account: cash basis taxes: set move lines as tax_exigible=False only when some other line has a payable or receivable account in the move.
Before that, making a misc operation with cash basis taxes always set the move lines as tax_exigible=False (or at least, it was supposed to, see below). This was wrong, as if the move did not contain any payable/receivable account, it would result in no cash basis move being ever created, and so the entry would never affect the tax report.

Additionnally, the tax line was wrongly managed for cash basis taxes on misc entries, as vals.get('tax_ids') returned an ORM command, so a non-False value, even when the tax_ids field was empty. this caused the condition to execute and to reassign taxes to an empty list, which then caused tax_exigible not to be set to False, even when it should.

X-original-commit: https://github.com/odoo/odoo/commit/2437eb0691d07f92094152b84c96a2149c8f4fd8

[FIX] account: make tax exigible correct in cases where the move lines are created separetely from the move.

Additional fix on top of https://github.com/odoo/odoo/commit/02fe997932070cc101a96eb869023702c224318b

Also, add tax_exigible to the form view of account.move.line, as it will not be computed automatically anymore when modifying a single line in draft state through its form view. It now needs to be manually changed in case the user wants to change something having an impact on it through this form (note that this is absolutely not a typical use case).

closes odoo/odoo#58260

X-original-commit: 867797e4983b704599be7943490fc6f071d8c0b7
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2020-09-22 16:00:14 +00:00
Julien CastiauxandThong Le 33bd1a951a [FIX] account,mail: default purchase mail alias non-ascii
* Change the `addons/account/i18n/vi.po` PO file to replace the
translation of `Vendor Bill` like msgids from `Công nợ nhà cung cấp`
to ` by `Hóa đơn Nhà cung cấp`, there should be 3. What's matter is
the `đ` character.
* Create a brand new Vietnamese database (using `-l vi_VN` and
`--load-language=vi_VN`)
* Install Invoicing (`account`), an email alias constraint is raised.

> You cannot use anything else than unaccented latin characters in the
> alias address.

During the installation of the invoicing module, an email alias is
created for every journal account of purchase type. The alias is created
using the current journal name. Here the journal name is `Hóa đơn Nhà
cung cấp`, as mail aliases should only contain ascii characters, we
attempt to remove the accents. The `tools.misc.remove_accents`
successfully remove most of them but the `đ` character is left as-is,
the final alias is `hoa-đon-nha-cung-cap` which is invalid as it
contains some non-ascii characters.

The `remove_accents` function uses the [NFKD] Unicode Compatibility
Decomposition Normalization Form. This normalization process unify all
abstract equivalent characters, i.e. characters only different by font
or rotation. While this normalization process helps to transcript a lot
of characters to their ascii compatibility equivalent, some 118,230
other non-ascii characters (mainly from the Chinese and Japanese scripts)
are left as-is as they lack an ascii compatibility equivalent.

The solution has been to not use the journal name but rather the journal
code or journal type as email alias when the name is unsafe. The journal
code is a short version of the name, the journal type is not
translatable so is always ascii.

One additional watchdog has been added to the sanitization function of
email aliases so non-ascii characters are replaced with a '?' which is
an authorized character in emails local-part.

[NFKD] https://unicode.org/reports/tr15/

Closes #55492
Closes #55493

closes odoo/odoo#58279

X-original-commit: 8dc85be3821cf26226cd0bf4ce2b6739e68fc66f
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>
Co-authored-by: Thong Le <thongthele@users.no-reply.github.com>
2020-09-22 19:21:08 +00:00