Skip to content

Commit

Permalink
Merge pull request #153 from cubells/7.0
Browse files Browse the repository at this point in the history
[IMP] Mejora para poder eliminar facturas selectivamente del modelo 347
  • Loading branch information
pedrobaeza committed Apr 10, 2015
2 parents 408bd34 + 599cd38 commit aba3595
Show file tree
Hide file tree
Showing 7 changed files with 81 additions and 2 deletions.
1 change: 1 addition & 0 deletions l10n_es_aeat_mod347/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@
from . import res_partner
from . import mod347
from . import wizard
from . import account_invoice
2 changes: 2 additions & 0 deletions l10n_es_aeat_mod347/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,11 @@
"base_vat",
"l10n_es_aeat",
"account_invoice_currency",
"account",
],
'data': [
"account_period_view.xml",
"account_invoice_view.xml",
"res_partner_view.xml",
"wizard/export_mod347_to_boe.xml",
"report/mod347_report.xml",
Expand Down
34 changes: 34 additions & 0 deletions l10n_es_aeat_mod347/account_invoice.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

from openerp.osv import fields, orm


class AccountInvoice(orm.Model):
_inherit = "account.invoice"

_columns = {
'not_in_mod347': fields.boolean(
"Not included in 347 report",
help="If you mark this field, this invoice will not be included "
"in any AEAT 347 model report."),
}

_defaults = {
'not_in_mod347': False,
}
28 changes: 28 additions & 0 deletions l10n_es_aeat_mod347/account_invoice_view.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>

<record id="invoice_supplier_form_mod347" model="ir.ui.view">
<field name="name">account.invoice.supplier.form.mod347</field>
<field name="model">account.invoice</field>
<field name="inherit_id" ref="account.invoice_supplier_form"/>
<field name="arch" type="xml">
<field name="payment_term" widget="selection" position="after">
<field name="not_in_mod347"/>
</field>
</field>
</record>

<record id="invoice_form_mod347" model="ir.ui.view">
<field name="name">account.invoice.form.mod347</field>
<field name="model">account.invoice</field>
<field name="inherit_id" ref="account.invoice_form"/>
<field name="arch" type="xml">
<field name="date_due" position="after">
<field name="not_in_mod347"/>
</field>
</field>
</record>

</data>
</openerp>
6 changes: 6 additions & 0 deletions l10n_es_aeat_mod347/i18n/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,7 @@ msgid "The declaration will show the total of cash operations over this limit"
msgstr "La declaración mostrará el total de las operaciones realizadas en efectivo superiores a este límite"

#. module: l10n_es_aeat_mod347
#: field:account.invoice,not_in_mod347:0
#: field:res.partner,not_in_mod347:0
msgid "Not included in 347 report"
msgstr "No incluido en el informe 347"
Expand Down Expand Up @@ -938,3 +939,8 @@ msgstr "Archivo"
msgid "If you mark this field, this partner will not be included in any AEAT 347 model report, independently from the total amount of its operations."
msgstr "Si marca este campo, esta empresa no se incluirá en los informes del modelo AEAT 347, independientemente del importe total de sus operaciones."

#. module: l10n_es_aeat_mod347
#: help:account.invoice,not_in_mod347:0
msgid "If you mark this field, this invoice will not be included in any AEAT 347 model report."
msgstr "Si marca este campo, esta factura no se incluirá en los informes del modelo AEAT 347."

6 changes: 6 additions & 0 deletions l10n_es_aeat_mod347/i18n/l10n_es_aeat_mod347.pot
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,7 @@ msgid "The declaration will show the total of cash operations over this limit"
msgstr ""

#. module: l10n_es_aeat_mod347
#: field:account.invoice,not_in_mod347:0
#: field:res.partner,not_in_mod347:0
msgid "Not included in 347 report"
msgstr ""
Expand Down Expand Up @@ -882,3 +883,8 @@ msgstr ""
#: field:l10n.es.aeat.mod347.partner_record,related_goods_operation:0
msgid "Related Goods Operation"
msgstr ""

#. module: l10n_es_aeat_mod347
#: help:account.invoice,not_in_mod347:0
msgid "If you mark this field, this invoice will not be included in any AEAT 347 model report."
msgstr ""
6 changes: 4 additions & 2 deletions l10n_es_aeat_mod347/mod347.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,14 @@ def _calculate_partner_records(self, cr, uid, partner, partner_ids,
cr, uid, [('partner_id', 'child_of', partner_ids),
('type', '=', invoice_type),
('period_id', 'in', period_ids),
('state', 'not in', ['draft', 'cancel'])])
('state', 'not in', ['draft', 'cancel']),
('not_in_mod347', '=', False)])
refund_ids = invoice_obj.search(
cr, uid, [('partner_id', 'child_of', partner_ids),
('type', '=', refund_type),
('period_id', 'in', period_ids),
('state', 'not in', ['draft', 'cancel'])])
('state', 'not in', ['draft', 'cancel']),
('not_in_mod347', '=', False)])
invoices = invoice_obj.browse(cr, uid, invoice_ids,
context=context)
refunds = invoice_obj.browse(cr, uid, refund_ids, context=context)
Expand Down

0 comments on commit aba3595

Please sign in to comment.