Compare commits
1 Commits
14.0-fix-a
...
14.0-accou
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
955cda6957 |
@@ -32,7 +32,7 @@ This modules adds the following functions:
|
|||||||
* A wizard to mark several invoices as sent at once (forward from v8)
|
* A wizard to mark several invoices as sent at once (forward from v8)
|
||||||
* Default date for Account Move Reversal is now D+1 instead of today
|
* Default date for Account Move Reversal is now D+1 instead of today
|
||||||
* Track more fields on invoice (see details in account.py)
|
* Track more fields on invoice (see details in account.py)
|
||||||
* Add boolean fields `has_discount` and `has_attachment` on invoice
|
* Add boolean fields `has_line_discount` and `has_attachment` on invoice
|
||||||
* Add button "Delete line qty = 0" on supplier invoice
|
* Add button "Delete line qty = 0" on supplier invoice
|
||||||
* Cut name_get() of invoice if too long
|
* Cut name_get() of invoice if too long
|
||||||
* A script for if Odoo screws up invoice attachment filename
|
* A script for if Odoo screws up invoice attachment filename
|
||||||
|
|||||||
@@ -296,11 +296,16 @@ msgstr "Possède une pièce jointe"
|
|||||||
|
|
||||||
#. module: account_usability
|
#. module: account_usability
|
||||||
#: model:ir.model.fields,field_description:account_usability.field_account_bank_statement_line__has_discount
|
#: model:ir.model.fields,field_description:account_usability.field_account_bank_statement_line__has_discount
|
||||||
#: model:ir.model.fields,field_description:account_usability.field_account_move__has_discount
|
|
||||||
#: model:ir.model.fields,field_description:account_usability.field_account_payment__has_discount
|
#: model:ir.model.fields,field_description:account_usability.field_account_payment__has_discount
|
||||||
msgid "Has Discount"
|
msgid "Has Discount"
|
||||||
msgstr "A une réduction"
|
msgstr "A une réduction"
|
||||||
|
|
||||||
|
#. module: account_usability
|
||||||
|
#: model:ir.model.fields,field_description:account_usability.field_account_move__has_line_discount
|
||||||
|
|
||||||
|
msgid "Has Line Discount"
|
||||||
|
msgstr "Contient une réduction"
|
||||||
|
|
||||||
#. module: account_usability
|
#. module: account_usability
|
||||||
#: model:ir.model.fields,field_description:account_usability.field_account_bank_statement__hide_bank_statement_balance
|
#: model:ir.model.fields,field_description:account_usability.field_account_bank_statement__hide_bank_statement_balance
|
||||||
#: model:ir.model.fields,field_description:account_usability.field_account_journal__hide_bank_statement_balance
|
#: model:ir.model.fields,field_description:account_usability.field_account_journal__hide_bank_statement_balance
|
||||||
|
|||||||
@@ -28,8 +28,8 @@ class AccountMove(models.Model):
|
|||||||
fiscal_position_id = fields.Many2one(tracking=True)
|
fiscal_position_id = fields.Many2one(tracking=True)
|
||||||
amount_total = fields.Monetary(tracking=True)
|
amount_total = fields.Monetary(tracking=True)
|
||||||
# for invoice report
|
# for invoice report
|
||||||
has_discount = fields.Boolean(
|
has_line_discount = fields.Boolean(
|
||||||
compute='_compute_has_discount', readonly=True)
|
compute='_compute_has_line_discount', readonly=True)
|
||||||
# has_attachment is useful for those who use attachment to archive
|
# has_attachment is useful for those who use attachment to archive
|
||||||
# supplier invoices. It allows them to find supplier invoices
|
# supplier invoices. It allows them to find supplier invoices
|
||||||
# that don't have any attachment
|
# that don't have any attachment
|
||||||
@@ -41,15 +41,15 @@ class AccountMove(models.Model):
|
|||||||
help="This information appear on invoice qweb report "
|
help="This information appear on invoice qweb report "
|
||||||
"(you may use it for your own report)")
|
"(you may use it for your own report)")
|
||||||
|
|
||||||
def _compute_has_discount(self):
|
def _compute_has_line_discount(self):
|
||||||
prec = self.env['decimal.precision'].precision_get('Discount')
|
prec = self.env['decimal.precision'].precision_get('Discount')
|
||||||
for inv in self:
|
for inv in self:
|
||||||
has_discount = False
|
has_line_discount = False
|
||||||
for line in inv.invoice_line_ids:
|
for line in inv.invoice_line_ids:
|
||||||
if not line.display_type and not float_is_zero(line.discount, precision_digits=prec):
|
if not line.display_type and not float_is_zero(line.discount, precision_digits=prec):
|
||||||
has_discount = True
|
has_line_discount = True
|
||||||
break
|
break
|
||||||
inv.has_discount = has_discount
|
inv.has_line_discount = has_line_discount
|
||||||
|
|
||||||
def _compute_has_attachment(self):
|
def _compute_has_attachment(self):
|
||||||
iao = self.env['ir.attachment']
|
iao = self.env['ir.attachment']
|
||||||
|
|||||||
Reference in New Issue
Block a user