Skip to content

Commit

Permalink
Merge branch 'ingadhoc:16.0' into 16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelaxcelere committed Nov 30, 2023
2 parents 4d479cb + d15716c commit d54cc43
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 12 deletions.
4 changes: 3 additions & 1 deletion l10n_ar_account_withholding/models/res_company.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,9 @@ def get_arba_data(self, partner, from_date, to_date):
msg = "%s\n Error %s: %s" % (ws.MensajeError, ws.TipoError, ws.CodigoError)
_logger.error('Padron ARBA: %s' % msg)
else:
self._process_message_error(ws)
error = True
msg = (_('Padron ARBA: %s - %s (%s)') % (ws.CodigoError, message, ws.TipoError))
_logger.error('Padron ARBA: %s' % msg)

if error:
action = self.env.ref('l10n_ar_account_withholding.act_company_jurisdiction_padron')
Expand Down
2 changes: 1 addition & 1 deletion l10n_ar_ux/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ This module extends the l10n_ar module to add some usability improvesment:
#. Set Non Monetary tag to accounts depending of the account type
#. Show Gross Income Jurisdiction on partners
#. Add a not nice implementation for duplicado/triplicado on invoices (and later on delivery slip with l10n_ar_stock)
#. Add CUIT when using checks
#. Add CUIT when using checks or bank transfers
#. Send due date to journal items for checks payments
#. Move checks menu into bank and cash menu (this could be on a glue module between account_payment_group and l10n_latam_check)

Expand Down
2 changes: 1 addition & 1 deletion l10n_ar_ux/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
'name': 'Argentinian Accounting UX',
'version': "16.0.1.7.0",
'version': "16.0.1.8.0",
'category': 'Localization/Argentina',
'sequence': 14,
'author': 'ADHOC SA',
Expand Down
21 changes: 21 additions & 0 deletions l10n_ar_ux/models/account_journal.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,27 @@ class AccountJournal(models.Model):
required=True,
)
l10n_ar_afip_pos_partner_id = fields.Many2one(string='Dirección Punto de venta')
l10n_latam_manual_checks = fields.Boolean(
compute="_compute_l10n_latam_manual_checks", store=True, readonly=False,
inverse='_inverse_l10n_latam_manual_checks', copy=False)

@api.model
def _get_checkbooks_by_default_country_codes(self):
""" Return the list of country codes for the countries where using checkbooks is enable by default """
return ["AR"]

@api.depends('outbound_payment_method_line_ids', 'company_id', 'check_manual_sequencing')
def _compute_l10n_latam_manual_checks(self):
arg_checks = self.filtered(
lambda x: not x.check_manual_sequencing and x.company_id.country_id.code in self._get_checkbooks_by_default_country_codes() and
'check_printing' in x.outbound_payment_method_line_ids.mapped('code'))
arg_checks.l10n_latam_manual_checks = True
# disable checkbook if manual sequencing was enable
self.filtered('check_manual_sequencing').l10n_latam_manual_checks = False

@api.onchange('l10n_latam_manual_checks')
def _inverse_l10n_latam_manual_checks(self):
self.filtered('l10n_latam_manual_checks').check_manual_sequencing = False

@api.onchange('l10n_ar_is_pos')
def _onchange_l10n_ar_is_pos(self):
Expand Down
6 changes: 5 additions & 1 deletion l10n_ar_ux/reports/account_invoice_report_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,13 @@
<field name="product_categ_id" optional="hide"/>
<field name="quantity" sum="Total"/>
<field name="price_unit"/>
<field name="price_average" optional="hide"/>
<field name="discount" groups="product.group_discount_per_so_line"/>
<field name="discount_amount" sum="Total" optional="hide" groups="product.group_discount_per_so_line"/>
<field name="price_subtotal" sum="Total without taxe"/>
<field name="price_subtotal_ic" sum="Total" optional="hide"/>
<field name="price_total" sum="Total" optional="hide"/>
<field name="price_subtotal" sum="Total"/>
<field name="total_cc" sum="Total"/>
<field name="state"/>
<field name="payment_state" optional="hide"/>
<field name="invoice_currency_id" optional="hide"/>
Expand Down
18 changes: 15 additions & 3 deletions l10n_ar_ux/reports/invoice_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,24 @@ class AccountInvoiceReport(models.Model):

_inherit = 'account.invoice.report'

# TODO mover todo esto a account_ux
# agregamos widgets monetary, referencia a company currency en string y help
price_subtotal = fields.Monetary(
currency_field='company_currency_id', string="Untaxed Total (CC)", help="Untaxed Total in company currency")
price_total = fields.Monetary(string='Total', currency_field='invoice_currency_id')
price_average = fields.Monetary(
currency_field='company_currency_id', string='Average Price (CC)', help="Average Price in company currency")
# creamos nuevos campos para tener descuentos, vinculos e importes en moneda de compañía
total_cc = fields.Monetary(
string='Total (CC)', readonly=True, help="Untaxed Total in company currency",
currency_field='company_currency_id')
invoice_currency_id = fields.Many2one('res.currency', string='Invoice Currency', readonly=True)
line_id = fields.Many2one('account.move.line', string='Journal Item', readonly=True)
price_subtotal_ic = fields.Monetary('Untaxed Total', readonly=True, currency_field='invoice_currency_id',)
price_unit = fields.Monetary('Unit Price', readonly=True, currency_field='invoice_currency_id',)
discount = fields.Float('Discount (%)', readonly=True)
discount_amount = fields.Monetary(
'Discount Amount', readonly=True, group_operator="sum", currency_field='invoice_currency_id',)
price_subtotal = fields.Monetary(currency_field='company_currency_id')
price_average = fields.Monetary(currency_field='company_currency_id')

_depends = {'account.move.line': ['price_unit', 'discount']}

Expand All @@ -25,7 +35,9 @@ def _select(self):
line.discount,
line.price_unit * line.quantity * line.discount/100 *
(CASE WHEN move
.move_type IN ('in_refund','out_refund','in_receipt') THEN -1 ELSE 1 END) as discount_amount
.move_type IN ('in_refund','out_refund','in_receipt') THEN -1 ELSE 1 END) as discount_amount,
-line.balance * (line.price_total / NULLIF(line.price_subtotal, 0.0)) AS total_cc,
-line.price_subtotal as price_subtotal_ic
"""

def _group_by(self):
Expand Down
8 changes: 4 additions & 4 deletions l10n_ar_ux/reports/report_payment_group.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@
<t t-set="check" t-value="line.l10n_latam_check_id or line"/>
<tr>
<td>
<span t-out='"Cheque nro %s - %s" % (check.l10n_latam_check_number, check.l10n_latam_check_bank_id.name or check.journal_id.name)'/><span t-if="check.l10n_latam_check_payment_date"> - Venc. <span t-field="check.l10n_latam_check_payment_date"/></span>
<span t-out='"Cheque nro %s - %s - (%s)" % (check.check_number, check.l10n_latam_check_bank_id.name or check.journal_id.name, check.payment_method_line_id.name)'/><span t-if="check.l10n_latam_check_payment_date"> - Venc. <span t-field="check.l10n_latam_check_payment_date"/></span>
</td>
<td class="text-right" t-if="any(o.mapped('payment_ids.other_currency'))">
<t t-if="line.currency_id">
<span class="text-nowrap" t-field="line.amount_signed" t-field-options='{"widget": "monetary", "display_currency": "line.currency_id"}'/>
<t t-if="check.currency_id">
<span class="text-nowrap" t-field="check.amount_signed" t-field-options='{"widget": "monetary", "display_currency": "check.currency_id"}'/>
</t>
</td>
<td class="text-right o_price_total">
<span class="text-nowrap" t-field="line.l10n_ar_amount_company_currency_signed"/>
<span class="text-nowrap" t-field="check.l10n_ar_amount_company_currency_signed"/>
</td>
</tr>
</t>
Expand Down
2 changes: 1 addition & 1 deletion l10n_ar_ux/views/account_payment_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<field name="inherit_id" ref="l10n_latam_check.view_account_payment_form_inherited" />
<field name="arch" type="xml">
<field name="l10n_latam_check_id" position="before">
<field name="l10n_ar_partner_vat" attrs="{'invisible': ['|', '|', ('state', '!=', 'draft'), ('l10n_ar_partner_vat', '=', False), ('payment_method_code', 'not in', ['out_third_party_checks', 'new_third_party_checks'])]}"/>
<field name="l10n_ar_partner_vat" attrs="{'invisible': ['|', '|', ('state', '!=', 'draft'), ('l10n_ar_partner_vat', '=', False), '&amp;', ('payment_method_code', 'not in', ['out_third_party_checks', 'new_third_party_checks', 'check_printing']), ('show_partner_bank_account', '=', False)]}"/>
</field>
</field>
</record>
Expand Down

0 comments on commit d54cc43

Please sign in to comment.