Commit Graph
22 Commits
Author SHA1 Message Date
Nicolas Galler ac9c9529b5 [FIX] product_email_template: use superuser account to send email in su mode
Behavior prior to the fix:

The email template associated with a product on an invoice placed via
the web portal is sent with no email_from, resulting in a failure.  The
reason is that before 13.0 .sudo() before sending a mail would send it
as superuser user (which was the intention in this case), but since 13.0
for the same intention we need .with_user(SUPERUSER_ID).

Behavior after the fix:

When sending the product email, if we are in SU mode, we'll switch to
the super user account, emulating the pre-13.0 behavior.

Similar fix to b12bcfbb1b

opw-2346415

closes odoo/odoo#60584

X-original-commit: 43718d0694d8d0c7b53e3511cb8523a645ebddb1
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Signed-off-by: Nicolas Galler <nicocrm@users.noreply.github.com>
2020-10-23 07:17:53 +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
Swapnesh Shah a2e5514b8a [FIX] product_email_template: use correct parameter for notification layout
Message post with template has to be called with a notif_layout parameter in
order to have a layouting correctly set through the call chain.

closes odoo/odoo#48359

X-original-commit: 077f58027e29a50cd9a9bf455b5ca5c482503686
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-03-25 15:01:22 +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
Nicolas Martinelli 56ee149f11 [FIX] product_email_template: use proper parameters
`custom_layout` should be set as a context key, otherwise it crashes at
creation because of non-existing field.

opw-2146695
opw-2149726

closes odoo/odoo#41238

X-original-commit: f9837eb08a316965057fe239f434b1c6d5c0196c
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-12-03 07:55:13 +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
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
Jorge Pinna Puissant 904e237d78 [FIX] sale,product_email_template: match the help with the behaviour
Before this commit, the help of the product_email_template module said
that the email is sent when the invoice is paid. This is not the case,
the current behaviour of the module is that the email is sent when the
invoice is validated.

Fine-tuning of : 4b5265b9b9,
10eee18a04
and 33a413eb29

opw-1973946

closes odoo/odoo#33686

Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2019-05-27 12:43:14 +00:00
Prakash Prajapati 4b5265b9b9 [IMP] contact, product, various: improve labels and tooltips of partner and product fields
Purpose: improve understanding of partner and product models as well as their
daily use. This is done by improving tooltips and labels of some fields
according to business logic.

This commit is related to task ID 1880696 and closes PR #27133 .

Thanks to @xmo-odoo for its in-depth review.
2018-09-21 10:57:58 +02:00
Pratima Gupta 37ea5dc316 [IMP] product_email_template: make email templates bioutifoul
Purpose of this commit is to enhance quality of templates proposed by Odoo
and make them use notification layout when send by emails. Those emails
are cleaner and more up to date compared to other emails.

Including
  * when sending the template attached to the product, specify the layout
    to use to encapsulate the notification email;

There is a huge ugly demo data of odoo online contained in this product.
After some thinking we choose not to modify it as demo data update will
belong to another task.

This commit is related to task ID 51122 (and PR #24052).
2018-06-08 15:39:18 +02:00
xmo-odoo b4429c2a91 [FIX] Various P3-related import changes
* LDAP import: python-ldap is not python3-compatible, pyldap is

  Warning: only supported from debian Stretch (current testing)?
  https://packages.debian.org/search?searchon=names&keywords=pyldap

* implicitly relative imports
* imports of moved or removed stdlib modules

issue #8530
2017-04-28 09:06:53 +02:00
Prashant Panchal 7f18dfc9ed [REF] product_email_template: migration to the new API 2016-01-25 14:28:57 +05:30
Prashant Panchal 01d99c159b [REF] product_email_template: rename module files 2016-01-25 14:28:57 +05:30
Jérome Maes 7674536713 [IMP] mail : message_post_with_template helper
Create `message_post_with_template` helper method to factorize the simulation of a mail.compose.message wizard.

Also, fix the generated attachments of mail.compose.message wizard by returning ORM command (6, 0, ids) instead of the list of attachments ids. In order to standardize the behavior of the wizard, and since the ORM support command assignation in onchange api.v8, all the x2many fields of the wizard return a command.

FYI, that was tde's idea !
2015-09-04 15:55:38 +02:00
Thibault Delavallée 38b1485d52 [IMP] stock and various: labelling
- delivery: rename cost price to shipper price to ease the understanding.
- product_email_template: fixed space issues in help of email_template_id.
- stock: labelling reordering wizard
- stock_account: labelling (inventory at date) + shorter and cleaner help
messages. The main menu for this wizard has been put in technical group.
- stock_landed_costs: fields labels update
2015-08-24 15:34:19 +02:00
Thibault Delavallée e6f038a821 [REF] mail: mail_thread: followers update
Followers can now be partners or channels. Partners following a document
will receive needaction, as previously. However people can follow documents
through channels. Members of a channel are able to listen to a stream
of messages using the channel. Those messages do not create needaction
messages. It is therefore possible to follow documents without receiving
too much notifications. For interesting documents subscribing with its
partner will create notification.

message_follower_ids fields is udpated. It is now a many2many to
mail.followers, not to res.partner anymore. A subscription can be either
a partner (partner_id) or a channel (channel_id).

Some access rules have been updated accordingly.
2015-08-21 12:11:56 +02:00
qdp-odoo c04065abd8 [IMP] accounting v9. Yeeeeaah 2015-05-05 17:28:04 +02:00
Julien De Coster d88c34d11e [IMP] Mass mailings send in cron
1. The merge of the "email_template" module into the "mail" module.
2. The send action of the mass mailing has been moved from the frontend to a cron, because it was too slow to send over 10,000 mails (the user's browser was blocked for 15 - 20 minutes). Mass mailings have now their own process in the kanban view.
3. Mails sent from the mail form are sent immediatly instead of from the mail queue (for instance, when you go to sales > customers > list view > select 2 -3 customers > More > Partner Mass Mailing).
4. Users have now the choice from which mailing list they want to unsubscribe when they click on the unsubscribe link at the bottom of the mail.
5. Mass mailings inherit from their campaign UTMs and mass mailing campaigns are linked to an UTM campaign.
6. Many little improvements
2015-01-07 18:01:58 +01:00
Raphael Collet d6f375df61 [IMP] models: "X in self" is now equivalent to any(X == rec for rec in self)
Fix modules with code like "record.id in other.stuff_ids".
2014-09-04 15:31:04 +02:00
Thibault Delavallée e55fd50cb5 [FIX] product_email_template: fixed a bug preventing from sending emails and therefore from validating invoices when having templates without attachments linnked to a product. 2014-06-13 16:32:08 +02:00
Olivier Dony b89d6d99c8 [FIX] product_email_template: typos
bzr revid: odo@openerp.com-20140403142836-9na8qo7y7gqr0nmi
2014-04-03 16:28:36 +02:00
Thibault Delavallée 5d17667bb1 [RENAME] account_product_template -> product_email_template, to avoid
confusion with product templates. The main feature are email template on product
therefore renaming the module.

bzr revid: tde@openerp.com-20140124110802-unn4u75ad4jt0bb2
2014-01-24 12:08:02 +01:00