Commit Graph
171 Commits
Author SHA1 Message Date
Bonis Modi 880576c1a5 [FIX] sale,account: Fix the alignment of matadata in sale/invoice report
Currently, When viewing the 'Quotation / Order OR invoice' report in pdf,
the metadata fields are correctly aligned next to one another but not
aligned in html/studio view.

So in this commit, col-auto will apply the width 100% in html
due to that the metadata fields are comes in new line. so apply the
class col-3 so each field should come in single line in html with
flex.

closes odoo/odoo#63013

Taskid: 2369335
X-original-commit: 484bcef82cec785b9917634680dea90cb56247e4
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-12-08 12:19:25 +00:00
Nasreddin (bon) 17bee9e723 [FIX] account, l10n_ar, l10n_cl: web_studio broken due to dynamic view call
Issue

	- Install "Accounting" & "Studio" modules
	- Go to "Accounting" and switch studio editor
	- Go to "Reports" tab and select "Invoices" report
	- Click on any block to edit.

	Not possible to edit document.

Cause

	Studio cannot parse dynamic `t-call` and therefore not able
	to render the corrects hooks to edit the report.
	The issue has been introduced by this commit: https://github.com/odoo/odoo/commit/5c5710ae8ea045569fd94504f9d8dd5209f7b662

Solution

	In the corresponding localization report template,
	add an 'Inheritance Specs' (position="after") that will add a condition
	where it will retrieve the rigth report name
	in case localization enabled.

opw-2362257

closes odoo/odoo#60660

X-original-commit: ee1580a85c9942e9a98748fa568f9f664c67a320
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>
2020-10-23 17:20:09 +00:00
root 13e3f8affc [IMP] account: set element names for easier xpaths
Before this commit some of the <p> elements had no id or name.
This means you need to do uglier or more risky xpath expressions.

By adding names on the elements we can easily xpath to the element itself which results in less changes of breaking or having issues.

closes odoo/odoo#56096

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2020-08-19 07:25:25 +00:00
Katherine Zaoral f6935ef81a [IMP] account: unify invoice report w/o payments
* merge report_invoice_document and report_invoice_document_with_payments templates
* define new generic method _get_name_invoice_report that let us to
  print a different report, this method can be inherited by each localization
  to set their custom report
* change report templates to use the new method.
2020-08-17 14:09:18 +00:00
Victor Feyens fdb23e282b [IMP] *: wrong any() usage
Replace wrong usages of any(list|recordset), by any(generator)
to speed up computations, avoiding list creations and/or looping twice on a recordset
for nothing.

any([generator]) => any(generator)
any(filtered) => any(generator)

closes odoo/odoo#55768

Related: odoo/enterprise#12360
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2020-08-14 09:56:10 +00:00
Goffin Simon a2f7244fc7 [FIX] account: Tax 0% displayed as a tax group on Invoice
Steps to reproduce:

- Let's consider a sale tax T of 0% with Tax group Tax 0%
- Create an customer invoice I with one line L of 100€
- Set T on L
- Print the invoice without payment

Bug:

The tax T was displayed as a group with "Taxes on 100€" instead
of Tax 0%.

opw:2268926

closes odoo/odoo#55731

X-original-commit: 3e0defe37ef8d2081e72290d701738e1ab68d3c6
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2020-08-11 09:49:58 +00:00
william b2008ade4c [FIX] account: separation between amount and currency on printed invoice
Task 2222062
The currency could not be on the same line as the amount

closes odoo/odoo#50500

X-original-commit: f75b708f8ac3774d91e0e5221523b572b2ddeb5b
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: wan <william-andre@users.noreply.github.com>
2020-04-30 15:58:05 +00:00
Commandant Custo 37717f8c2b [FIX] account: report_invoice styling issues in #total table
Steps to reproduce:
- install account
- print any invoice

Previous behavior:
the css rule and classes are ignored on the total table

Current behavior:
displays as intended

This PR fixes two issues:
1/ class attribute was not taken into account anymore ( table-sm )
2/ page-break-inside didn't work

closes #48682
opw-2229181

closes odoo/odoo#50259

X-original-commit: d8bfae0a641f43455b594e8ab2b22ce52cd98d70
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2020-04-27 18:31:59 +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
alt-odoo a7e09fb05b [FIX] account: allow sending of paid invoice if no Accounting rights
If a user with Sales rights but no Accounting rights is trying to send an already
paid invoice, it will raise an access rights error before this commit while we
should allow him to send it without error.

closes odoo/odoo#48820

X-original-commit: 27cb9197c6b64fb9cb8fe46a20d9557914045e59
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Signed-off-by: Alex Tuyls <alt-odoo@users.noreply.github.com>
2020-04-02 07:45:20 +00:00
jvm-odoo 9664c69825 [FIX] account: fix report invoice edit with Studio
Issue

	- Install Accounting & Studio
	- Accounting > Open studio
	- Reports > Invoices
	- Add a Field Column in the table
	  and drag it after "Description"

	Some elements are shifted, which
	causes inconsistency in the table

Cause

	In 924ca78068 we added
	a th "source document" with
	a td containing the value.

	In bc131c0cfb we removed
	the td but not the th.

	Studio adds hook after each th & td.
	Since there is th but no td, there is an
	inconsistency in the hooks.

Solution

	Remove the th from the view to avoid having
	a useless hook.

OPW-2226726

closes odoo/odoo#48798

X-original-commit: 351355c8cb8c64927b5f82d4c1e1deca74353305
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2020-04-02 11:52:12 +00:00
oco-odoo 0eef278268 [IMP] base, account, l10n_ch, website_sale, payment, web: make payment QR-code generation more generic
This new modelling makes it easier to add new QR-code formats, and allows using all of them in website_sale and account.payment's form view as well (so, Swiss QR codes are now available there, while they were restricted to only invoices in the past). All barcodes are now generated as reports, from a dedicated route. This was only partly the case before : Swiss QR added a cross on top of the QR-code directly in the template, it wasn't part of the image returned by the route; now it is.

[ADD] base_qr_code_sepa: new module decoupling SEPA QR-codes generation from the base module

Each new QR-code generation option should thus be done in a dedicated module (or added to a localization) in the future.

[IMP] base_qr_code_sepa: update the generated QR codes to version 2 of the specification

Version 1 is still supported, so no need to backport this.

[IMP] l10n_ch: make Swiss QR-codes compatible with the new version of the specification (the old one is deprecated)

This will be backported to 11.0 and 12.0, as these QR-codes will soon replace ISR.

[IMP] account: make it possible to mark manual payments as sent with a button on the form view

This way, when making them directly with a QR-code (or doing a more classical wire transfer), people can keep track of what they already have asked the bank to do, and what they still have to treat.

closes odoo/odoo#44839

Related: odoo/enterprise#8262
Related: odoo/upgrade#992
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2020-03-30 11:28:41 +00:00
Victor Feyens 859c7e7708 [IMP] account, website_sale: remove 'remove me' code.
Master cleanup of 
https://github.com/odoo/odoo/commit/a540f7864af5fd46cc30ea8c99b2f404cbf58dd7

closes odoo/odoo#44719

Related: odoo/enterprise#8213
Related: odoo/upgrade#790
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2020-03-12 15:16:46 +00:00
Mitali Patel b47aa1b005 [IMP] account: update incoterms list
Purpose of this commit is to update incoterms list
base on new incoterms guidlines and add incoterms in RFQ/PO
and invoices/venderbills reports

task-2179236

closes odoo/odoo#43883

Related: odoo/upgrade#922
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-03-17 13:01:57 +00:00
Mitali Patel 2c7a5840d3 [FIX] account: interchange the sequence subtotal not display properly in invoice report so fixed it
closes odoo/odoo#46507

X-original-commit: 040b885d565ba6ddeb23bd0f3e6752a92619a1b7
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-02-28 08:47:08 +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
oco-odoo 2221f03624 [IMP] account: make switch from Invoicing to Accounting app easier
This is done by introducing a new threshold setting, allowing choosing a date before which all invoices and payments have to be ignored by the accounting. Once this is done, all the balances can be reimported directly, easing the migration to Odoo Accounting a lot.

account.move objects having to be ignored because of this are cancelled, and receive the new 'invoicing_legacy' payment state. account.payment objects are moved to the new 'invoicing_legacy' state and their related account.move is cancelled and marked as invoicing legacy as well.

closes odoo/odoo#41416

Task:  2092377
Related: odoo/enterprise#7071
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2020-01-30 17:20:21 +00:00
wan f315df2e58 [IMP] account, hr_expense: misc improvements of accounting
Task 2176461
* Dashboard: don't show lins if there is no data
* Add new menu for expense reports
* Reorganize notes on bottom of printed invoice

closes odoo/odoo#43787

Related: odoo/enterprise#7880
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2020-01-22 16:49:18 +00:00
Nicolas Lempereur 02d8ce84f4 [FIX] account: move line description with newline
In 13.0, account.invoice.line `name` Text field was transformed into
account.move.line `name` Char field.

So when we want to have this field on several line, we need to specify
the widget `text` instead of `char` explicitely.

opw-2160694
closes #42395

closes odoo/odoo#42476

X-original-commit: 18bb3788a9de474c4c5f4aff8d3e51dde547c86a
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-12-30 12:09:04 +00:00
Nans Lefebvre c0ee3f423f [FIX] account: invoice report template for multi-company
Be in multi-company with companies C1, C2.
Let user U1 in company C1 create a vendor bill V.
Then U1 change to company C2.
Another user U2, in company C1, tries to print the vendor bill.
Traceback: Access error trying to access U1 to render the template

opw 2145738

closes odoo/odoo#41977

X-original-commit: 5b7b12c9907d7da03e08df4f5bac2198c3dc9cba
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-12-10 14:38:11 +00:00
remi-filament a04502c97e [FIX] account: Add widget date for payments
closes odoo/odoo#41142

X-original-commit: fdbabfdc59d2d8deb62d08c7bd132a93a5f2f738
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-11-19 08:26:17 +00:00
Nicolas Martinelli c593c468b1 [FIX] account: sequence of AML
When printing an invoice, the order of the lines not always match the
order in the interface.

It occurs because `account.move.line` contains a `sequence` field which
is taken into account in the UI but not used in the report. Note that
commit 0a5955bff6 explicitly removed from the `_order`.

opw-2145878
opw-2147922

closes odoo/odoo#41396

X-original-commit: f4571e2fe0f30d753172ce1fa1dc40d93b87e00a
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-12-05 08:43:06 +00:00
fw-bot 7b020ed318 [IMP] account: Invoice tax block is split into two pages
closes odoo/odoo#38102

X-original-commit: 724407453a8aba284c9b7edc46ec12c13b25d33d
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2019-10-07 13:56:26 +00:00
david 93157ebe19 [IMP] account,sale: add names to columns for better inheritance
closes odoo/odoo#37769

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-10-02 14:00:04 +00:00
Laurent Smet 8f6e383397 [FIX] account: Fix invoice report template
- Description is no longer needed since it provides the same info as the header.
- The ref field will be used to set a custom description on any invoice (not just vendor bills).
- Don't display the name on the report if the move hasn't been posted.

closes odoo/odoo#37683

Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2019-10-01 11:15:52 +00:00
Christophe Simonis 58a83d1222 [MERGE] forward port branch saas-12.4 up to 4a1321bc99
closes odoo/odoo#37127

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-09-20 14:33:54 +00:00
Florian Gilbert 4a1321bc99 [FIX] account: Show invoice due date on invoice report for customer.
Task ID: 2060475

closes odoo/odoo#37172

Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2019-09-20 06:35:59 +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
Katherine Zaoral 0be039989c [FIX] account: Make "Tax ID" translable in invoice report
closes odoo/odoo#35232

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-08-06 09:05:56 +00:00
Katherine Zaoral 0133ebab8f [IMP] account: easier extension of report
Update invoice report to add id attribute in vat label and tax lines
elements in order to to be able to make clear/save inherit of this
report in Argentinian localization

Before this commit modifying/extending the information was difficult
After this commit, the id can be used for efficient xpath

    <xpath expr="//t[@id='inv_tax_id_label']" position="attributes">
    <xpath expr="//span[@id='line_tax_ids']" position="attributes">
2019-08-06 08:57:13 +00:00
wan 2d086f5d8f [IMP] account: credit note usability
Task 2038326

* Tick the credit note sequence by default on the customer invoices and vendor bills journals
* Write Customer Invoice/Vendor Bill/Credit Note/Customer refund at the top of the document
* The reference field should be printed on the credit note pdf (interesting because it gives source and reason)
* If the document is a credit note, there shouldn't be any payment information on the pdf (the customer doesn't have to pay you) (currently you see the "payment communication" the customer is supposed to use)
* Rename Credit Note to Refund on dashboard
* Add tooltip on payment widget

closes odoo/odoo#35231

Signed-off-by: Cedric Snauwaert (csn) <csn@openerp.com>
2019-07-31 14:39:22 +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
Nicolas Martinelli c2bcd15998 [FIX] account, payment, website_sale: QR code based on partner's country
The QR code was limited to a set of countries listed from Wikipedia [1],
but the list is incomplete. Any partner from a SEPA country should have
the QR code printed since we don't know which banks support it.

At the moment we simply remove the limitation, and hopefully a proper
filtering will be done in master.

[1] https://en.wikipedia.org/wiki/EPC_QR_code

opw-2052315

closes odoo/odoo#35827

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-08-20 08:00:58 +00:00
Goaman 04114043bb [IMP] account: Allow to merge and print original vendor bills
This commit add an action to merge and print the original vendor bills
through the field 'message_main_attachment_id'.

Was task 2006908

closes odoo/odoo#34023

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-07-08 12:10:51 +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
Nicolas Lempereur a540f7864a [FIX] account,sale: colspan revert part of e2e27b41a
In e2e27b41a variable `colspan` and several `<t t-set="colspan"/>` were
removed replacing `t-att-colspan="colspan"` with `colspan="99"`.

- sale_management.sale_order_portal_content_inherit_sale_management has
  `<t t-set="colspan" t-value="colspan+1"/>` overidding the portal view
  sale.sale_order_portal_content which so may result in error 500
  because colspan variable does not exist

- when doing a customization adding a column, adding:
  `<t t-set="colspan" t-value="colspan + 1"/>` was the expected behavior
  which after colspan change would break

So this changeset reintroduce `<t t-set="colspan"/>` tag up to not
including master, they will have no effect but possible existing xpath
or use of the variable colspan will no longer cause an error.

note: for 12.0 up to saas-12.3 (not necessary in master)
opw-1965886
closes #32539

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-04-09 08:29:39 +00:00
Julien Castiaux 3b5f33281d Partial Revert "[FIX] sale: subtotal computation and display"
This partially reverts commit e2e27b41ad.

The commit changes the DOM structure in order to pretty print both
amount (value without tax, B2B setting) and total price (value with tax,
B2C setting). Actually having both (B2B and B2C) is a client
misconfiguration and we do not support that, furthermore changing the DOM
structures can break inherited templates.

The said commit was also fine tunning 716ff76, the fine tune is
related the the removal of the dynamic colspan attribute. The section,
note and subtotal should take the entire width of the table, setting the
colspan to an abritary maximum ensures they fill the entire width.

closes odoo/odoo#32194

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-03-28 09:36:41 +00:00
Julien CastiauxandNans Lefevre e2e27b41ad [FIX] sale: subtotal computation and display
Steps to reproduce:
- Install Accounting and Sale
- Enable the developer mode.
- Go to Settings > Users & Comp > Your user, edit to check both "Tax
Display B2B" and "Tax Display B2C" boxes.
- Go to Settings > General Settings > Accounting > Reporting, check the
"Add totals below sections" box.
- Create a sale order in the sale module, the sale order must have at
least one section with several products.
- Print the sale order. The subtotal amounts are wrong.

There are two different subtotals amount to compute, one for the
*Amount* column and one for the *Total Price*. The actual computation
did not store the two amount in different variables. Multiple template
are broken in the same way.

Fine tunning of 716ff76

Co-authored-by: Nans Lefevre <len@odoo.com>

opw-1950833

closes odoo/odoo#32148

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-03-27 13:16:56 +00:00
Christophe Simonis 9a4e84ae66 [MERGE] forward port branch saas-11.3 up to f5ab04ce50 2019-03-14 14:13:47 +01:00
Christophe Simonis afe8e97800 [MERGE] forward port branch 11.0 up to c23d1186e7 2019-03-13 16:52:40 +01:00
Enric Tobella c16d2827bc [FIX] context on reports
closes odoo/odoo#31150

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-02-15 12:58:38 +00:00
jpr-odoo caad35c29c [IMP] account, sale: improvement into the invoice report view
with this commit, changed the label of 'Shipping address' => 'Shipping Address' and removed 'Reference'
into the printed invoice report for a portal view

Task ID: 1930087
2019-04-12 09:04:26 +00:00
Christophe Simonis 0a09a4d8a8 [MERGE] forward port branch saas-12.3 up to 120359bf0c 2019-04-12 13:37:44 +02:00
asa-odoo fb2fc0b3d8 [IMP] sale, account, purchase, repair, POS, delivery: shorter fields label
In described Modules, there are some fields label like Unit of measure, Discount,
Ordered Quantity, etc... in views(list,form), report and portal, that are messy
and barely readable when lots of features are installed.

Purpose of the task is to shorter that all fields label to make clean view in
order to make it more readable without getting labels uselessly spread out on
several lines

Related to task #1933746
Closes #31962

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-04-04 09:38:18 +00:00
Jorge Pinna Puissant a1e6a0f0c5 [FIX] account: price_unit report decimal precision
Before this commit, the unit price in the invoice's reports, had the
same decimal precision as the currency and not the one specified for the
unit prices.

Now, the reports shows the unit prices with their specific decimal
precision.

opw-1940406

closes odoo/odoo#31314
2019-02-21 08:35:09 +00:00
Sébastien Theys dc4a9d3db7 [FIX] account,purchase,repair,sale,web: fix report layouts
Following BS4 migration and adding sections and notes.

=====

Document templates:

- Remove margin from <p> in "informations" to allow them to be
	correctly centered vertically on their container.

- Also add a mt- and mb- on their <div> to better handle them going to a new
	line when there are too many of them.

- Add class for section and note to be able to customize them in layouts.

- Add class for price_total to be able to customize it in layouts instead
	of relying on :last-child.

- Add "page-break-inside: avoid;" on the "total" table to not split it
	between pages when it can be avoided.

- Fix sale report template "Informations" to use col-auto just like invoice
	See 6b8d7bb6d6

=====

Boxed layout:
	- fix section & note style
	- fix borders in general
	- fix the total table

Background layout:
	- fix section style
	- fix the total table

Clean layout:
	- fix page number vertical align

task-1889346

closes odoo/odoo#27782
2018-12-03 13:16:52 +00:00
Martin Geubelle 1dcddbd022 [FIX] account: allow invoice report modification
The invoice lines table in the invoice report was using a `t-attf-class` where
it is not needed. It could be simplified with `class` instead.

This small simplification allows the user to modify the table with the Report
designer in Studio.

closes odoo/odoo#27978
2018-10-19 12:20:50 +00:00
Sébastien Theys 6b8d7bb6d6 [FIX] account: fix invoice iframe responsiveness
77be4214db introduced an issue where the meta data would not go to a new line on small screen (on the iframe).

PR: #27293
task-1889346
2018-09-28 14:36:26 +02:00
Vincent Schippefilt 77be4214db [FIX] account: update report layout to be editable by report editor
This fix fixes 2 issues:
- the definition of the row/col structure on the document meta-data
- the content of the headers is within a span so it is editable
2018-09-20 11:10:34 +02:00