Commit Graph
87 Commits
Author SHA1 Message Date
Yannick TivisseandVictor Feyens 18952cdc76 [IMP] *: Convert single create method into multi
Taskid: 2703085
Part-of: odoo/odoo#80824
Co-authored-by: Victor Feyens <vfe@odoo.com>
2021-12-14 19:13:18 +00:00
Nicolas (vin) c1693581d7 [IMP] account: payment method improvements
To improve the payment method system, proceed to a few changes
such as changing the view a bit, making sure payment acquirers are not
linked to a journal by default and that only the manual payment method
type can be used multiple times in a single journal.

Task id #2573145

closes odoo/odoo#73596

X-original-commit: 9122b367baea10e59b66e45bf7c458a6f1e82efb
Related: odoo/enterprise#19623
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2021-07-12 18:10:36 +00:00
fw-bot 45b378f1f0 [FIX] account_check_printing: wizard use vendor payment method
The payment method added by account_check_printing is meant as:

> Preferred payment method when paying this vendor. This is used to
> filter vendor bills by preferred payment method to register payments
> in mass. Use cases: create bank files for batch wires, check runs.

But it may also select the default payment method on an account.payment.

With this changeset, we copy what is done in account.payment to
account.payment.register so the behavior is the same for it.

forward-port of #72655

opw-2508263

X-original-commit: a546e7e870987e882ab2c9a6fa2618476b76fcb8
2021-06-28 17:01:51 +00:00
Nicolas (vin) 04522f01e6 [IMP] account: allows multiple payment acquirers on a journal.
Users may want to be able to have transactions coming from multiple
payment acquirers to be registered in the same journal.

This will allows that.

Task id #2414749

closes odoo/odoo#67331

Related: odoo/upgrade#2500
Related: odoo/enterprise#17258
Signed-off-by: William André (wan) <wan@odoo.com>
2021-06-03 10:00:26 +00:00
Goffin Simon 5ba579dbcb [FIX] account_check_printing: Only administrator can print checks
Steps to reproduce the bug:

- Let's consider a user U not in group group_system
- Log with U
- Create a vendor payment with payment method Checks
- Print it

Bug:

An access error was raised because U didn't have the rights to write on model ir.sequence

opw:2513014

closes odoo/odoo#70062

X-original-commit: 11376c88e0068a0bece0b0b56ffd4a9f296ffb87
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2021-04-28 19:10:34 +00:00
Andres Calle 176bf1442b [FIX] check number not assigned correctly
When printing a check from a payment the check number wizard shows the
number 1 for the next check... it should show the last check added one
+1, it doesn't because it doesn't exclude the account.payments without
checknumber.

This fix excludes the account.payments without checknumber so that it
doesn't shows "1" as the next check number when there are multiple new
checks to be printed

X-original-commit: adfb8299141cb8fe9883741c43871a51f849655e
2021-04-03 10:18:26 +00:00
Laurent Smet 6ffed37585 [FIX] account_check_printing: Fix 'amount_currency' field don't exist on account.partial.reconcile
Since https://github.com/odoo/odoo/commit/beccf82e09d536255d9d9cb9bfe58ebae2559843, 'amount_currency' is now 'debit_amount_currency' / 'credit_amount_currency'.

closes odoo/odoo#67645

Opw: 2444189
X-original-commit: 5e2c9badae8fa50cabd432d2b525278e95432e80
Signed-off-by: Josse Colpaert <jco@openerp.com>
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2021-03-11 09:32:48 +00:00
Andrea Grazioso (agr-odoo) 6a16578323 [FIX] account_check_printing: checks to print does not update
1. Go to Settings > Accounting and set a Check layout
2. Go to Accounting > Vendors > Payments
3. Create 2 payments to Vendors, and Confirm (but do not print).
  - Payment Type: Send money
  - Partner Type: Vendor
  - fill in any Amount
  - Payment Method: Checks

4. Go to the accounting dashboard, click on "2 checks to print"
5. Select both payments and print the checks from the Actions menu
6. Refresh the page.

Both payments still show up with the "Checks to print" search filter
enabled. They also shows up in Accounting dashboard as checks to print

opw-2427523

closes odoo/odoo#64908

X-original-commit: 8ad9c16d7b10da17795c805b0541f0a3a9256dc4
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
2021-01-22 10:35:38 +00:00
Ivan Yelizariev 4449e0a0e7 [FIX] account_check_printing: always compute "amount in words"
the field can be used in reports for any payment method

---

opw-2423290

closes odoo/odoo#64105

X-original-commit: c37afdf3e9f680cd186872e509c6ab8e47b70782
Signed-off-by: Ivan Yelizariev // IEL <yelizariev@users.noreply.github.com>
2021-01-05 17:20:06 +00:00
Goffin Simon 77e935f02b [FIX] account_check_printing: Check number in Payment
Steps to reproduce the bug:

- Let's consider a bank journal BJ with manual numbering activated
- Create a customer payment CP using BJ as journal and confirm CP
- Create a vendor payment VP using BJ as journal, select Check as payment method
- A Check Number with 0001 is automatically assigned to VP
- Confirm or save VP

Bug:

An error was raised saying that:

The following numbers are already used: 0001

PS: When creating the customer payment, a check number was assigned to CP even if
customer payment has nothing to do with check numbers

opw:2415170

closes odoo/odoo#63372

X-original-commit: f01eb942716800921148b5de8d6bc4140d122912
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2020-12-15 10:06:19 +00:00
Adrien Widart aa00c30c18 [FIX] account_check_printing: print check of payment group
When some bills are not paid, some with due date, some without, when registering the payment of these bills as a group payment with checks, it is not possible to print the check

To reproduce the error:
(Need account)
1. Go to Invoicing > Vendors > Bills
2. Create a new one
    - Add at least one line
    - Add the Payment Terms
3. Save & Post
4. Duplicate it, then Save & Post
5. Go back to Bills
6. Select the two bills
7. Click on Action > Register Payment
8. Select Checks, enable Group Payment
9. Click on Create Payment
10. Click on Print Check
11. Click on Print

=> An Odoo Error is raised

The user should be able to print it.

OPW-2389368

closes odoo/odoo#62391

X-original-commit: 4dc4dc3d20114bea54266d97de29565a1a1ac230
Signed-off-by: adwid <adwid@users.noreply.github.com>
2020-11-26 13:07:00 +00:00
Moisés López e332320e64 [IMP] account_check_printing: speed up dashboard w/ index
Install "account_check_printing" module
Open "Accounting" icon from the main menu
It opens the journal dashboard by default

It runs the following search domain in account.payment model:
    domain = [
        ...
        ('payment_method_id.code', '=', 'check_printing'),
        ...
    ]

It runs the following query:
    SELECT "account_payment".id
    FROM "account_payment"
    WHERE ...
        AND  ("account_payment"."payment_method_id" in ($2)))
        ...

The average duration of this query is 37ms

It query is ran for each journal created
If you have created 600 journals (real case) so it will run 600 times
It will spend more than 22 seconds opening this dashboard
After that, you are available to create accounting actions since that
the menu is not available before of this dashboard
So, it is important to open it faster

Creating the following index:
    - account_payment(payment_method_id)

The average duration of the last query is reduced to 0.935ms instead.
It means, it will spend 0.5s opening this important dashboard with 600 journals

44x faster

closes odoo/odoo#56831

Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
2020-09-01 23:41:42 +00:00
Victor Feyens df3e0a7351 [IMP] account_check_printing: improve journal statistics computation performances
PURPOSE

Improve performances of various Odoo code bits.

SPECIFICATIONS

Use a read_group to compute number of checks to print, using a search_count
instead of a search.

LINKS

Task ID-2281297
PR odoo/odoo#53053
PR odoo/enterprise#11299

X-original-commit: 7035b99b09152f224e74eed7d6b67a8ab04fdce8
2020-08-24 17:40:04 +00:00
wan 8129aa40db [IMP] account{,_check_printing}: usability
Task 2005940

account:
* Use stored compute methods instead of default for
  {out,in}bound_payment_method_ids
* Track is_move_sent in the chatter
* Split 'Invoices' and 'Bills' in the smart button of payment form
* Because account.payment.method can be shown on the res.partner form,
  we need to relax the security level to readonly for all users

account_check_printing:
* Add the preferred payment method for partners, with a related on
  account move allowing to do a group by and doing payments in batch
* Add a constraint to forbid twice the same check number in the same
  journal
* The amount in words is now readonly to prevent typos and mismatches
  with the amount in digits
* Remove the field `check_number_int`. The check number is kept as Char
  so that '000012345' is not displayed (and printed) as '12,345' but it
  is parsed so that comparison and incrementation are possible.

closes odoo/odoo#56179

Related: odoo/upgrade#1669
Related: odoo/enterprise#12527
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2020-08-21 07:46:07 +00:00
Goffin Simon da28fd8815 [FIX] account_check_printing: Wrong payment currency symbol
Steps to reproduce:

- Let's consider a company C in $
- Create a ventdor bill VB of 100$
- Validate VB and register a payment with a check in €
- Print the check

Bug:

The symbol of the currency of the payment was $ instead of €

opw:2314005

closes odoo/odoo#55813

X-original-commit: f05bd107aca192cd7e4b4ab84d0a3e61e932a241
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2020-08-12 13:42:44 +00:00
william 82dc0cb7b9 [IMP] account: soft post entries in the future
Add an easy way to not post the entries in the future when calling
post() on it, but rather set it to be auto-posted at accounting date.
This is useful when we are creating a lot of entries in batch and some
might be in the future, some in the past, and we don't want to separate
that in two batch every time. (asset, accrual, transfer,... )
2020-08-05 11:57:10 +00:00
bfr-o d935f9b77e [FIX] account_check_printing: Fix xml_id not found in '_compute_check_amount_in_words'
When the model is loaded, the value of 'check_amount_in_words' is computed for each existing payment.
It could lead to a traceback if the second condition is reached referencing an xml_id that is not yet loaded.
Indeed, data are loaded after the models.

X-original-commit: a9234e7581f267c64c4bf19d93e7b6844fe4d0b4
2020-07-03 15:53:29 +00:00
Laurent Smet caeb782841 [IMP] account,*: Improve bank statements/payments workflow
- Create journal entries as soon as bank/cash statement lines are created, temporary booked on a suspense account set on the journal.
- Simplify the management of "blue" lines in the reconciliation widget. A "blue" line is now a journal item using a temporary liquidity account (outstanding payment/receipt accounts, set on the journal).
- Adapt and simplify the bank reconciliation report.
- Remove the bank reconciliation threshold date. The reconciliation report will show the not already reconciled journal entries using a liquidity account and the not already reconciled journal entries using a temporary liquidity account. Without accounting, an account.payment will involve directly the liquidity account and then, will be considered as a statement line directly.
- Remove the post_at bank reconciliation feature. The "paid" state will be set on the invoices only if reconciled with a journal entry involving the journal's liquidity account.
    With invoicing, the payment will do that so the "in_payment" state should never be shown up.
    With accounting, only the statement lines have the power to move an invoice to the "paid" state.
- Fix various corner cases about the management of multi-currency in bank statement lines.
- Fix the conversion dates in multi-currency: Since the bank/cash is always used on the statement lines, it will use always the real "bank" date instead of the fictive payment one.
- Ensure the 'reconcile' method will raise an error if the involved moves are not posted.

related enterprise PR odoo/enterprise#7019

closes odoo/odoo#41301

--task: 2092096
Related: odoo/upgrade#1018
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2020-04-10 09:47:24 +00:00
Ravi Gohil d2bd6d69d6 [IMP] account{_check_printing}: Added 'Country Code' field
Many localization modules adds field 'l10n_xx_country_code' on
Company/Settings views with the purpose of using it to hide that
particular localization's fields from other country's users.
So, it is better to add a common field in account module so that
other localization can use that field instead of adding a new one
where ever it is required.

Also, one such field was already added from account_check_printing
module, so we removed it from there as it is not needed anymore.

Task: 2049977
Closes: #35755
Related: odoo/enterprise#5158
2020-03-24 06:51:22 +00:00
Thibault Delavallée 215b2fffa2 [FIX] account_check_printing: do not set account_check_printing_layout as required
Adding required fields on company model is annoying for tests. Indeed multi
company tests may run during module installation, notably in CRM. Those tests
generally require to create a new company which is not possible if the column
is required but module not already loaded in registry. This is the case
if for example account_invoice_extract is installed and updating CRM
when testing website_crm_score.

When possible, avoid required fields on a such used model as company. In this
case we simply make the field required in the view, and handle a void value
as the default disabled one, leading to no functional change.

closes odoo/odoo#48059

Related: odoo/enterprise#9381
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-03-19 17:13:30 +00:00
Ankita Raval d675dbaa4c [IMP] account,* : Change type field to move_type in account.move
task-id: 2028z813
2020-02-19 09:09:20 +00:00
Andrea Grazioso (agr-odoo) c8e862249e [IMP] account_check_printing: store check number also as int
Go to Accounting > Vendor Bill, pay via check, view the invoice and
click on 'Print Check'. The widget will popup but as the 'next check
number' will always display 1.

This append because the model of account_payment has changed
https://github.com/odoo/odoo/blob/13.0/addons/account_check_printing/models/account_payment.py#L28
and now check_number is a char so it will not sorted correcly by the
database.

To avoid doing a lot of strings manipulation it is convenient to
store the check number as integer, with proper default case

Followup of opw 2151242

closes odoo/odoo#41659

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-12-12 09:00:18 +00:00
Ravi Gohil 3b4592acfc [IMP] account_check_printing: make check printing generic
Now, if user intends to add a check layout for it's own country then he/she
will need to define a layout template and a report action associated to it.
The xmlID(s) of this report action(s) needs to set as key of
'account_check_printing_layout' selection field after redifining
it in it's own module.

Refer l10n_{ca/us}_check_printing modules.

closes odoo/odoo#35438

Task: 2030714
Closes: 35438
Related: odoo/enterprise#5007
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-12-03 05:44:04 +00:00
wan 9ba8734f15 [MOV] account: reconciliation widget
Task 2034073
The reconciliation widget is now entirely part of the enterprise version
as it is an advanced accounting feature

closes odoo/odoo#38424

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-10-18 12:53:41 +00:00
Julien Castiaux e7506b88d2 [FIX] *: replace openerp addons import by odoo
Importing addons using the `openerp` anchor is depreciated by #36597
2019-09-20 05:58:41 +00:00
Christophe Simonis 5a273e74f0 [MERGE] forward port branch saas-12.4 up to fe59754c52
closes odoo/odoo#36721

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-09-13 13:32:51 +00:00
Christophe Simonis 51354fadb0 [MERGE] forward port branch saas-12.3 up to 50e571acf7
closes odoo/odoo#36491

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-09-11 09:39:33 +00:00
Christophe Simonis 545e6d2034 [MERGE] forward port branch 12.0 up to 52f6e38cea 2019-08-30 17:20:28 +02:00
Christophe Simonis 8bd6a93c74 [MERGE] forward port branch saas-11.3 up to ede253f1b2 2019-08-29 16:45:15 +02:00
Christophe Simonis 838b3f2d82 [MERGE] forward port branch 11.0 up to 1385b60004 2019-08-27 16:06:01 +02:00
Nicolas Martinelli e0c7a36858 [FIX] account_check_printing: set the amount in words
- Create a vendor payment by check
- Remove the amount in words
- Confirm

It is impossible to set the amount to print the check.

We add an action button to recompute the amount in words. It is only
visible when the amount is not set.

opw-2046339

closes odoo/odoo#35968

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-08-22 12:14:18 +00:00
Laurent Smet beaa30a3d1 [IMP/REF] accounting-pocalypse yeaaahh
This commit merges the following models
 * account.invoice and account.move
 * account.invoice.line and account.move.line
 * account.voucher and account.move
 * account.voucher.line and account.move.line

It was the opportunity for a big cleanup of the code, so it also restructures the whole account module, its different models/fields, the tests etc. for a better world and a better code readability.

==== Rationale ====
The rationale of this huge change is that we want journal entries / invoices to be easily edited, and changes reflected in the other model. It's a HUGE feature and very strategic for the fiduciary companies. For example, changing the account of a journal entry needs to be automatically reflected on the related invoice.

The same reasoning applies to sale/purchase vouchers.

==== Changes made in features =====
When creating an invoice, you are now creating a journal entry directly.
--> The object account.invoice no longer exists.
In the same fashion when creating an invoice line, you're now adding journal items directly in the journal entry representing the invoice. If this invoice line has some tax, it may create additional journal items as well.
--> The models account.invoice.line & account.invoice.tax no longer exist

Identically, when creating a sale/purchase receipt with its lines, you are now creating a journal entry directly and there's no more usability difference between encoding a receipt or an invoice.
--> The object account.voucher no longer exists.
--> The object account.voucher.line no longer exists.
--> The whole account_voucher module no longer exists.

Positive side-effects coming from these changes are
* draft invoices/bills/sale or purchase receipts now create a draft accounting entry. Validate these objects now simply post its journal entry. That means that draft invoices/bills/sale or purchase receipt can straightforwardly be included in reporting or budgets.
* opening a journal entry in form view will now always open the correct view: if it's a sale/purchase journal entry we will have a customer invoice/vendor bill view or a sale/purchase receipt view, whatever the menu we're coming from.
* code & business logic simplification. It is also condensed in a single place instead of being partially duplicated on invoices, vouchers and journal entries.

There should be no feature loss, except the one allowing to group multiple journal items together based on the same product during the invoice validation.

==== Changes made in models =====
* account.invoice: model removed. Instead, now use account.move with following mapping

field (account.invoice) 		field (account.move)
-----------------------			--------------------
name 					invoice_payment_ref
number 					name
reference 				ref
comment 				narration
user_id 				invoice_user_id
amount_					total_company_signed amount_total_signed
residual 				amount_residual
state 					state + invoice_payment_state 		/!\ selection changed
date_invoice 				invoice_date
date_due 				invoice_date_due
sent 					invoice_sent
origin 					invoice_origin
payment_term_id 			invoice_payment_term_id
partner_bank_id 			invoice_partner_bank_id
incoterm_id 				invoice_incoterm_id
vendor_bill_id 				invoice_vendor_bill_id
source_email 				invoice_source_email
vendor_display_name 			invoice_vendor_display_name
invoice_icon 				invoice_vendor_icon
cash_rounding_id 			invoice_cash_rounding_id
sequence_number_next 			invoice_sequence_number_next
sequence_number_next_prefix 		invoice_sequence_number_next_prefix

'invoices' subset of account.move can be accessed by using the selection field 'type' or one of the many helpers like is_invoice()

* account.move: now has a valid state 'cancel' that has to be excluded from all business logic
* account.move: field 'amount' renamed into 'amount_total'
* account.move: field 'reverse_entry_id' renamed into 'reversed_entry_id'
* account.move.line: now has a field 'display_type' that has to be excluded from all business logic, in order to support invoice layouting
* account.invoice.line: model removed. Instead, now use account.move.line with following mapping

field (account.invoice.line) 		field (account.move.line)
----------------------------		-------------------------
invoice_id 				move_id
uom_id 					product_uom_id
invoice_line_tax_ids 			tax_ids
account_analytic_id 			analytic_account_id

'invoice lines' subset of all account.move.line from a journal entry can be accessed by using the boolean field 'exclude_from_invoice_tab'

* account.invoice.tax: model removed. Instead, now use account.move.line with following mapping

field (account.invoice.tax) 		field (account.move.line)
---------------------------		-------------------------
invoice_id 				move_id
account_analytic_id 			analytic_account_id
amount 					price_unit
base 					tax_base_amount

'tax lines' subset of all account.move.line from a journal entry can be accessed by using the relational field 'tax_line_id'

* account.invoice.confirm: model removed. Instead, now use the 'post()' function of account.move
* account.invoice.refund: model removed. Instead, now use account.move.reversal to reverse the entries with the same options as we had for invoices
* account.voucher: model removed. Instead, now use account.move of type in ['out_receipt', 'in_receipt]
* account.voucher.line: model removed. Instead, now use account.move.line

==== Changes made in functions ====
* on account.move, method _run_post_draft_to_post() renamed into _autopost_draft_entries()
* on account.move, method action_account_invoice_payment() renamed into action_invoice_register_payment()
* on account.move, method action_invoice_reconcile_to_check() renamed into action_open_matching_suspense_moves()
* on account.move, method _get_domain_edition_mode_available() renamed into _get_domain_matching_supsense_moves()
* on account.move, method _get_intrastat_country_id() renamed into _get_invoice_intrastat_country_id()
* on account.move.line, method _get_domain_for_edition_mode() renamed into _get_suspense_moves_domain()
* in account.bank.statement, contextual key 'edition_mode' renamed into 'suspense_moves_mode'

Was task 1917430
2019-06-28 11:52:55 +00:00
Adrian Torres 4b38cc6590 [REM] *: calls to @api.multi
Multi is the default api for methods, it is not necessary to explicitly
decorate methods with it, adds clutter and most people use it because
they see that the rest of the code uses it.

Done with `find . -type f -name '*.py' | xargs sed -i '/@api.multi/d'`
2019-07-17 14:13:12 +02:00
Adrian Torres 9e71d57d11 [REM] *: remove calls to api.one and adapt code
Adapt all code that was using `api.one` to recordset-style method and
remove any and all calls to `api.one` in preparation for its removal.
2019-07-05 09:04:45 +00:00
Laurent Smet bc131c0cfb [MERGE] manual forward port of accounting-pocalypse (beaa30a3d1)
This commit merges the following models
 * account.invoice and account.move
 * account.invoice.line and account.move.line
 * account.voucher and account.move
 * account.voucher.line and account.move.line

It was the opportunity for a big cleanup of the code, so it also restructures the whole account module, its different models/fields, the tests etc. for a better world and a better code readability.

==== Rationale ====
The rationale of this huge change is that we want journal entries / invoices to be easily edited, and changes reflected in the other model. It's a HUGE feature and very strategic for the fiduciary companies. For example, changing the account of a journal entry needs to be automatically reflected on the related invoice.

The same reasoning applies to sale/purchase vouchers.

==== Changes made in features =====
When creating an invoice, you are now creating a journal entry directly.
--> The object account.invoice no longer exists.
In the same fashion when creating an invoice line, you're now adding journal items directly in the journal entry representing the invoice. If this invoice line has some tax, it may create additional journal items as well.
--> The models account.invoice.line & account.invoice.tax no longer exist

Identically, when creating a sale/purchase receipt with its lines, you are now creating a journal entry directly and there's no more usability difference between encoding a receipt or an invoice.
--> The object account.voucher no longer exists.
--> The object account.voucher.line no longer exists.
--> The whole account_voucher module no longer exists.

Positive side-effects coming from these changes are
* draft invoices/bills/sale or purchase receipts now create a draft accounting entry. Validate these objects now simply post its journal entry. That means that draft invoices/bills/sale or purchase receipt can straightforwardly be included in reporting or budgets.
* opening a journal entry in form view will now always open the correct view: if it's a sale/purchase journal entry we will have a customer invoice/vendor bill view or a sale/purchase receipt view, whatever the menu we're coming from.
* code & business logic simplification. It is also condensed in a single place instead of being partially duplicated on invoices, vouchers and journal entries.

There should be no feature loss, except the one allowing to group multiple journal items together based on the same product during the invoice validation.

==== Changes made in models =====
* account.invoice: model removed. Instead, now use account.move with following mapping

field (account.invoice) 		field (account.move)
-----------------------			--------------------
name 					invoice_payment_ref
number 					name
reference 				ref
comment 				narration
user_id 				invoice_user_id
amount_					total_company_signed amount_total_signed
residual 				amount_residual
state 					state + invoice_payment_state 		/!\ selection changed
date_invoice 				invoice_date
date_due 				invoice_date_due
sent 					invoice_sent
origin 					invoice_origin
payment_term_id 			invoice_payment_term_id
partner_bank_id 			invoice_partner_bank_id
incoterm_id 				invoice_incoterm_id
vendor_bill_id 				invoice_vendor_bill_id
source_email 				invoice_source_email
vendor_display_name 			invoice_vendor_display_name
invoice_icon 				invoice_vendor_icon
cash_rounding_id 			invoice_cash_rounding_id
sequence_number_next 			invoice_sequence_number_next
sequence_number_next_prefix 		invoice_sequence_number_next_prefix

'invoices' subset of account.move can be accessed by using the selection field 'type' or one of the many helpers like is_invoice()

* account.move: now has a valid state 'cancel' that has to be excluded from all business logic
* account.move: field 'amount' renamed into 'amount_total'
* account.move: field 'reverse_entry_id' renamed into 'reversed_entry_id'
* account.move.line: now has a field 'display_type' that has to be excluded from all business logic, in order to support invoice layouting
* account.invoice.line: model removed. Instead, now use account.move.line with following mapping

field (account.invoice.line) 		field (account.move.line)
----------------------------		-------------------------
invoice_id 				move_id
uom_id 					product_uom_id
invoice_line_tax_ids 			tax_ids
account_analytic_id 			analytic_account_id

'invoice lines' subset of all account.move.line from a journal entry can be accessed by using the boolean field 'exclude_from_invoice_tab'

* account.invoice.tax: model removed. Instead, now use account.move.line with following mapping

field (account.invoice.tax) 		field (account.move.line)
---------------------------		-------------------------
invoice_id 				move_id
account_analytic_id 			analytic_account_id
amount 					price_unit
base 					tax_base_amount

'tax lines' subset of all account.move.line from a journal entry can be accessed by using the relational field 'tax_line_id'

* account.invoice.confirm: model removed. Instead, now use the 'post()' function of account.move
* account.invoice.refund: model removed. Instead, now use account.move.reversal to reverse the entries with the same options as we had for invoices
* account.voucher: model removed. Instead, now use account.move of type in ['out_receipt', 'in_receipt]
* account.voucher.line: model removed. Instead, now use account.move.line

==== Changes made in functions ====
* on account.move, method _run_post_draft_to_post() renamed into _autopost_draft_entries()
* on account.move, method action_account_invoice_payment() renamed into action_invoice_register_payment()
* on account.move, method action_invoice_reconcile_to_check() renamed into action_open_matching_suspense_moves()
* on account.move, method _get_domain_edition_mode_available() renamed into _get_domain_matching_supsense_moves()
* on account.move, method _get_intrastat_country_id() renamed into _get_invoice_intrastat_country_id()
* on account.move.line, method _get_domain_for_edition_mode() renamed into _get_suspense_moves_domain()
* in account.bank.statement, contextual key 'edition_mode' renamed into 'suspense_moves_mode'

Was task 1917430
2019-07-01 13:45:57 +02:00
Hiral Bhavsar 3cd7ed07a2 [IMP] *: remove 'view_type' on window actions.
The old tree views don't really exist anymore, this odd pseudo-flag to
dispatch between "list" and "tree" tree views has no reason to remain.

Task 1937686

closes odoo/odoo#31243

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2019-06-17 11:34:17 +00:00
Christophe Simonis 3f95b074e9 [MERGE] forward port branch saas-12.2 up to f2be461f09 2019-04-05 18:46:10 +02:00
Christophe Simonis f2be461f09 [MERGE] forward port branch saas-12.1 up to f2d0995362 2019-04-05 10:50:56 +02:00
wan 3c2e3b8c5a [REF] account: simplification of payments objects
simplification of payments objects and refactoring of the code

* registering payment(s) from the list of invoice now generate a single payment per invoice selected
* no more abstract object for payments/payment wizard as the logic is now really simple:
    - group_invoices option is now removed and we never try to group payments based on the currency/customer of whatsoever (see above),
    - the payment amount is the full residual amount of invoice and users cannot change it anymore
* partner_bank_account_id not required as soon as visible (depends on the payment method)
* refactoring to name tags and allow easier inheritance via xpath

part of task #1918423
2019-04-04 10:42:41 +00:00
Lucas Perais (lpe) 491deeb3d4 [FIX] account, account_check_printing: print all reconciled invoice on a payment
Make some invoices
Make a payment
Reconcile it with the invoices through the reconciliation widget
Print the payment receipt and the checks

Before this commit, neither the payment receipt nor the checks contained
the invoices
This was because the prints relied on only the field invoice_ids
filled specifically when registering a payment on an invoice

After this commit, the prints mention the invoices

OPW 1947002

closes odoo/odoo#32365

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-04-03 13:24:59 +00:00
Christophe Simonis 28cce6ce3a [MERGE] forward port branch saas-12.1 up to c0cf4049b2 2019-03-29 19:47:46 +01:00
Goffin Simon 6edd699ee9 [FIX] account_check_printing: Error when clearing the currency
Steps to reproduce the bug:
- Activate multi currencies on your user
- Let's consider currency A and currency B and currency A is the one set on your company
- Create a customer invoice I with currency B
- Go on the tree view of customer invoices and select I
- Click on "Action" and select "Generate an invoice"
- On the wizard, clear the currency B

Bug: A traceback was raised because the function amount_to_text requires a currency.

opw:1958888

closes odoo/odoo#32202

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-03-28 10:45:12 +00:00
wan 4bad80b346 [IMP] account_check_printing: filter reconciliation with check number
Task 1881964
Allow to search for counterparts with a check number

closes odoo/odoo#31095
2019-02-14 09:22:05 +00:00
Jaykishan SolankiandRavi Gohil 7c6b8baf03 [IMP] account, point_of_sale,...: Improve usability
- Improve warning message when user tries to create credit note
- Hide 'Active' column in Taxes/Currencies and added default 'Active' filter in Taxes
- Removed 'save this page...' under 'Account Follow-up Levels','Budget Management',
  'Asset Management','Deferred Revenues Management' section in Accounting Settings
- Fixed margin between Cash Rounding checkbox and it's link in Accounting Settings
- Renamed action menu 'Confirm Payments' to 'Post Payments' for payments to make it
  consistent with it's form view
- Hide payment acquirers config for non-adviser users and also restric editing access
  rights for non advisior and employee user (only data read access rights on payment acquirers)
- Renamed Journal type from 'Sale' to 'Sales' and journals 'POS Sale Journal, Stock Journal,
  Cash Basis Tax Journal to Point of Sale Journal, Inventory Valuation Journal and Cash Basis
  Taxes Journal respectively
- Renamed the stat button 'Entries' to 'Items' for account assets form view
- Improved description and name of account_voucher module
- Improved Menu typo, Purchase Receipts to Purchases Receipts
- account_check_printing, hr_expense_check: made field storing check numbers character
  instead of integer, integer field for check numbers shows check numbers as amount
  (i.e., with thousand separator) on UI, which is wrong, hence replaced it with character
  type field and a constraint to allow only numbers to be stored in it.

TaskID: 40157

Co-authored-by: Ravi Gohil <rgo@odoo.com>

closes odoo/odoo#21982
2019-02-06 11:57:29 +00:00
Christophe Simonis d96c42ea88 [MERGE] forward port branch 11.0 up to 22637aadec 2019-01-03 15:31:05 +01:00
Sanjay Jamod 03b0e153ac [FIX] account_check_printing: Fix traceback on onchange
Method amount_to_text() having self.ensure_one(), it should not be
called with empty recordset

Closes #29854

closes odoo/odoo#29865
2019-01-02 14:46:07 +00:00
Christophe Simonis ec9400821e [MERGE] forward port branch saas-11.3 up to 27a084eb81 2019-01-04 14:54:08 +01:00
Joren Van Onder 5ae32d659b [FIX] account_check_printing: allow users to configure check layout
52a8ed3c0c made related fields readonly by default. 3f4f77fd9d
attempted to identify all fields that needed readonly=False but missed
this one.

closes odoo/odoo#28343
2018-11-01 23:06:56 +00:00
Adrian Torres 3f4f77fd9d [REF] *: adapt code to new related default behaviour
This commit adapts the business code to changes introduced by
the parent commit in order to keep the same behaviour as before.

All readonly=False fields will have to be checked afterwards to confirm
that the business case requires write access to the source field.
2018-09-27 12:10:23 +02:00
Olivier Colson 87f0d2eefb [REF] account, account_check_printing, payment, l10n_do, l10n_de, l10n_fr, l10n_nl, l10n_mx: chart templates installation: remove old useless wizards and move everything to account.chart.template
Was task 1858974
Was PR https://github.com/odoo/odoo/pull/25243
2018-08-07 17:11:08 +02:00