Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modificari la factura din 15 #108

Merged
merged 1 commit into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion l10n_ro_invoice_report/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{
"name": "Romania - Invoice Report Terrabit",
"summary": "Localizare Terrabit - Facturi, Chitanta",
"version": "14.0.3.2.0",
"version": "14.0.3.2.2",
"author": "Dorin Hongu," "Odoo Community Association (OCA)",
"website": "https://github.com/OCA/l10n-romania",
"license": "AGPL-3",
Expand Down
443 changes: 443 additions & 0 deletions l10n_ro_invoice_report/i18n/de.po

Large diffs are not rendered by default.

443 changes: 443 additions & 0 deletions l10n_ro_invoice_report/i18n/es.po

Large diffs are not rendered by default.

449 changes: 449 additions & 0 deletions l10n_ro_invoice_report/i18n/fr.po

Large diffs are not rendered by default.

439 changes: 439 additions & 0 deletions l10n_ro_invoice_report/i18n/hu.po

Large diffs are not rendered by default.

442 changes: 442 additions & 0 deletions l10n_ro_invoice_report/i18n/it.po

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion l10n_ro_invoice_report/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# © 2008-2020 Dorin Hongu <dhongu(@)gmail(.)com
# © 2008-2023 Dorin Hongu <dhongu(@)gmail(.)com
# See README.rst file on addons root folder for license details

from . import res_partner
from . import account_invoice
from . import account_bank_statement
from . import res_config
36 changes: 36 additions & 0 deletions l10n_ro_invoice_report/models/res_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# © 2015-2023 Deltatech
# See README.rst file on addons root folder for license details


from odoo import fields, models


class ResCompany(models.Model):
_inherit = "res.company"

email_on_invoice_address = fields.Boolean(string="Show email", help="Show email on invoice address")
phone_on_invoice_address = fields.Boolean(string="Show phone", help="Show phone on invoice address")
marker_on_invoice_address = fields.Boolean(string="Show marker", help="Show marker on invoice address")


class ResConfigSettings(models.TransientModel):
_inherit = "res.config.settings"

email_on_invoice_address = fields.Boolean(
related="company_id.email_on_invoice_address",
string="Show email",
readonly=False,
help="Show taxes values on reception report",
)
phone_on_invoice_address = fields.Boolean(
related="company_id.phone_on_invoice_address",
string="Show phone ",
readonly=False,
help="Show phone on invoice address",
)
marker_on_invoice_address = fields.Boolean(
related="company_id.marker_on_invoice_address",
string="Show marker",
readonly=False,
help="Show marker on invoice address",
)
172 changes: 65 additions & 107 deletions l10n_ro_invoice_report/views/invoice_report.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,40 +39,81 @@
</template>
<template id="header_invoice">
<div id="address" class="address row">
<t t-set="address_fields" t-value="['address']" />

<t t-if="res_company.email_on_invoice_address">
<t t-set="address_fields" t-value="address_fields + ['email']" />
</t>
<t t-if="res_company.phone_on_invoice_address">
<t t-set="address_fields" t-value="address_fields + ['phone']" />
</t>
<t t-set="no_marker" t-value="not res_company.marker_on_invoice_address" />

<div name="information_block" class="col-6">
<div>
<strong t-if="o.move_type in ['out_invoice', 'out_refund']">Supplier:
</strong>
<strong t-if="o.move_type in ['in_invoice', 'in_refund']">Customer:
</strong>
<strong id="company_name" t-field="res_company.partner_id.name" />
</div>
<strong t-field="res_company.partner_id.name" />
<div id="company_address">
<strong>Address:</strong>
<div id="address_label" class="float-left mr-1">
<strong>Address:</strong>
</div>
<address
t-field="res_company.partner_id"
t-options='{"widget": "contact", "fields": ["address","phone"], "no_marker": true,
t-options='{"widget": "contact", "fields": address_fields, "no_marker": no_marker,
"no_tag_br": true}'
/>
</div>
<t t-set="partner_id" t-value="res_company.partner_id" />
<t t-call="l10n_ro_config.banks" />

<div>
<t t-set="partner_id" t-value="res_company.partner_id" />
<t t-call="l10n_ro_config.banks" />
</div>

<div>
<div t-if="res_company.partner_id.vat">
<strong>CIF:</strong>
<span t-field="res_company.partner_id.vat" />
</div>
<div t-if="res_company.partner_id.nrc">
<strong>NRC:</strong>
<span t-field="res_company.partner_id.nrc" />
</div>
<div t-if="res_company.l10n_ro_share_capital">
<strong>Share Capital:</strong>
<span t-esc="int(res_company.l10n_ro_share_capital)" />
</div>
<div t-if="'l10n_ro_vat_on_payment' in res_company.partner_id._fields">
<div t-if="res_company.partner_id.l10n_ro_vat_on_payment">
<span>Vat on payment</span>
</div>
</div>
<div>

</div>
</div>

</div>
<div class="col-5 offset-1">
<div>
<strong t-if="o.move_type in ['out_invoice', 'out_refund']">Customer:
</strong>
<strong t-if="o.move_type in ['in_invoice', 'in_refund']">Supplier:
</strong>
<strong id="partner_name" t-field="o.commercial_partner_id.name" />
</div>
<div id='partner_name'>
<strong t-field="o.commercial_partner_id.name" />
</div>


<div id="partner_address">
<strong>Address:</strong>
<div id="address_label" class="float-left mr-1">
<strong>Address:</strong>
</div>
<address
t-field="o.commercial_partner_id"
t-options='{"widget": "contact", "fields": ["address","phone"], "no_marker": true,
t-options='{"widget": "contact", "fields": address_fields, "no_marker": no_marker,
"no_tag_br": true}'
/>
</div>
Expand All @@ -82,113 +123,30 @@
<strong>Delivery address:</strong>
<address
t-field="o.partner_shipping_id"
t-options='{"widget": "contact", "fields": ["address"], "no_marker": true, "no_tag_br": true}'
t-options='{"widget": "contact", "fields": address_fields, "no_marker": no_marker, "no_tag_br": true}'
/>
</div>
</t>
<t t-set="partner_id" t-value="o.commercial_partner_id" />
<t t-call="l10n_ro_config.banks" />
</div>
</div>
<div class="row">
<div class="col-6 col-sm-6 col-md-6">
<div t-if="res_company.partner_id.vat">
<strong>CIF:</strong>
<span t-field="res_company.partner_id.vat" />
</div>
<div t-if="res_company.partner_id.nrc">
<strong>NRC:</strong>
<span t-field="res_company.partner_id.nrc" />
</div>
<div t-if="res_company.l10n_ro_share_capital">
<strong>Share Capital:</strong>
<span t-esc="int(res_company.l10n_ro_share_capital)" />
</div>
<div t-if="'vat_on_payment' in res_company._fields">
<div t-if="res_company.vat_on_payment">
<span>Vat on payment</span>
</div>
</div>
<div>
<span t-esc="', '.join(map(lambda x: (x[0]), o.amount_by_group))" />
<t t-set="partner_id" t-value="o.commercial_partner_id" />
<t t-call="l10n_ro_config.banks" />
</div>
</div>
<div id="partner_cui" class="col-5 offset-1">
<div t-if="o.commercial_partner_id.vat">
<strong>CIF:</strong>
<span t-field="o.commercial_partner_id.vat" />
</div>
<div t-if="o.commercial_partner_id.nrc">
<strong>NRC:</strong>
<span t-field="o.commercial_partner_id.nrc" />

<div id="partner_cui">
<div t-if="o.commercial_partner_id.vat">
<strong>CIF:</strong>
<span t-field="o.commercial_partner_id.vat" />
</div>
<div t-if="o.commercial_partner_id.nrc">
<strong>NRC:</strong>
<span t-field="o.commercial_partner_id.nrc" />
</div>
</div>
</div>
</div>
</template>
<!--
<template
id="l10n_ro_report_invoice_document_with_payments"
inherit_id="account.report_invoice_document_with_payments"
>

<xpath expr="//div[@name='reference']" position="after">
<div t-if="o.type == 'out_invoice' and o.payment_ids">
<br/>
<br/>
<div t-foreach="o.payment_ids" t-as="payment" style="border-top: 1px solid black;">

<t t-if="payment.payment_type == 'inbound' and payment.journal_id.type == 'cash'">

<div>
<strong t-field="res_company.partner_id.name"/>
</div>
<div>
VAT:
<span t-field="res_company.partner_id.vat"/>
</div>
<div>
NRC:
<span t-field="res_company.partner_id.nrc"/>
</div>
<address t-field="res_company.partner_id"
t-options='{"widget": "contact", "fields": ["address"], "no_marker": true, "no_tag_br": true}'/>
<h4>
<span>Voucher:</span>
<span t-field="payment.name"/>
<span>/</span>
<span t-field="payment.payment_date"/>
</h4>
<div>
<span>I received from</span>
<strong t-field="o.partner_id.name"/>
<span t-if="o.partner_id.city">
from
<span t-field="o.partner_id.city"/>
<span t-field="o.partner_id.street"/>
<span t-field="o.partner_id.street2"/>
</span>
,
<span>amount</span>

<span t-field="payment.amount"
t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
(

<span t-esc="o.currency_id.amount_to_text(payment.amount)" />
)
</div>
<div>
Representing counter value of invoice
<span t-field="o.number"/>
</div>

</t>

</div>
</div>
</xpath>
</template>

</template>-->
<template id="l10n_ro_report_invoice_document" inherit_id="account.report_invoice_document" priority="100">
<xpath expr="//t[@t-set='address']" position="replace">
<t t-call="l10n_ro_invoice_report.header_invoice" />
Expand Down
47 changes: 47 additions & 0 deletions l10n_ro_invoice_report/views/res_config_view.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>

<record id="res_config_settings_view_form" model="ir.ui.view">
<field name="name">res.config.settings.view.form.inherit.account</field>
<field name="model">res.config.settings</field>
<field name="inherit_id" ref="account.res_config_settings_view_form" />
<field name="arch" type="xml">
<xpath expr="//div[@id='invoicing_settings']" position="inside">
<div class="col-12 col-lg-6 o_setting_box">

<div class="o_setting_left_pane">
<field name="marker_on_invoice_address" />
</div>
<div class="o_setting_right_pane">
<label for="marker_on_invoice_address" />
<div class="text-muted">
Show marker on invoice address
</div>
</div>

<div class="o_setting_left_pane">
<field name="email_on_invoice_address" />
</div>
<div class="o_setting_right_pane">
<label for="email_on_invoice_address" />
<div class="text-muted">
Show email on invoice address
</div>
</div>

<div class="o_setting_left_pane">
<field name="phone_on_invoice_address" />
</div>
<div class="o_setting_right_pane">
<label for="phone_on_invoice_address" />
<div class="text-muted">
Show phone on invoice address
</div>
</div>
</div>

</xpath>
</field>
</record>

</odoo>
Loading
Loading