Compare commits

..

25 Commits

Author SHA1 Message Date
Raphaël Valyi
947d287c13 [TEMP] attempt to avoid inconsistent AML writes 2022-12-06 05:35:36 -03:00
Raphaël Valyi
a7ee151f15 [REF] try/except in _compute_matching_number 2022-12-05 20:38:35 -03:00
Raphaël Valyi
819d145763 Merge pull request #188 from akretion/14.0-fix-account_invoice_update_wizard_payment_mode
[14.0][FIX] account_invoice_update_wizard_payment_mode view dependency
2022-11-29 17:15:26 -03:00
clementmbr
45bbcc0cb3 [FIX] account_invoice_update_wizard_payment_mode view dependency 2022-11-29 16:58:25 -03:00
Hpar
6ddc1b86d5 Merge pull request #187 from akretion/eradicate-quick-create-fix-hook
eradicate_quickreate: fix hook
2022-11-07 14:54:29 +01:00
Alexis de Lattre
d0b315f648 [MIG] sale_quotation_title to v14 2022-11-07 12:41:08 +01:00
Hpar
f1eeaa2e8a eradicate_quickreate: fix hook
if the record already exists and is False, we shouldn't create a new record
2022-10-31 15:44:37 +01:00
beau sebastien
553f05c58f Merge pull request #186 from akretion/14.0-add-sale-show-transaction
add sale_show_transaction, that make transaction really visible on sale order
2022-10-28 09:20:27 +02:00
Alexis de Lattre
50ae5dc9cb purchase_usability: remove code now that upstream fix is merged 2022-10-27 23:17:34 +02:00
beau sebastien
9c7775dabb Merge pull request #179 from akretion/14.0-imp-account_invoice_update_wizard
account_invoice_update_wizard: improve UI
2022-10-27 23:13:17 +02:00
Sébastien BEAU
70f1f13edd account_invoice_update_wizard: inactive update of broken payment term
We should add test and fix it
2022-10-27 23:12:02 +02:00
Sébastien BEAU
989960c7c8 account_invoice_update_wizard: fix UI add translation
Add section support and keep order based on the line sequence
Add Fr translation
2022-10-27 23:12:02 +02:00
Sébastien BEAU
9b186028c3 account_usability: aml search on move_id first, then on name/ref 2022-10-27 23:00:22 +02:00
Sébastien BEAU
c2c4957686 account_usability: improve partial reconcile matching_number 2022-10-27 23:00:22 +02:00
beau sebastien
deb37a1688 Merge pull request #184 from akretion/14.0-fix-sale_stock_usability_del_picking_status
[FIX][14.0] Module: sale_stock_usability del picking_status
2022-10-25 12:43:49 +02:00
beau sebastien
6d3e4d83c7 Merge pull request #180 from akretion/14.0-stock_inventory_usability
ADD module stock_inventory_usability
2022-10-25 12:42:53 +02:00
Sébastien BEAU
d382aea22f sale_show_transaction: better naming 2022-10-21 22:48:28 +02:00
Sébastien BEAU
688a07fc5e add sale_show_transaction, that make transaction really visible on sale order 2022-10-21 16:30:39 +02:00
Alexis de Lattre
58afed17e5 purchase_usability: up-port button "Delete lines qty=0" from v10 2022-10-20 11:34:17 +02:00
Alexis de Lattre
b1b4620cdc sale_usability: add client_order_ref in tree view with optional arg 2022-10-18 15:00:16 +02:00
Alexis de Lattre
164397fbac account_usability: remove use of field 'reconciled' in account.move.line filters 2022-10-17 17:03:35 +02:00
Alexis de Lattre
3ae427c5de account_invoice_update_wizard: improve migration to v14
account_invoice_update_wizard: remove 'name' field. Improve field
labels.
Add module account_invoice_update_wizard_payment_mode
2022-10-07 15:54:04 +02:00
Alexis de Lattre
db2cd72d04 account_usability: "Invoicing" -> "Accounting" 2022-10-06 23:02:54 +02:00
Kev-Roche
da8849e745 [FIX][14.0] Module: sale_stock_usability del picking_status 2022-09-26 21:48:33 +02:00
Benoit
c51a847f80 ADD module stock_inventory_usability 2022-07-25 16:21:15 +02:00
46 changed files with 946 additions and 193 deletions

View File

@@ -0,0 +1,243 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_invoice_update_wizard
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: account_invoice_update_wizard
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__price_subtotal
msgid "Amount"
msgstr ""
#. module: account_invoice_update_wizard
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__analytic_account_id
msgid "Analytic Account"
msgstr ""
#. module: account_invoice_update_wizard
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__analytic_tag_ids
msgid "Analytic Tags"
msgstr ""
#. module: account_invoice_update_wizard
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__partner_bank_id
msgid "Bank Account"
msgstr ""
#. module: account_invoice_update_wizard
#: model_terms:ir.ui.view,arch_db:account_invoice_update_wizard.account_invoice_update_form
msgid "Bill Reference"
msgstr ""
#. module: account_invoice_update_wizard
#: model_terms:ir.ui.view,arch_db:account_invoice_update_wizard.account_invoice_update_form
msgid "Cancel"
msgstr ""
#. module: account_invoice_update_wizard
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__company_id
msgid "Company"
msgstr ""
#. module: account_invoice_update_wizard
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__create_uid
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__create_uid
msgid "Created by"
msgstr ""
#. module: account_invoice_update_wizard
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__create_date
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__create_date
msgid "Created on"
msgstr ""
#. module: account_invoice_update_wizard
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__currency_id
msgid "Currency"
msgstr ""
#. module: account_invoice_update_wizard
#: model_terms:ir.ui.view,arch_db:account_invoice_update_wizard.account_invoice_update_form
msgid "Customer Reference"
msgstr ""
#. module: account_invoice_update_wizard
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__name
msgid "Description"
msgstr ""
#. module: account_invoice_update_wizard
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move__display_name
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__display_name
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__display_name
msgid "Display Name"
msgstr ""
#. module: account_invoice_update_wizard
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__display_type
msgid "Display Type"
msgstr ""
#. module: account_invoice_update_wizard
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move__id
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__id
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__id
msgid "ID"
msgstr ""
#. module: account_invoice_update_wizard
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__invoice_id
msgid "Invoice"
msgstr ""
#. module: account_invoice_update_wizard
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__invoice_line_id
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__line_ids
msgid "Invoice Lines"
msgstr ""
#. module: account_invoice_update_wizard
#: model:ir.actions.act_window,name:account_invoice_update_wizard.account_invoice_update_action
msgid "Invoice Update Wizard"
msgstr ""
#. module: account_invoice_update_wizard
#: model:ir.model,name:account_invoice_update_wizard.model_account_move
msgid "Journal Entry"
msgstr ""
#. module: account_invoice_update_wizard
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move____last_update
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update____last_update
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update____last_update
msgid "Last Modified on"
msgstr ""
#. module: account_invoice_update_wizard
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__write_uid
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__write_uid
msgid "Last Updated by"
msgstr ""
#. module: account_invoice_update_wizard
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__write_date
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__write_date
msgid "Last Updated on"
msgstr ""
#. module: account_invoice_update_wizard
#: code:addons/account_invoice_update_wizard/wizard/account_move_update.py:0
#, python-format
msgid "Non-legal fields of invoice updated via the Invoice Update wizard."
msgstr ""
#. module: account_invoice_update_wizard
#: model:ir.model.fields.selection,name:account_invoice_update_wizard.selection__account_move_line_update__display_type__line_note
msgid "Note"
msgstr ""
#. module: account_invoice_update_wizard
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__partner_id
msgid "Partner"
msgstr ""
#. module: account_invoice_update_wizard
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__invoice_payment_term_id
msgid "Payment Term"
msgstr ""
#. module: account_invoice_update_wizard
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__quantity
msgid "Quantity"
msgstr ""
#. module: account_invoice_update_wizard
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__ref
msgid "Reference"
msgstr ""
#. module: account_invoice_update_wizard
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__user_id
msgid "Salesperson"
msgstr ""
#. module: account_invoice_update_wizard
#: model:ir.model.fields.selection,name:account_invoice_update_wizard.selection__account_move_line_update__display_type__line_section
msgid "Section"
msgstr ""
#. module: account_invoice_update_wizard
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__sequence
msgid "Sequence"
msgstr ""
#. module: account_invoice_update_wizard
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__invoice_origin
msgid "Source Document"
msgstr ""
#. module: account_invoice_update_wizard
#: model:ir.model.fields,help:account_invoice_update_wizard.field_account_move_line_update__display_type
msgid "Technical field for UX purpose."
msgstr ""
#. module: account_invoice_update_wizard
#: code:addons/account_invoice_update_wizard/wizard/account_move_update.py:0
#, python-format
msgid ""
"The original payment term '%s' doesn't have the same terms (number of terms "
"and/or amount) as the new payment term '%s'. You can only switch to a "
"payment term that has the same number of terms with the same amount."
msgstr ""
#. module: account_invoice_update_wizard
#: code:addons/account_invoice_update_wizard/wizard/account_move_update.py:0
#, python-format
msgid ""
"This wizard doesn't support the update of payment terms on an invoice which "
"is partially or fully paid."
msgstr ""
#. module: account_invoice_update_wizard
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__move_type
msgid "Type"
msgstr ""
#. module: account_invoice_update_wizard
#: model_terms:ir.ui.view,arch_db:account_invoice_update_wizard.account_invoice_update_form
msgid "Update"
msgstr ""
#. module: account_invoice_update_wizard
#: model_terms:ir.ui.view,arch_db:account_invoice_update_wizard.view_move_form_inherit
msgid "Update Invoice"
msgstr ""
#. module: account_invoice_update_wizard
#: model_terms:ir.ui.view,arch_db:account_invoice_update_wizard.account_invoice_update_form
msgid "Update Invoice Wizard"
msgstr ""
#. module: account_invoice_update_wizard
#: model:ir.model,name:account_invoice_update_wizard.model_account_move_line_update
msgid "Update non-legal fields of invoice lines"
msgstr ""
#. module: account_invoice_update_wizard
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__parent_id
msgid "Wizard"
msgstr ""
#. module: account_invoice_update_wizard
#: model:ir.model,name:account_invoice_update_wizard.model_account_move_update
msgid "Wizard to update non-legal fields of invoice"
msgstr ""

View File

@@ -0,0 +1,250 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_invoice_update_wizard
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: account_invoice_update_wizard
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__price_subtotal
msgid "Amount"
msgstr "Montant"
#. module: account_invoice_update_wizard
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__analytic_account_id
msgid "Analytic Account"
msgstr "Compte Analytique"
#. module: account_invoice_update_wizard
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__analytic_tag_ids
msgid "Analytic Tags"
msgstr "Tag Analytique"
#. module: account_invoice_update_wizard
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__partner_bank_id
msgid "Bank Account"
msgstr "Compte Bancaire"
#. module: account_invoice_update_wizard
#: model_terms:ir.ui.view,arch_db:account_invoice_update_wizard.account_invoice_update_form
#, fuzzy
msgid "Bill Reference"
msgstr "Reference Client"
#. module: account_invoice_update_wizard
#: model_terms:ir.ui.view,arch_db:account_invoice_update_wizard.account_invoice_update_form
msgid "Cancel"
msgstr "Annuler"
#. module: account_invoice_update_wizard
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__company_id
msgid "Company"
msgstr "Société"
#. module: account_invoice_update_wizard
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__create_uid
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__create_uid
msgid "Created by"
msgstr "Créé par"
#. module: account_invoice_update_wizard
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__create_date
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__create_date
msgid "Created on"
msgstr "Créé le"
#. module: account_invoice_update_wizard
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__currency_id
msgid "Currency"
msgstr "Devise"
#. module: account_invoice_update_wizard
#: model_terms:ir.ui.view,arch_db:account_invoice_update_wizard.account_invoice_update_form
#, fuzzy
msgid "Customer Reference"
msgstr "Reference Client"
#. module: account_invoice_update_wizard
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__name
msgid "Description"
msgstr "Description"
#. module: account_invoice_update_wizard
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move__display_name
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__display_name
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__display_name
msgid "Display Name"
msgstr "Nom"
#. module: account_invoice_update_wizard
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__display_type
msgid "Display Type"
msgstr "Type Affichage"
#. module: account_invoice_update_wizard
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move__id
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__id
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__id
msgid "ID"
msgstr ""
#. module: account_invoice_update_wizard
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__invoice_id
msgid "Invoice"
msgstr "Facture"
#. module: account_invoice_update_wizard
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__invoice_line_id
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__line_ids
msgid "Invoice Lines"
msgstr "Ligne de factures"
#. module: account_invoice_update_wizard
#: model:ir.actions.act_window,name:account_invoice_update_wizard.account_invoice_update_action
msgid "Invoice Update Wizard"
msgstr "Assistance de mise à jour de la facture"
#. module: account_invoice_update_wizard
#: model:ir.model,name:account_invoice_update_wizard.model_account_move
msgid "Journal Entry"
msgstr "Entrée comptable"
#. module: account_invoice_update_wizard
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move____last_update
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update____last_update
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update____last_update
msgid "Last Modified on"
msgstr ""
#. module: account_invoice_update_wizard
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__write_uid
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__write_uid
msgid "Last Updated by"
msgstr ""
#. module: account_invoice_update_wizard
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__write_date
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__write_date
msgid "Last Updated on"
msgstr ""
#. module: account_invoice_update_wizard
#: code:addons/account_invoice_update_wizard/wizard/account_move_update.py:0
#, python-format
msgid "Non-legal fields of invoice updated via the Invoice Update wizard."
msgstr "Champs non légaux mis à jour via l'assistant"
#. module: account_invoice_update_wizard
#: model:ir.model.fields.selection,name:account_invoice_update_wizard.selection__account_move_line_update__display_type__line_note
msgid "Note"
msgstr ""
#. module: account_invoice_update_wizard
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__partner_id
msgid "Partner"
msgstr "Client"
#. module: account_invoice_update_wizard
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__invoice_payment_term_id
msgid "Payment Term"
msgstr "Condition de paiement"
#. module: account_invoice_update_wizard
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__quantity
msgid "Quantity"
msgstr "Quantité"
#. module: account_invoice_update_wizard
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__ref
#, fuzzy
msgid "Reference"
msgstr "Reference Client"
#. module: account_invoice_update_wizard
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__user_id
msgid "Salesperson"
msgstr "Vendeur"
#. module: account_invoice_update_wizard
#: model:ir.model.fields.selection,name:account_invoice_update_wizard.selection__account_move_line_update__display_type__line_section
msgid "Section"
msgstr ""
#. module: account_invoice_update_wizard
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__sequence
msgid "Sequence"
msgstr "Sequence"
#. module: account_invoice_update_wizard
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__invoice_origin
msgid "Source Document"
msgstr "Origine du document"
#. module: account_invoice_update_wizard
#: model:ir.model.fields,help:account_invoice_update_wizard.field_account_move_line_update__display_type
msgid "Technical field for UX purpose."
msgstr ""
#. module: account_invoice_update_wizard
#: code:addons/account_invoice_update_wizard/wizard/account_move_update.py:0
#, python-format
msgid ""
"The original payment term '%s' doesn't have the same terms (number of terms "
"and/or amount) as the new payment term '%s'. You can only switch to a "
"payment term that has the same number of terms with the same amount."
msgstr ""
#. module: account_invoice_update_wizard
#: code:addons/account_invoice_update_wizard/wizard/account_move_update.py:0
#, python-format
msgid ""
"This wizard doesn't support the update of payment terms on an invoice which "
"is partially or fully paid."
msgstr ""
#. module: account_invoice_update_wizard
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__move_type
msgid "Type"
msgstr ""
#. module: account_invoice_update_wizard
#: model_terms:ir.ui.view,arch_db:account_invoice_update_wizard.account_invoice_update_form
msgid "Update"
msgstr "Mettre à jour"
#. module: account_invoice_update_wizard
#: model_terms:ir.ui.view,arch_db:account_invoice_update_wizard.view_move_form_inherit
msgid "Update Invoice"
msgstr "Mettre à jour"
#. module: account_invoice_update_wizard
#: model_terms:ir.ui.view,arch_db:account_invoice_update_wizard.account_invoice_update_form
msgid "Update Invoice Wizard"
msgstr "Assistant de mise à jour"
#. module: account_invoice_update_wizard
#: model:ir.model,name:account_invoice_update_wizard.model_account_move_line_update
msgid "Update non-legal fields of invoice lines"
msgstr "Mettre à jour les champs non légaux des lignes de facture"
#. module: account_invoice_update_wizard
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__parent_id
msgid "Wizard"
msgstr ""
#. module: account_invoice_update_wizard
#: model:ir.model,name:account_invoice_update_wizard.model_account_move_update
msgid "Wizard to update non-legal fields of invoice"
msgstr "Assistant pour mettre à jours les champs non légaux"
#~ msgid "Account"
#~ msgstr "Compte"

View File

@@ -11,9 +11,8 @@ class AccountMove(models.Model):
self.ensure_one()
wizard = self.env['account.move.update']
res = wizard._prepare_default_get(self)
action = self.env.ref(
'account_invoice_update_wizard.account_invoice_update_action'
).read()[0]
action = self.env["ir.actions.actions"]._for_xml_id(
'account_invoice_update_wizard.account_invoice_update_action')
action['name'] = "Update Wizard"
action['res_id'] = wizard.create(res).id
return action

View File

@@ -14,16 +14,13 @@ class AccountMoveUpdate(models.TransientModel):
invoice_id = fields.Many2one(
'account.move', string='Invoice', required=True,
readonly=True)
type = fields.Selection(related='invoice_id.move_type', readonly=True)
company_id = fields.Many2one(
related='invoice_id.company_id', readonly=True)
partner_id = fields.Many2one(
related='invoice_id.partner_id', readonly=True)
move_type = fields.Selection(related='invoice_id.move_type')
company_id = fields.Many2one(related='invoice_id.company_id')
partner_id = fields.Many2one(related='invoice_id.partner_id')
user_id = fields.Many2one('res.users', string='Salesperson')
invoice_payment_term_id = fields.Many2one(
'account.payment.term', string='Payment Term')
ref = fields.Char(string='Invoice Reference')
name = fields.Char(string='Reference/Description')
ref = fields.Char(string='Reference') # field label is customized in the view
invoice_origin = fields.Char(string='Source Document')
partner_bank_id = fields.Many2one(
'res.partner.bank', string='Bank Account')
@@ -33,7 +30,7 @@ class AccountMoveUpdate(models.TransientModel):
@api.model
def _simple_fields2update(self):
'''List boolean, date, datetime, char, text fields'''
return ['ref', 'name', 'invoice_origin']
return ['ref', 'invoice_origin']
@api.model
def _m2o_fields2update(self):
@@ -51,19 +48,21 @@ class AccountMoveUpdate(models.TransientModel):
aa_tags = [(6, 0, aa_tags.ids)] if aa_tags else False
res['line_ids'].append([0, 0, {
'invoice_line_id': line.id,
'sequence': line.sequence,
'name': line.name,
'quantity': line.quantity,
'price_subtotal': line.price_subtotal,
'analytic_account_id': line.analytic_account_id.id,
'currency_id': line.currency_id.id,
'analytic_tag_ids': aa_tags,
'display_type': line.display_type,
}])
return res
@api.onchange('type')
def type_on_change(self):
@api.onchange('move_type')
def move_type_on_change(self):
res = {'domain': {}}
if self.type in ('out_invoice', 'out_refund'):
if self.move_type in ('out_invoice', 'out_refund'):
res['domain']['partner_bank_id'] =\
"[('partner_id.ref_company_ids', 'in', [company_id])]"
else:
@@ -233,7 +232,9 @@ class AccountMoveUpdate(models.TransientModel):
class AccountMoveLineUpdate(models.TransientModel):
_name = 'account.move.line.update'
_description = 'Update non-legal fields of invoice lines'
_order = "sequence, name"
sequence = fields.Integer()
parent_id = fields.Many2one(
'account.move.update', string='Wizard', ondelete='cascade')
invoice_line_id = fields.Many2one(
@@ -243,11 +244,11 @@ class AccountMoveLineUpdate(models.TransientModel):
('line_section', "Section"),
('line_note', "Note")], default=False, help="Technical field for UX purpose.")
quantity = fields.Float(
string='Quantity', digits=dp.get_precision('Product Unit of Measure'),
readonly=True)
price_subtotal = fields.Float(
string='Amount', readonly=True, digits=dp.get_precision('Account'))
string='Quantity', digits='Product Unit of Measure', readonly=True)
price_subtotal = fields.Monetary(
string='Amount', readonly=True)
analytic_account_id = fields.Many2one(
'account.analytic.account', string='Analytic Account')
analytic_tag_ids = fields.Many2many(
'account.analytic.tag', string='Analytic Tags')
currency_id = fields.Many2one('res.currency', readonly=True)

View File

@@ -12,26 +12,28 @@
<form string="Update Invoice Wizard">
<group name="main">
<field name="invoice_id" invisible="1"/>
<field name="type" invisible="1"/>
<field name="move_type" invisible="1"/>
<field name="company_id" invisible="1"/>
<field name="partner_id" invisible="1"/>
<field name="ref" attrs="{'invisible': [('type', 'not in', ('in_invoice', 'in_refund'))]}"/>
<field string="Bill Reference" attrs="{'invisible': [('move_type', 'not in', ('in_invoice', 'in_refund'))]}" name="ref"/>
<field string="Customer Reference" attrs="{'invisible': [('move_type', 'not in', ('out_invoice', 'out_refund'))]}" name="ref"/>
<field name="invoice_origin"/>
<field name="name"/>
<field name="invoice_payment_term_id" widget="selection"/>
<!-- update of payment term is broken -->
<!-- <field name="invoice_payment_term_id" widget="selection"/>-->
<field name="partner_bank_id"/>
<field name="user_id"/>
<field name="user_id" options="{'no_open': True, 'no_create': True, 'no_create_edit': True}"/>
</group>
<group name="lines">
<field name="line_ids" nolabel="1">
<field name="line_ids" nolabel="1" widget="section_and_note_one2many">
<tree editable="bottom" create="false" delete="false" edit="true">
<field name="invoice_line_id" invisible="1"/>
<field name="display_type" invisible="1"/>
<field name="currency_id" invisible="1"/>
<field name="name"/>
<field name="quantity" attrs="{'invisible': [('display_type', '!=', False)]}"/>
<field name="price_subtotal" attrs="{'invisible': [('display_type', '!=', False)]}"/>
<field name="analytic_account_id" attrs="{'invisible': [('display_type', '!=', False)]}" groups="analytic.group_analytic_accounting"/>
<field name="analytic_tag_ids" attrs="{'invisible': [('display_type', '!=', False)]}" groups="analytic.group_analytic_accounting" widget="many2many_tags"/>
<field name="analytic_tag_ids" attrs="{'invisible': [('display_type', '!=', False)]}" groups="analytic.group_analytic_tags" widget="many2many_tags"/>
</tree>
</field>
</group>

View File

@@ -0,0 +1,39 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: https://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
Account Invoice Update Wizard
=============================
This module adds a button *Update Invoice* on Customer and Supplier invoices in
Open or Paid state. This button starts a wizard which allows the user to update
non-legal fields of the invoice:
* Source Document
* Reference/Description
* Payment terms (update allowed only to a payment term with same number of terms
of the same amount and on invoices without any payment)
* Bank Account
* Salesman
* Notes
* Description of invoice lines
* Analytic account
* Analytic tags
Bug Tracker
===========
Bugs are tracked on `GitHub Issues
<https://github.com/akretion/odoo-usability/issues>`_. In case of trouble, please
check there if your issue has already been reported. If you spotted it first,
help us smash it by providing detailed and welcomed feedback.
Contributors
------------
* Alexis de Lattre <alexis.delattre@akretion.com>
* Florian da Costa <florian.dacosta@akretion.com>
* Matthieu Dietrich <matthieu.dietrich@camptocamp.com>
* Yannick Vaucher <yannick.vaucher@camptocamp.com>
* Mykhailo Panarin <m.panarin@mobilunity.com>
* Artem Kostyuk <a.kostyuk@mobilunity.com>

View File

@@ -0,0 +1 @@
from . import wizard

View File

@@ -0,0 +1,17 @@
# Copyright 2022 Akretion France (http://www.akretion.com/)
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
'name': 'Account Invoice Update Wizard Payment Mode',
'version': '14.0.1.0.0',
'category': 'Accounting & Finance',
'license': 'AGPL-3',
'summary': 'Add Payment Mode to Invoice Update Wizard',
'author': 'Akretion',
'website': 'https://github.com/akretion/odoo-usability',
'depends': ['account_invoice_update_wizard', 'account_payment_partner'],
'data': ['wizard/account_move_update_view.xml'],
'installable': True,
'auto_install': True,
}

View File

@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2017 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<odoo>
<record id="view_move_form_inherit" model="ir.ui.view">
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_move_form"/>
<field name="arch" type="xml">
<button name="button_draft" position="before">
<button name="prepare_update_wizard" type="object" string="Update Invoice" states="posted" groups="account.group_account_invoice"/>
</button>
</field>
</record>
</odoo>

View File

@@ -0,0 +1 @@
from . import account_move_update

View File

@@ -0,0 +1,24 @@
# Copyright 2022 Akretion France (http://www.akretion.com/)
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import models, fields, api, _
class AccountMoveUpdate(models.TransientModel):
_inherit = 'account.move.update'
payment_mode_filter_type_domain = fields.Char(
related='invoice_id.payment_mode_filter_type_domain')
partner_bank_filter_type_domain = fields.Many2one(
related='invoice_id.partner_bank_filter_type_domain')
bank_account_required = fields.Boolean(
related='invoice_id.bank_account_required')
payment_mode_id = fields.Many2one("account.payment.mode")
@api.model
def _m2o_fields2update(self):
m2o_list = super()._m2o_fields2update()
m2o_list.append('payment_mode_id')
return m2o_list

View File

@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2022 Akretion France (http://www.akretion.com/)
@author: Alexis de Lattre <alexis.delattre@akretion.com>
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
-->
<odoo>
<record id="account_invoice_update_form" model="ir.ui.view">
<field name="model">account.move.update</field>
<field name="inherit_id" ref="account_invoice_update_wizard.account_invoice_update_form"/>
<field name="arch" type="xml">
<field name="partner_bank_id" position="before">
<field name="payment_mode_filter_type_domain" invisible="1"/>
<field name="partner_bank_filter_type_domain" invisible="1"/>
<field name="bank_account_required" invisible="1"/>
<field name="payment_mode_id" domain="[('payment_type', '=', payment_mode_filter_type_domain), ('company_id', '=', company_id)]"/>
</field>
<field name="partner_bank_id" position="attributes">
<attribute name="domain">
[('partner_id', '=', partner_bank_filter_type_domain),
'|',('company_id', '=', company_id),('company_id', '=', False)]
</attribute>
<attribute name="attrs">{'required': [('bank_account_required', '=', True),('move_type', 'in', ('in_invoice', 'in_refund'))]}</attribute>
</field>
</field>
</record>
</odoo>

View File

@@ -1,2 +1,3 @@
from . import models
from . import wizard
from .hooks import post_init_hook

View File

@@ -4,7 +4,7 @@
{
'name': 'Account Usability',
'version': '14.0.1.0.0',
'version': '14.0.1.1.0',
'category': 'Accounting & Finance',
'license': 'AGPL-3',
'summary': 'Small usability enhancements in account module',
@@ -41,4 +41,5 @@
],
'qweb': ['static/src/xml/account_payment.xml'],
'installable': True,
"post_init_hook": "post_init_hook",
}

View File

@@ -0,0 +1,9 @@
# Copyright 2022 Akretion (https://www.akretion.com).
# @author Sébastien BEAU <sebastien.beau@akretion.com>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import SUPERUSER_ID, api
def post_init_hook(cr, registry):
env = api.Environment(cr, SUPERUSER_ID, {})
# env["account.move.line"].update_matching_number()

View File

@@ -524,11 +524,6 @@ msgstr ""
msgid "Recipient Bank"
msgstr ""
#. module: account_usability
#: model:ir.model.fields,field_description:account_usability.field_account_move_line__reconcile_string
msgid "Reconcile"
msgstr ""
#. module: account_usability
#: model:ir.model.fields,field_description:account_usability.field_account_bank_statement_line__ref
#: model:ir.model.fields,field_description:account_usability.field_account_move__ref

View File

@@ -0,0 +1,9 @@
# Copyright 2020 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import SUPERUSER_ID, api
def migrate(cr, version):
env = api.Environment(cr, SUPERUSER_ID, {})
# env["account.move.line"].update_matching_number()

View File

@@ -2,12 +2,17 @@
# @author Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from datetime import timedelta
import logging
from psycopg2 import IntegrityError
from odoo import api, fields, models, _
from odoo.exceptions import UserError
from odoo.osv import expression
from odoo.tools import float_is_zero
from odoo.tools.misc import format_date
from odoo.osv import expression
from datetime import timedelta
from odoo.exceptions import UserError
_logger = logging.getLogger(__name__)
class AccountMove(models.Model):
@@ -217,7 +222,7 @@ class AccountMove(models.Model):
if self.is_purchase_document(include_receipts=True):
tax_lock_date = self.company_id.tax_lock_date
if invoice_date and tax_lock_date and has_tax and invoice_date <= tax_lock_date:
invoice_date = tax_lock_date + timedelta(days=1)
invoice_date = tax_lock_date + timedelta(days=1)
date = invoice_date
return date
@@ -238,8 +243,6 @@ class AccountMoveLine(models.Model):
full_reconcile_id = fields.Many2one(string='Full Reconcile')
matched_debit_ids = fields.One2many(string='Partial Reconcile Debit')
matched_credit_ids = fields.One2many(string='Partial Reconcile Credit')
reconcile_string = fields.Char(
compute='_compute_reconcile_string', string='Reconcile', store=True)
# for optional display in tree view
product_barcode = fields.Char(related='product_id.barcode', string="Product Barcode")
@@ -255,17 +258,28 @@ class AccountMoveLine(models.Model):
})
return action
@api.depends(
'full_reconcile_id', 'matched_debit_ids', 'matched_credit_ids')
def _compute_reconcile_string(self):
for line in self:
rec_str = False
if line.full_reconcile_id:
rec_str = line.full_reconcile_id.name
else:
rec_str = ', '.join([
'a%d' % pr.id for pr in line.matched_debit_ids + line.matched_credit_ids])
line.reconcile_string = rec_str
def update_matching_number(self):
records = self.search([("matching_number", "=", "P")])
_logger.info(f"Update partial reconcile number for {len(records)} lines")
records._compute_matching_number()
def _compute_matching_number(self):
# TODO maybe it will be better to have the same maching_number for
# all partial so it will be easier to group by
for record in self:
try:
super(AccountMoveLine, record)._compute_matching_number()
if record.matching_number == "P":
record.matching_number = ", ".join([
"a%d" % pr.id
for pr in record.matched_debit_ids + record.matched_credit_ids
])
except IntegrityError as error:
_logger.info(
f"unable to update matching number for line ID {record.id},"
"{record.display_name}"
)
_logger.info(error)
def _get_computed_name(self):
# This is useful when you want to have the product code in a dedicated

View File

@@ -13,4 +13,9 @@ under "Accounting > Configuration", because most users will try to find it there
<menuitem id="res_partner_bank_account_config_menu" action="base.action_res_partner_bank_account_form" parent="account.account_banks_menu" sequence="20"/>
<record id="account.menu_finance" model="ir.ui.menu">
<!-- Replace "Invoicing" by "Accounting" -->
<field name="name">Accounting</field>
</record>
</odoo>

View File

@@ -42,8 +42,7 @@
<attribute name="optional">show</attribute>
</xpath>
<xpath expr="//field[@name='line_ids']/tree/field[@name='tax_tag_ids']" position="after">
<field name="matching_number" optional="hide"/>
<field name="reconcile_string" optional="show"/>
<field name="matching_number" optional="show"/>
</xpath>
<xpath expr="//field[@name='invoice_line_ids']/tree/field[@name='product_id']" position="after">
<field name="product_barcode" optional="hide"/>
@@ -106,20 +105,21 @@
<separator/>
</filter>
<field name="partner_id" position="after">
<field name="reconcile_string" />
<field name="matching_number" />
<field name="debit" filter_domain="['|', ('debit', '=', self), ('credit', '=', self)]" string="Debit or Credit"/>
</field>
<filter name="unreconciled" position="before">
<filter name="reconciled" string="Fully Reconciled" domain="[('reconciled', '=', True)]"/>
<filter name="reconciled" string="Fully Reconciled" domain="[('account_id.reconcile', '=', True), ('full_reconcile_id', '!=', False)]"/>
</filter>
<filter name="unreconciled" position="attributes">
<attribute name="string">Unreconciled or Partially Reconciled</attribute>
<attribute name="domain">[('reconciled', '=', False), ('balance', '!=', 0), ('account_id.reconcile', '=', True)]</attribute>
</filter>
<!--
<field name="name" position="attributes">
<attribute name="string">Name or Reference</attribute>
</field> -->
<attribute name="string">Label, Reference, Account or Partner</attribute>
</field>
<field name="name" position="before">
<field name="move_id" position="move"/>
</field>
<field name="partner_id" position="attributes">
<attribute name="domain">['|', ('parent_id', '=', False), ('is_company', '=', True)]</attribute>
</field>

View File

@@ -10,7 +10,7 @@ def web_m2x_options_create(cr, registry):
env = Environment(cr, SUPERUSER_ID, {})
config_parameter = env['ir.config_parameter'].search(
[('key', '=', 'web_m2x_options.create')])
if config_parameter and config_parameter.value != 'False':
if config_parameter:
config_parameter.write({'value': 'False'})
else:
env['ir.config_parameter'].create({

View File

@@ -1,17 +0,0 @@
# Copyright 2021 Akretion
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Mail Message Date Order",
"description": """
Order chatter's messages by date instead of by ID
""",
"version": "14.0.1.0.0",
"license": "AGPL-3",
"author": "Akretion",
"website": "akretion.com",
"depends": ["mail"],
"data": [],
"demo": [],
"data": ["views/mail_message_date_order.xml"],
}

View File

@@ -1,22 +0,0 @@
odoo.define("mail_message_date_order/static/src/models/mail_message_date_order.js", function(require) {
"use strict";
function factory(dependencies) {
class ThreadCache extends dependencies['mail.model'] {
/**
* @override
*/
_computeOrderedMessages() {
const res = super._computeOrderedMessages(...arguments);
console.log("---IN OVERRIDE ORDERED MESSAGES cache");
// return [['replace', this.messages.sort((m1, m2) => m1.date._d < m2.date._d ? -1 : 1)]];
return res;
}
}
}
});

View File

@@ -1,15 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<template
id="assets_backend"
name="mail_message_date_order assets"
inherit_id="mail.assets_backend"
>
<xpath expr="." position="inside">
<script
type="text/javascript"
src="/mail_message_date_order/static/src/models/mail_message_date_order.js"
/>
</xpath>
</template>
</odoo>

View File

@@ -14,6 +14,7 @@
'data': [
'views/purchase_order.xml',
'views/purchase_report.xml',
'views/account_move.xml',
],
'installable': True,
}

View File

@@ -1,3 +1,4 @@
from . import purchase_order
from . import product_template
from . import res_partner
from . import account_move

View File

@@ -0,0 +1,21 @@
# Copyright 2022 Akretion France (http://www.akretion.com/)
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import models
class AccountMove(models.Model):
_inherit = 'account.move'
def delete_lines_qty_zero(self):
# When a user pulls a PO from a supplier invoice, it creates
# all lines including lines that haven't been received. It can be time-consuming
# to delete all these lines with qty = 0
self.ensure_one()
lines = self.env['account.move.line'].search([
('move_id', '=', self.id),
('quantity', '=', 0),
('display_type', '=', False),
])
lines.unlink()

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2022 Akretion France (http://www.akretion.com/)
@author: Alexis de Lattre <alexis.delattre@akretion.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<odoo>
<record id="view_move_form" model="ir.ui.view">
<field name="model">account.move</field>
<field name="inherit_id" ref="purchase.view_move_form_inherit_purchase"/>
<field name="arch" type="xml">
<button name="button_draft" position="after">
<button name="delete_lines_qty_zero" attrs="{'invisible': ['|', ('state', '!=', 'draft'), ('move_type', '!=', 'in_invoice')]}" string="Delete Lines Qty=0" type="object"/>
</button>
</field>
</record>
</odoo>

View File

@@ -30,10 +30,6 @@
<field name="date_approve" position="after">
<field name="origin"/>
</field>
<!-- Remove once this PR is merged https://github.com/odoo/odoo/pull/35073 -->
<xpath expr="//field[@name='order_line']/form//field[@name='analytic_tag_ids']" position="attributes">
<attribute name="groups">analytic.group_analytic_tags</attribute>
</xpath>
<xpath expr="//field[@name='order_line']/tree//field[@name='product_id']" position="after">
<field name="product_supplier_code" optional="hide"/>
<field name="product_barcode" optional="hide"/>

View File

@@ -1,10 +1,10 @@
# Copyright 2016-2019 Akretion (http://www.akretion.com)
# Copyright 2016-2022 Akretion (http://www.akretion.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
# @author Alexis de Lattre <alexis.delattre@akretion.com>
{
'name': 'Sale Quotation Title',
'version': '12.0.1.0.0',
'version': '14.0.1.0.0',
'category': 'Sales',
'license': 'AGPL-3',
'summary': 'Adds a title field on quotations',
@@ -21,5 +21,5 @@ This module has been written by Alexis de Lattre from Akretion
'website': 'http://www.akretion.com',
'depends': ['sale'],
'data': ['sale_view.xml'],
'installable': False,
'installable': True,
}

View File

@@ -1,11 +1,11 @@
# Copyright 2016-2019 Akretion (http://www.akretion.com)
# Copyright 2016-2022 Akretion (http://www.akretion.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
# @author Alexis de Lattre <alexis.delattre@akretion.com>
from odoo import models, fields
from odoo import fields, models
class SaleOrder(models.Model):
_inherit = 'sale.order'
quotation_title = fields.Char(string="Quotation Title")
quotation_title = fields.Char()

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2016-2019 Akretion (http://www.akretion.com/)
Copyright 2016-2022 Akretion (http://www.akretion.com/)
@author Alexis de Lattre <alexis.delattre@akretion.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
@@ -14,7 +14,7 @@
<field name="inherit_id" ref="sale.view_order_tree"/>
<field name="arch" type="xml">
<field name="user_id" position="before">
<field name="quotation_title"/>
<field name="quotation_title" optional="show"/>
</field>
</field>
</record>
@@ -25,7 +25,7 @@
<field name="inherit_id" ref="sale.view_quotation_tree"/>
<field name="arch" type="xml">
<field name="user_id" position="before">
<field name="quotation_title"/>
<field name="quotation_title" optional="show"/>
</field>
</field>
</record>

View File

@@ -0,0 +1 @@
from . import models

View File

@@ -0,0 +1,25 @@
# Copyright 2022 Akretion (https://www.akretion.com).
# @author Sébastien BEAU <sebastien.beau@akretion.com>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Sale Show Transaction",
"summary": "Make transaction hyper visible on sale order",
"version": "14.0.1.0.0",
"development_status": "Alpha",
"category": "Uncategorized",
"website": "www.akretion.com",
"author": " Akretion",
"license": "AGPL-3",
"external_dependencies": {
"python": [],
"bin": [],
},
"depends": [
"sale",
],
"data": [
"views/sale_order_view.xml",
],
"demo": [
],
}

View File

@@ -0,0 +1 @@
from . import sale_order

View File

@@ -0,0 +1,30 @@
# Copyright 2022 Akretion (https://www.akretion.com).
# @author Sébastien BEAU <sebastien.beau@akretion.com>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import _, api, fields, models
class SaleOrder(models.Model):
_inherit = 'sale.order'
main_acquirer_id = fields.Many2one(
'payment.acquirer',
'Online payment mode',
compute="_compute_main_acquirer",
store=True)
@api.depends("transaction_ids.state")
def _compute_main_acquirer(self):
for record in self:
if len(record.transaction_ids.acquirer_id) > 1:
for state in ["done", "authorized", "pending", "draft", "cancel", "error"]:
transaction = record.transaction_ids.filtered(lambda s: s.state == state)
if len(transaction.acquirer_id) > 1:
transaction.sorted("amount")
if transaction:
record.main_acquirer_id = transaction[0].acquirer_id
break
else:
record.main_acquirer_id = record.transaction_ids.acquirer_id

View File

@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<record id="sale_order_view_form" model="ir.ui.view">
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form" />
<field name="arch" type="xml">
<field name="note" position="after">
<separator string="Transaction" colspan="4"/>
<field name="transaction_ids" nolabel="1" colspan="4">
<tree
decoration-danger="state in ('error', 'cancel')"
decoration-success="state == 'done'"
>
<field name="reference"/>
<field name="create_date"/>
<field name="acquirer_id"/>
<field name="amount"/>
<field name="state"/>
</tree>
</field>
</field>
</field>
</record>
<record id="view_order_tree" model="ir.ui.view">
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_tree" />
<field name="arch" type="xml">
<field name="state" position="after">
<field name="main_acquirer_id"/>
</field>
</field>
</record>
<record id="view_quotation_tree" model="ir.ui.view">
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_quotation_tree" />
<field name="arch" type="xml">
<field name="currency_id" position="after">
<field name="main_acquirer_id"/>
</field>
</field>
</record>
</odoo>

View File

@@ -11,44 +11,6 @@ class SaleOrder(models.Model):
warehouse_id = fields.Many2one(tracking=True)
incoterm = fields.Many2one(tracking=True)
picking_status = fields.Selection([
('delivered', 'Fully Delivered'),
('partially_delivered', 'Partially Delivered'),
('to_deliver', 'To Deliver'),
('cancel', 'Delivery Cancelled'),
('no', 'Nothing to Deliver')
], string='Picking Status', compute='_compute_picking_status',
store=True)
@api.depends('state', 'picking_ids.state')
def _compute_picking_status(self):
"""
Compute the picking status for the SO. Possible statuses:
- no: if the SO is not in status 'sale' nor 'done', we consider that
there is nothing to deliver. This is also the default value if the
conditions of no other status is met.
- cancel: all pickings are cancelled
- delivered: if all pickings are done or cancel.
- partially_delivered: If at least one picking is done.
- to_deliver: if all pickings are in confirmed, assigned, waiting or
cancel state.
"""
for order in self:
picking_status = 'no'
if order.state in ('sale', 'done') and order.picking_ids:
pstates = [
picking.state for picking in order.picking_ids]
if all([state == 'cancel' for state in pstates]):
picking_status = 'cancel'
elif all([state in ('done', 'cancel') for state in pstates]):
picking_status = 'delivered'
elif any([state == 'done' for state in pstates]):
picking_status = 'partially_delivered'
elif all([
state in ('confirmed', 'assigned', 'waiting', 'cancel')
for state in pstates]):
picking_status = 'to_deliver'
order.picking_status = picking_status
def report_qty_to_deliver(self):
# Can be useful for delivery report

View File

@@ -12,41 +12,10 @@
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale_stock.view_order_form_inherit_sale_stock"/>
<field name="arch" type="xml">
<field name="picking_policy" position="after">
<field name="picking_status"/>
</field>
<!-- move warehouse_id to the top, not hidden in the 2nd tab -->
<group name="order_details" position="inside">
<field name="warehouse_id" options="{'no_create': True}" groups="stock.group_stock_multi_warehouses" force_save="1" position="move"/>
</group>
</field>
</record>
<record id="view_order_tree" model="ir.ui.view">
<field name="name">sale_stock_usability.order.tree</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_tree"/>
<field name="arch" type="xml">
<field name="invoice_status" position="before">
<field name="picking_status" decoration-success="picking_status == 'delivered'" decoration-info="picking_status == 'to_deliver'" decoration-warning="picking_status == 'partially_delivered'" decoration-danger="picking_status == 'cancel'" widget="badge" optional="show"/>
</field>
</field>
</record>
<record id="view_sales_order_filter" model="ir.ui.view">
<field name="name">sale_stock_usability.order.search</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_sales_order_filter"/>
<field name="arch" type="xml">
<filter name="my_sale_orders_filter" position="after">
<separator/>
<filter string="Not Fully Delivered" name="not_fully_delivered"
domain="[('picking_status', 'in', ('to_deliver', 'partially_delivered'))]"/>
<filter string="Fully Delivered" name="fully_delivered"
domain="[('picking_status', '=', 'delivered')]"/>
<separator/>
</filter>
</field>
</record>
</odoo>

View File

@@ -46,6 +46,9 @@
<field name="amount_untaxed" position="attributes">
<attribute name="optional">show</attribute>
</field>
<field name="partner_id" position="after">
<field name="client_order_ref" optional="hide"/>
</field>
</field>
</record>
@@ -60,6 +63,9 @@
<field name="state" position="attributes">
<attribute name="invisible">0</attribute>
</field>
<field name="partner_id" position="after">
<field name="client_order_ref" optional="show"/>
</field>
</field>
</record>

View File

@@ -0,0 +1 @@
from . import models

View File

@@ -0,0 +1,18 @@
# Copyright 2022 Akretion (https://www.akretion.com).
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
"name": "Stock Inventory Usability",
"summary": "Stock inventory usability.",
"version": "14.0.1.0.1",
"development_status": "Mature",
"author": "Akretion",
"website": "https://github.com/akretion/odoo-usability",
"category": "Warehouse",
"depends": ["stock"],
"data": [
"views/stock_inventory.xml",
],
"license": "AGPL-3",
"installable": True,
"application": False,
}

View File

@@ -0,0 +1 @@
from . import stock_inventory

View File

@@ -0,0 +1,17 @@
# Copyright 2022 Akretion (https://www.akretion.com).
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import _, fields, models, api
from odoo.exceptions import UserError
class Inventory(models.Model):
_inherit = "stock.inventory"
prefill_counted_quantity = fields.Selection(default="zero")
estimated_inventory_lines = fields.Float(compute="_compute_estimated_inventory_lines") #store ?
@api.depends("location_ids", "product_ids")
def _compute_estimated_inventory_lines(self):
for inv in self:
inv.estimated_inventory_lines = len(inv._get_quantities())

View File

@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2022 Akretion (https://www.akretion.com).
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<odoo>
<record id="view_inventory_form" model="ir.ui.view">
<field
name="name"
>Inventory form view - stock_inventory_usability extension</field>
<field name="model">stock.inventory</field>
<field name="inherit_id" ref="stock.view_inventory_form" />
<field name="arch" type="xml">
<field name="prefill_counted_quantity" position="attributes">
<attribute name="invisible">1</attribute>
</field>
<field name="exhausted" position="attributes">
<attribute name="invisible">1</attribute>
</field>
<field name="accounting_date" position="attributes">
<attribute name="invisible">1</attribute>
</field>
<field name="product_ids" position="after">
<field name="estimated_inventory_lines" readonly="1" states="draft"/>
</field>
</field>
</record>
</odoo>