Commit Graph
259 Commits
Author SHA1 Message Date
IEL 3c7694b409 [FIX] *: fix image parsing error on saving res config
WHAT: apply 93a7695f65baf00d1f82481d6a2a97e6c11940a8 for all res.config.settings
menus

WHY: the same reason as in 93a7695f65baf00d1f82481d6a2a97e6c11940a8:

	When saving, a read is called. By default, read has
	bin_size to true to avoid performances issues.
	It will return the image size instead of the content

it may lead to image dissapearing or "Incorrect padding" error

HOW:

    find . -iname "*.xml"|xargs grep "\"context\".*'module'" -l | xargs sed -i "s/\(\"context\".*'module'.*\)\}/\1, 'bin_size': False}/"
    git checkout  -- addons/base_setup/views/res_config_settings_views.xml

---

PR for General Settings: https://github.com/odoo/odoo/pull/47297

opw-2346644

closes odoo/odoo#61215

X-original-commit: 7c55efa88b72bd1f3f0f32f7f738e2fda5aa4abd
Related: odoo/enterprise#14547
Signed-off-by: Ivan Yelizariev // IEL <yelizariev@users.noreply.github.com>
2020-11-02 18:25:20 +00:00
Laurent Smet 325af9e412 [FIX] account,*: Manage 'in_payment' state correctly
closes odoo/odoo#60951

X-original-commit: 0a83aa2d6811c3638db151991938473a892c5452
Related: odoo/enterprise#14473
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2020-10-29 10:05:55 +00:00
e3069655d3 [FIX] account, mail: properly evaluate and clean xml context
Before this commit, there were some traceback while performing
several actions due to context that was not properly evaluated.

This commit fixes those traceback by evaluating the context and
thus enabling user to perform those actions without traceback.

We also clean some badly-configured email actions in accounting.

Task Id : 2302572
PR #56501

X-original-commit: 71a39c6650e18b71a212bf21150fece683ae01c7
Co-authored-by: D J <dja@odoo.com>
Co-authored-by: Thibault Delavallée <tde@odoo.com>
2020-09-29 10:28:18 +00:00
Anousone Phaysomphot 1b67e2ed17 [IMP] account: add new digest tips
PURPOSE

Review the tips and digest layout design to make sure they have a WOW effect
and increase trial conversion/retention.

SPECIFICATIONS

“No need to print, put in an envelop and post your invoices”
See code for specifications.

LINKS

Task ID-2274264
COM PR: odoo/odoo#53580
ENT PR: odoo/enterprise#1139

X-original-commit: 58bcc8c3c509df9e3774369ac1a626d528eba598
2020-08-12 12:22:58 +00:00
Xavier Morel 6835aeb0de [REM] core, *: deprecate <act_window> and <report>
Convert deprecated tags through the codebase.
2020-07-28 13:03:13 +00:00
Benjamin Frantzen (bfr) f81c83153e [FIX] l10n_se_ocr, account : renamed old reference to invoice_payment_ref to payment_reference
closes odoo/odoo#54735

X-original-commit: a44db615d1fa6443810e88cc55471aff110c1393
Signed-off-by: bfr-o <bfr-o@users.noreply.github.com>
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2020-07-22 06:37:26 +00:00
Andrea Grazioso (agr-odoo) ce3c7d8714 [FIX] account: change composition mode to allow multi send
Go to Payments view
Select multiple confirmed payments, click on Actions>Send receipt by
email

Only for the first payment will be sent an email.
This occur because in composition mode 'comment' (the default)
mail composer sens the mail to a single record
Adding a duplicate action to handle multi send
Updating translation accordingly

opw-2278971

closes odoo/odoo#54108

X-original-commit: 11fd7687047b2c17e9464e8415087d9a9fcf58a8
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2020-07-06 09:09:59 +00:00
Josse Colpaert 4bbc666cae [IMP] account: put payment reference in invoice mail
Before, only when you had installed the Belgian
structured communication module, when you sent an
invoice by mail then only the structured communication
would be added in the mail.

But it should be visible all the time when
you have a payment reference.

closes odoo/odoo#52618

Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2020-06-08 14:05:36 +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
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
mcm-odooandThibault Delavallée de1743ab12 [REF] mail, various: remove user_signature field from mail.template
RATIONALE

Mail template model holds a field telling odoo mail engine to automatically
add the current user's signature to the body. Its use depends on the use
case

  * using the template in the composer on a single record: it is displayed
    in the rendered template in the composer, meaning people could change it.
    This behavior is interesting as it allows to see the email content;
  * using the template in the composer in mass mail mode: it is not displayed
    as only the raw jinja is displayed. It is therefore not obvious that it
    will be appended to the body of the mail. People could add it manually and
    have 2 signatures as a result;

A mechanism automatically adding a signature to sent emails when posting a
message is already implemented and is based on template existence. If a
template has been used when posting, no signature is added in sent emails.
Otherwise it is automatically added. This behavior should not change.

Behavior will therefore be

  * use a template -> specify signature usage in it manually through jinja;
  * do not use a template -> signature added in sent emails;

SPECIFICATIONS

Remove user_signature.

Update template body accordingly. In customer oriented templates that are using
it and do not already contain it, manually add a call to user.signature within
the jinja code. When set to False, just remove its declaration.

Quickly clean some signature integration.

LINKS

Task ID 2089252
Community PR odoo/odoo#39482
Enterprise PR odoo/enterprise#6459
Upgrade PR odoo/upgrate#761

Related: odoo/enterprise#6459
Related: odoo/upgrade#761
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Co-authored-by: Michaël Mattiello <mcm@odoo.com>
Co-authored-by: Thibault Delavallée <tde@odoo.com>
2020-02-11 14:01:13 +00:00
wan d8c5cc1335 [IMP] account: add a readonly group
Task 2092079
Accounting firms that want to give access to their customers avoiding
mistakes and risks will love this profile that can't do anything
wrong... Maybe as well as companies auditors..?

closes odoo/odoo#39860

Related: odoo/enterprise#6576
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2020-01-22 11:23:16 +00:00
oco-odoo 8e4158af81 [IMP] account: add 'partial' and 'reversed' payment states to invoices
- 'partial' payment state corresponds to invoices whose payable/receivable move line has been partially reconciled with some other line.

- 'reversed' payment state corresponds to entries that have been cancelled by the creation of a single reverse entry (using the dedicated button on the form view). This state can be set on invoice as well as on regular entries.

=> To stay consistent with the naming conventions, this commit also renames invoice_payment_state field to payment_state, since it's no longer only applicable on invoices.

closes odoo/odoo#41723

Related: odoo/enterprise#7202
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2020-01-16 18:04:26 +00:00
qdp-odoo fd5264c5a5 [REV] account: reverts tags of the Indirect Method Cash Flow
This reverts commit 4f524dbad6 that was merged with PR #36206.

Those tags are unused, were added in account module by mistake (could maybe be acceptable in a l10n_xx module) and were rejected in master (at PR #35522) because of https://github.com/odoo/enterprise/pull/5052#issuecomment-540456794...

closes odoo/odoo#40575

X-original-commit: ed981b02fe2cd000c53f1f995b31c3860e0781c3
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-11-20 15:47:36 +00:00
Christophe Simonis 0f6d2a42ca [FIX] account: remove duplicated record definition
closes odoo/odoo#38333

X-original-commit: aab017f1489b8c966b9de1f8c900f7cb9eab0656
Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-10-10 06:33:54 +00:00
wan efd97b7ea0 [IMP] account: review the hierarchy of account type selection
* Add an equity section inside the balance sheet
* Divide profit and loss into Expense and Income
* Reorder the Expense and Income types

closes odoo/odoo#36599

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-09-10 09:11:35 +00:00
Humberto Arocha 4f524dbad6 [IMP] account: Adding Accounting Tags for Indirect Method Cash Flow 2019-09-03 15:08:33 +00:00
mcm-odoo d4710d92dd [IMP] account: add payment terms to data
- This commit moves the Payment Term "End of Following Month" from
  demo data to data and adds two new Payment Terms: "21 Days" and
  "30% Now, Balance 60 Days".
  It allows the customer to define less Payment Terms

task-2032586
2019-08-29 11:49:17 +00:00
wan 5aeec0c3dc [IMP] account: Hierarchy in account type selection field
Task 2041865

We want to show a hierarchy to ease the account type selection (hack in the select widget)
BALANCE SHEET
ASSETS
Fixed Assets
Non-current Assets
Current Assets
Prepayments
Receivable
Bank and Cash
LIABILITIES
Equity
Current Year Earnings
Non-current Liabilities
Current Liabilities
Credit Card
Payable
PROFIT & LOSS
Income
Other Income
Expenses
Cost of Revenue
Depreciation
OTHER
Off-Balance Sheet

closes odoo/odoo#36170

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-08-29 15:07:47 +00:00
wan 1576c91c9a [IMP] account_reports: add off sheets acount type
Task 1998268

closes odoo/odoo#35150

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-08-21 14:28:19 +00:00
Christophe Simonis 140ee6b8f0 [MERGE] forward port branch saas-12.4 up to 98a55917a6 2019-08-14 16:48:10 +02:00
wan 819056582b [IMP] account: misc improvement post accountappocalypse
* remove _onchange_invoice_date_due as it is superseeded by _onchange_recompute_dynamic_lines
* change invoice_date_due only if not set and if there is no payment term, it was erased and set to invoice_date_due if we did not set invoice_date_due before posting
* raise a warning if we validate an empty move/invoice
* correct the renaming of user_id -> invoice_user_id in invoice template
* correct the renaming of date_invoice -> invoice_date
* the data on purchase journals was not displayed correctly as the sign
of the amount in the graphs was not signed correctly
* the methods for computed invoice reference were not correctly renamed in l10n_be for (account.move)._get_invoice_computed_reference
* the default reconciliation model was only installed in the first company, we make it now install along with the chart of account
* the partner of invoices and the label of invoice lines should be required
* the widget one2many_list doesn't exist

closes odoo/odoo#34786

Signed-off-by: Cedric Snauwaert (csn) <csn@openerp.com>
2019-08-01 15:26:48 +00:00
jbm-odoo b6193a6b8d [IMP] Res_partner: Improve res.partner form UX (back2basics)
- Clean form view
- Add a new widget to check if IBAN account number is correct
- On the res.partner model, default value for "is a company" is True.

TaskID: 2025362

closes odoo/odoo#34691

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-08-12 12:07:53 +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
Hiral Bhavsar 2b7d899124 [IMP] account(_*): clean the controlpanel actions
* check_printing, voucher

For the model 'account.account',
- Replace the action menu 'Journal Items' by the stat button.
- Hide menu 'Journal Items for Tax Audit' from actions menu.

For the model 'account.invoice',
- Set action menu 'Share' only for the form view.
- Rename the action menu 'Confirm Draft Invoices' by 'Validate'.
- Rename 'Register Payment' by 'Register payment'.
- Rename 'Send' by 'Send & print'.

For the model 'account.move',
- Remove the menu 'Journal Items'.
- Rename 'Reverse Moves' by 'Reverse' and set it only for the list
  view.
- Rename 'Post Journal Entries' by 'Post entries' and set it only for
  the list view.

For the model 'account.move.line',r ename 'Reconcile Entries' by
'Reconcile' and 'Unreconcile Entries' by 'Unreconcile' and set it only
for the list view.

For the model 'account.payment',
- Rename 'Send Receipt By Email' by 'Send receipt by email' and set it
  for both form and list views.
- Rename 'Post Payments' by 'Confirm' and set it for the list view only
- Rename 'Print Checks' by 'Print checks' and set it for the list view
  only.

For the model 'account.journal', remove the menus 'Unpaid Invoices',
'Bank statements' and 'Voucher Entries'.

Linked to task 1984526
Related to PR #33720
2019-07-10 15:07:57 +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
Prakash Prajapati cecb3db386 [FIX] generic: fix typo in email templates.
Replace the email template content form if you have any question to if you have any questions.

task-1962924

Closes #33520

Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2019-06-10 07:06:29 +00:00
Xavier Morel 10f1a1a0c4 [REM] multi from ir.actions.act_window
Task 1843603

* src_model is redundant with binding_model_id
* multi -> binding_view_types (if empty => all views) (maybe should be
empty by default yo?)
* in convert, type => rec.get(type) but no @type possible on <act_window>...
* removed deprecated auto_refresh & auto_search (not used anywhere (?))

closes odoo/odoo#24738

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2019-05-27 12:00:39 +00:00
Christophe Simonis 8dd5a85267 [MERGE] forward port branch saas-12.3 up to 60e71302a3 2019-05-13 15:26:12 +02:00
wan ce799f2f99 [ADD] account: cron to post draft entries
Task 193992
The cron is used to post draft entries such as those created by the module account_asset
Also add an inverse to account.move.amount
Also add a reverse compute on amount, and adapt its value according to the currency
2019-04-23 20:16:48 +00:00
Laurent Smet bd90026c67 [IMP] account: check match_partner in the default reconcile rule 2018-11-19 16:01:02 +00:00
jpr-odoo d6d7554a6e [IMP] account: improvement into the invoice mail template
with this commit, we have added  comma ',' after the name of the customer

Task ID: 1930087
2019-04-12 09:04:27 +00:00
Thibault Delavallée 0b74c9ab6e [FIX][IMP] various: improve recipients computation in mail templates
Purpose: use more email_formatted when possible, clean and simplify
email_from, email_to and partner_to computation.

Next step is to try to extract some common patterns in tools or methods in
order to simplify template creation and customization.

Related to task 1972615
Linked to PR #32872
2019-04-23 14:26:50 +00:00
Cedric Snauwaert bc9e1f7ed0 [FIX] account: fix account type of other income and asset filter
Account type of other income should be of type 'income' and not 'other'
Filter 'Assets' in chart of accounts view is not working correctly due to typo in the filter.
2018-09-28 13:34:37 +02:00
Laurent Smet 7053ae7828 [IMP] account: management of reconciliation rules
Bank statement lines need to be matched with entries; We have to automate this operation as much as possible.
At the same time, create an algorithm that fit everyone needs is quite impossible.
For that reason we will let users choose the rules they want with the improvement of reconciliation models.

Note that we did it only for bank statement reconliation, not for manual reconciliations.

Was task: 1877375
Was PR #26669
2018-09-20 17:11:52 +02:00
Nicolas Bayet cb1aa9c596 [IMP] account: Allow to filter account by internal group
Purpose
=======

Since the account apocalypse in 9.0, there are no way to filter the accounts
based on their 'internal group'.

Specification
=============

Add a Selection field 'internal_group' on the account.account.type to allow
filtering the accounts. The possible internal groups are the following:
- Equity
- Asset
- Liability
- Income
- Expense

Also, set the value to the account types defined in data.

TaskID: 1868221
2018-08-13 14:36:32 +02:00
Nikunj Ladava d68d8d9039 [IMP] sale_payment,website_sale: send email when automatic invoice activated
Currently when in payment is configure in automatic invoice mode,
customers don't receive anything.
If they want to see their invoice, they have to log into their portal
account.

Task #1866497
Closes #25864
2018-08-10 17:01:41 +02:00
Mitali Patel 84f528bcff [IMP] Portal - Share link : Easily share the url of a document
Purpose
=======
- Quickly share the url to someone else (a client, a colleague,...)
- Ensure that the recipient can access at least
  the portal view of the shared record.
- Typically used when a client cannot retrieve the mail to access his order.
  The share link can be used in this case.

Specifications
==============
For any object inheriting form portal.mixin:
    - Add a button SHARE (not visible in edit mode)
    - When clicking on this button, a popup opens with :
        - A warning message for tasks and projects only (see below)
        - the link (like in gmail) that can be copied
        - Recipients
        - mail composer (with preselected template) ==> see below
        - button [Send Link] [Copy Link] Discard
        - After sharing document, put internal note like
          "Document shared to xyz,...." with template message
    - Anyone with the link, even anonymous user (not logged in) can have access
      to the document with the access token provided in the url.

Impacted models:
    - account.invoice (Community)
    - project.project (Community)
    - project.task (Community)
    - purchase.order (Community)
    - sale.order (Community)
    - helpdesk.ticket (Enterprise)

Warning messages and access rules:
    Allowed :
        - SO canceled or draft will be accessible with the link
          with access_token
        - If the customer account is B2B (signup not enabled), the recipient
          will anyway see the document as the user specifically wants the
          recipient to see the document.
    Restrictions :
        - For Project and Task, if the privacy is not public, then, there is a
          contradiction between the access_token mechanism
          and the privacy of the document.
        - A warning message will be displayed in the share wizard to inform the
          user if the document cannot be visible by the recipients and to
          ask him to set the privacy to 'Visible by following customer'.
          The send button will, in that case, be hidden.
        - To avoid to block the share for a new project, default privacy value
          is now set to 'Visible by followong customer'

Technical implementation
========================
- Move the access_token mechanism (field + methods + mail controller)
  to the portal.mixin to be able to use it in a generic way for each object
  inheriting the portal.mixin
- Generalise a part of the _*model*_get_page_view_values method
  into a single one in portal
- Generalize the _*model*_check_access into the portal controller of the
  portal module
- Remove the init_column + default value for the access_token
  > old records have an access_token,
  > new one won't but it will be generated on demand via the get_access_token
  Done for performance reasons
- Add share button into action menu separately. + kanban view context menu
  (except for task and project where button not in action menu but 'simple'
  button for task and project because other modules already provide action
  to send documents by email, which is not the case for project and task.)
- Add a sign_token used to authentify the recipient in the portal view chatter,
  if any. The message will be posted as if the user was logged in.
- Set the _get_share_url as private for security reason
- Add a redirect parameter to _get_share_url to get
    If false : The direct portal view url
    If True : The redirect url (mail/view/?)
- Cleaning up unnecessary code

- Bug fix :
    - Before, if user was not logged and record had partner_id,
      if partner id was null, post message was done as admin.
      Now, the post message is done as public user.
    - If the user had an uid but had no access_token, he could be able
      to gain the access token of the record.
      check_access_rights was missing in the get_access_action.

Task ID : 30985
Closes #25629
2018-08-03 15:20:42 +02:00
Yannick Tivisse a701031c92 [REM] account_invoicing: Merge module into account
Purpose
=======

The only module that was supposed to work without the accounting menuitems was
the ecommerce. Now that the ecommerce wants the accounting menuitems to be
visible, this module makes no sense anymore.

Specification
=============

Remove the account_invoicing module and move the code to account.
2018-07-31 12:34:18 +02:00
Laurent Smet c75f3a007c [REF] account,stock,account_intrastat: Intrastat report moved in interprise
This will allow to use the same core for all intrastat reports and benefit from the dynamic financial reports engine.
Incoterms have been move to account, as we want to provide a light intrastat report for people not having the stock app installed

Was task: 35850
Was PR #23805
2018-07-26 02:18:37 +02:00
Pratima GuptaandMitali Patel 0d83edc9b0 [IMP] account, l10n_be_invoice: make templates more modern and updated with Odoo guidelines
In this commit we improve templates used in account and l10n_be. Purpose of this
commit is to have templates that embed or use standard Odoo email layouts to
make them look modern and have a common style across all emails.

Main guidelines

 * better use of div / p / br to try to lessen layout issues, especially
   when updating templates using the editor;
 * correctly sequence the templates fields definition;
 * correctly set templates values notably auto_delete and user_signature
   fields to avoid confusion;
 * correctly layout the email content using light notification email. It
   can either propagate the layout choice through various send mail methods
   or directly embed the styling in the templates for more technical or
   complex templates;
 * use email_formatted computed field when possible to avoid having hand-made
   from / to addresses;
 * fix various typos and improve subjects when necessary;

Content of emails is not necessarily updated as the purpose of this task is
about styling, not content itself.

This commit is linked to task ID 1843395 and 1843376 (and 1868112) and to
PR #25294 and #25349 (and #25889).

Co-Authored-By: Mitali Patel <mpa@odoo.com>
2018-07-24 15:33:22 +02:00
Thibault Delavallée 14a3fd6018 [REF] account: clean send by email template
Purpose

 * use the new notification template allowing to display the payment button
   only in emails;
 * reorder the fields definition to ease the reading;
 * slightly clean the email body using a maximum of div and br tags as it
   seems better integrated with Odoo edition capabilities;

This commit is linked to task ID 1860049 and PR #25824.
2018-07-19 17:14:33 +02:00
Christophe Simonis 2ab7ad8361 [MERGE] forward port branch saas-11.3 up to c00df14654 2018-06-07 11:43:07 +02:00
Sanjay Jamod a4df9f8c93 [IMP] account: vendor bill creation upon email reception
This allows to set up a mail alias per purchase journal. Then share that email address to your supplier, or use it internally to forward the vendor bills received by mail, to automatically create an empty vendor bill with the mail attachments linked, and the partner might be filled if the source email matches a supplier.

Thanks to the document preview on the side, it's now super easy and super fast to copy the vendor bill info from the received PDF into the account.invoice object. This would eventually be improved later on (IAP).

Was task: 37703
Was PR #22158
2018-06-06 14:17:03 +02:00
Christophe Simonis aba8c2b8fb [MERGE] forward port branch 11.0 up to 1b272a2050 2018-06-05 16:27:49 +02:00
len-odoo 42aff92a4e [FIX] account, purchase, sale: properly quote the name of the email sender
formataddr (from the email python library) writes email_from as '"name" <email>'
in the email_from field of the mail.compose.message record.
When the mail is rendered, onchange_template_id is triggered.
This then overwrites the values of email_from among other fields.
What happens is that it uses the email_from field from the template to render
the email_from, bypassing what was put by formataddr before.
What happens in some cases is that it is rendered as 'name <email>'
(note the quotes have been stripped away).
If name contains arbitrary symbols, e.g. name = 'pépé [company] <pdg>, ohlala',
then getaddresses which is supposed to parse the (name, email) pairs gets thrown
off (in particular, <pdg> will be interpreted as an email address, and many
other problems with the various special symbols).
It then gives these wrong elements as email addresses, which will usually crash
when getting non-ascii symbols (i.e. these strings don't respect the relevant
RFC for email addresses).

Closes:
https://github.com/odoo/odoo/issues/23502
https://github.com/odoo/odoo/pull/2311823118

opw 815202
opw 1824243
2018-06-01 13:06:09 +02:00
Christophe Simonis 3ab25b60bc [MERGE] forward port branch saas-15 up to cae950e826 2018-04-23 17:59:59 +02:00
Goffin Simon 4ac10f20c4 [FIX] account, purchase, sale: Wrong company displayed in the footer
Steps to reproduce the bug:

- Set a multi company environment with two company A and B
- Set user admin in company A
- Set user demo in company B
- Create a PO with user demo
- Send a RFQ

Bug:

The company of the admin user was displayed in the footer of the email.

The function _notify called on res.parter model is called in sudo by
the function _notify on mail.message model.

The function render_template on mail.template model uses the user defined
on self.env to render the template. So the user admin was always used.

opw:1835647
2018-04-23 09:33:22 +02:00
qdp-odoo c410911ad9 [REV] account: revert feature to create recurrent vendor bills
This reverts commit 7642754122.

The reason is that we finally decided to implement that in another way and we want to avoid people start using this feature as it would be replaced in next saas. Yes, I know, that sucks.

New task ID: 1823153
2018-03-05 15:46:24 +01:00