diff --git a/account_usability/__init__.py b/account_usability/__init__.py index dcab2b0..e8be423 100644 --- a/account_usability/__init__.py +++ b/account_usability/__init__.py @@ -3,4 +3,5 @@ from . import account from . import account_invoice_report from . import partner +from . import product from . import wizard diff --git a/account_usability/i18n/fr.po b/account_usability/i18n/fr.po new file mode 100644 index 0000000..01383bd --- /dev/null +++ b/account_usability/i18n/fr.po @@ -0,0 +1,561 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_usability +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2020-10-23 16:16+0000\n" +"PO-Revision-Date: 2020-10-23 16:16+0000\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_usability +#: model:ir.model.fields,help:account_usability.field_account_invoice_line_state +msgid " * The 'Draft' status is used when a user is encoding a new and unconfirmed Invoice.\n" +" * The 'Pro-forma' status is used when the invoice does not have an invoice number.\n" +" * The 'Open' status is used when user creates invoice, an invoice number is generated. It stays in the open status till the user pays the invoice.\n" +" * The 'Paid' status is set automatically when the invoice is paid. Its related journal entries may or may not be reconciled.\n" +" * The 'Cancelled' status is used when user cancel invoice." +msgstr "* L'état \"Brouillon\" est utilisé lorsqu'un utilisateur est en train de saisir ou de modifier une nouvelle facture non confirmée.\n" +"* L'état \"Pro-forma\" est utilisé lorsque la facture n'a pas de numéro de facture.\n" +"* L'état 'Ouvert' est utilisé lorsque l'utilisateur crée une facture, celle-ci a alors un numéro de facture. La facture reste dans l'état \"Ouvert\" tant qu'elle n'est pas payée.\n" +"* L'état 'Payé' est affecté automatiquement lorsque la facture est payée. Les écritures correspondantes dans les journaux peuvent ou non être lettrées.\n" +"* L'état \"Annulé\" est utilisé lorsque l'utilisateur annule la facture." + +#. module: account_usability +#: model:ir.ui.view,arch_db:account_usability.view_move_line_form +msgid "-> View partially reconciled entries" +msgstr "-> Voir les écritures partiellement lettrées" + +#. module: account_usability +#: model:ir.ui.view,arch_db:account_usability.view_move_line_form +msgid "sent all the selected invoices in open or paid state." +msgstr "This wizard will mark as sent all the selected invoices in open or paid state." + +#. module: account_usability +#: model:ir.ui.view,arch_db:account_usability.view_account_invoice_report_search +msgid "This year and previous" +msgstr "Cette année et la précédente" + +#. module: account_usability +#: model:ir.ui.view,arch_db:account_usability.view_account_invoice_filter +msgid "To Send" +msgstr "A envoyer" + +#. module: account_usability +#: model:ir.ui.view,arch_db:account_usability.view_move_line_tree +msgid "Total Balance" +msgstr "Total Balance" + +#. module: account_usability +#: model:ir.model.fields,field_description:account_usability.field_account_invoice_line_invoice_type +#: model:ir.ui.view,arch_db:account_usability.view_account_journal_search +msgid "Type" +msgstr "Type" + +#. module: account_usability +#: model:ir.actions.act_window,name:account_usability.account_move_backtodraft_action +#: model:ir.ui.view,arch_db:account_usability.account_move_backtodraft_form +msgid "Unpost Journal Entries" +msgstr "Unpost Journal Entries" + +#. module: account_usability +#: model:ir.ui.view,arch_db:account_usability.view_account_move_line_filter +msgid "Unreconciled or Partially Reconciled" +msgstr "Non lettré ou partiellement lettré" + +#. module: account_usability +#: model:ir.ui.view,arch_db:account_usability.view_bank_statement_form +msgid "View Account Move" +msgstr "View Account Move" + +#. module: account_usability +#: model:ir.model.fields,help:account_usability.field_account_bank_statement_hide_bank_statement_balance +#: model:ir.model.fields,help:account_usability.field_account_journal_hide_bank_statement_balance +msgid "You may want to enable this option when your bank journal is generated from a bank statement file that doesn't handle start/end balance (QIF for instance) and you don't want to enter the start/end balance manually: it will prevent the display of wrong information in the accounting dashboard and on bank statements." +msgstr "You may want to enable this option when your bank journal is generated from a bank statement file that doesn't handle start/end balance (QIF for instance) and you don't want to enter the start/end balance manually: it will prevent the display of wrong information in the accounting dashboard and on bank statements." + +#. module: account_usability +#: model:ir.ui.view,arch_db:account_usability.invoice_supplier_form +msgid "⇒ Delete lines qty=0" +msgstr "⇒ Supprimer les lignes qté=0" + diff --git a/account_usability/product.py b/account_usability/product.py new file mode 100644 index 0000000..a7121b2 --- /dev/null +++ b/account_usability/product.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# © 2015-2016 Akretion (http://www.akretion.com) +# @author Alexis de Lattre +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import api, fields, models, _ + + +class ProductTemplate(models.Model): + _inherit = 'product.template' + + # DON'T put store=True on those fields, because they are company dependent + sale_price_type = fields.Selection( + '_sale_purchase_price_type_sel', compute='_compute_sale_price_type', + string='Sale Price Type', compute_sudo=False, readonly=True) + purchase_price_type = fields.Selection( + '_sale_purchase_price_type_sel', compute='_compute_purchase_price_type', + string='Purchase Price Type', compute_sudo=False, readonly=True) + + @api.model + def _sale_purchase_price_type_sel(self): + return [('incl', _('Tax incl.')), ('excl', _('Tax excl.'))] + + @api.depends('taxes_id') + def _compute_sale_price_type(self): + for pt in self: + sale_price_type = 'incl' + if pt.taxes_id and all([not t.price_include for t in pt.taxes_id if t.amount_type == 'percent']): + sale_price_type = 'excl' + pt.sale_price_type = sale_price_type + + @api.depends('supplier_taxes_id') + def _compute_purchase_price_type(self): + for pt in self: + purchase_price_type = 'incl' + if pt.supplier_taxes_id and all([not t.price_include for t in pt.supplier_taxes_id if t.amount_type == 'percent']): + purchase_price_type = 'excl' + pt.purchase_price_type = purchase_price_type + + +class ProductSupplierinfo(models.Model): + _inherit = 'product.supplierinfo' + + # DON'T put store=True on those fields, because they are company dependent + purchase_price_type = fields.Selection( + related='product_tmpl_id.purchase_price_type', related_sudo=False) diff --git a/account_usability/product_view.xml b/account_usability/product_view.xml index 92db2db..5519141 100644 --- a/account_usability/product_view.xml +++ b/account_usability/product_view.xml @@ -1,6 +1,6 @@ @@ -16,6 +16,7 @@ Here, we set all those fields on account.group_account_invoice account_usability.product.template.form product.template + 100 @@ -24,6 +25,14 @@ Here, we set all those fields on account.group_account_invoice account.group_account_invoice + + @@ -38,5 +47,27 @@ Here, we set all those fields on account.group_account_invoice + + account_usability.product.supplierinfo.form + product.supplierinfo + + + + + + + + + + account_usability.product.supplierinfo.tree + product.supplierinfo + + + + + + + +