Skip to content

Commit

Permalink
Merge 56c5c08 into bedcfd4
Browse files Browse the repository at this point in the history
  • Loading branch information
cubells committed Apr 12, 2015
2 parents bedcfd4 + 56c5c08 commit 02104d7
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 2 deletions.
2 changes: 2 additions & 0 deletions l10n_es_aeat_mod347/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,14 @@
"base_vat",
"l10n_es_aeat",
"account_invoice_currency",
"account",
],
'data': [
"security/ir.model.access.csv",
"security/mod_347_security.xml",
"wizard/export_mod347_to_boe.xml",
"views/account_period_view.xml",
"views/account_invoice_view.xml",
"views/res_partner_view.xml",
"views/mod347_view.xml",
"report/mod347_report.xml",
Expand Down
11 changes: 11 additions & 0 deletions l10n_es_aeat_mod347/i18n/ca.po
Original file line number Diff line number Diff line change
Expand Up @@ -920,6 +920,17 @@ msgstr ""
msgid "Journal"
msgstr "Diari"

#. 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 inclosa en el model 347"

#. 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 aquest camp, aquesta factura no s'inclourà als informes del model AEAT 347."

#~ msgid "Calculation"
#~ msgstr "Càlcul"

Expand Down
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 @@ -931,7 +931,13 @@ msgid "Journal"
msgstr "Diario"

#. 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 incluida en el modelo 347"

#. 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 @@ -876,7 +876,13 @@ msgid "Journal"
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 ""

#. 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 ""

4 changes: 4 additions & 0 deletions l10n_es_aeat_mod347/models/account_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,7 @@ def _get_amount_total_wo_irpf(self):
amount_total_wo_irpf = fields.Float(
compute="_get_amount_total_wo_irpf",
string="Total amount without IRPF taxes")
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.", default=False)
6 changes: 4 additions & 2 deletions l10n_es_aeat_mod347/models/mod347.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,14 @@ def _calculate_partner_records(self, partners, periods):
[('partner_id', 'child_of', partners.ids),
('type', '=', invoice_type),
('period_id', 'in', periods.ids),
('state', 'not in', ['draft', 'cancel'])])
('state', 'not in', ['draft', 'cancel']),
('not_in_mod347', '=', False)])
refunds = invoice_obj.search(
[('partner_id', 'child_of', partners.ids),
('type', '=', refund_type),
('period_id', 'in', periods.ids),
('state', 'not in', ['draft', 'cancel'])])
('state', 'not in', ['draft', 'cancel']),
('not_in_mod347', '=', False)])
# Calculate the invoiced amount
# Remove IRPF tax for invoice amount
invoice_amount = sum(x.amount_total_wo_irpf for x in invoices)
Expand Down
28 changes: 28 additions & 0 deletions l10n_es_aeat_mod347/views/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">
<xpath expr="//field[@name='payment_term']" position="after">
<field name="not_in_mod347"/>
</xpath>
</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">
<xpath expr="//field[@name='date_due']" position="after">
<field name="not_in_mod347"/>
</xpath>
</field>
</record>

</data>
</openerp>

0 comments on commit 02104d7

Please sign in to comment.