mirror of
https://gitlab.com/flectra-hq/flectra.git
synced 2025-02-25 18:55:21 -06:00
[PATCH] Upstream patch - 28012022
This commit is contained in:
@@ -793,13 +793,18 @@ class AccountPayment(models.Model):
|
||||
line_vals_list = pay._prepare_move_line_default_vals(write_off_line_vals=write_off_line_vals)
|
||||
|
||||
line_ids_commands = []
|
||||
if liquidity_lines:
|
||||
if len(liquidity_lines) == 1:
|
||||
line_ids_commands.append((1, liquidity_lines.id, line_vals_list[0]))
|
||||
else:
|
||||
for line in liquidity_lines:
|
||||
line_ids_commands.append((2, line.id, 0))
|
||||
line_ids_commands.append((0, 0, line_vals_list[0]))
|
||||
if counterpart_lines:
|
||||
|
||||
if len(counterpart_lines) == 1:
|
||||
line_ids_commands.append((1, counterpart_lines.id, line_vals_list[1]))
|
||||
else:
|
||||
for line in counterpart_lines:
|
||||
line_ids_commands.append((2, line.id, 0))
|
||||
line_ids_commands.append((0, 0, line_vals_list[1]))
|
||||
|
||||
for line in writeoff_lines:
|
||||
|
||||
@@ -2771,6 +2771,140 @@ class TestAccountMoveOutInvoiceOnchanges(AccountTestInvoicingCommon):
|
||||
{'amount_currency': 120.0, 'debit': 60.0, 'credit': 0.0, 'account_id': wizard.revenue_accrual_account.id, 'reconciled': True},
|
||||
])
|
||||
|
||||
def test_out_invoice_multi_date_change_period_accrual(self):
|
||||
dates = ['2017-01-01', '2017-01-01', '2017-02-01']
|
||||
values = []
|
||||
for date in dates:
|
||||
values.append({
|
||||
'move_type': 'out_invoice',
|
||||
'date': date,
|
||||
'partner_id': self.partner_a.id,
|
||||
'invoice_date': fields.Date.from_string(date),
|
||||
'currency_id': self.currency_data['currency'].id,
|
||||
'invoice_payment_term_id': self.pay_terms_a.id,
|
||||
'invoice_line_ids': [
|
||||
(0, None, {
|
||||
'name': self.product_line_vals_1['name'],
|
||||
'product_id': self.product_line_vals_1['product_id'],
|
||||
'product_uom_id': self.product_line_vals_1['product_uom_id'],
|
||||
'quantity': self.product_line_vals_1['quantity'],
|
||||
'price_unit': self.product_line_vals_1['price_unit'],
|
||||
'tax_ids': self.product_line_vals_1['tax_ids'],
|
||||
}),
|
||||
(0, None, {
|
||||
'name': self.product_line_vals_2['name'],
|
||||
'product_id': self.product_line_vals_2['product_id'],
|
||||
'product_uom_id': self.product_line_vals_2['product_uom_id'],
|
||||
'quantity': self.product_line_vals_2['quantity'],
|
||||
'price_unit': self.product_line_vals_2['price_unit'],
|
||||
'tax_ids': self.product_line_vals_2['tax_ids'],
|
||||
}),
|
||||
]
|
||||
})
|
||||
|
||||
moves = self.env['account.move'].create(values)
|
||||
moves.action_post()
|
||||
|
||||
wizard = self.env['account.automatic.entry.wizard'].with_context(
|
||||
active_model='account.move.line',
|
||||
active_ids=moves.invoice_line_ids.ids,
|
||||
).create({
|
||||
'action': 'change_period',
|
||||
'date': '2018-01-01',
|
||||
'percentage': 60,
|
||||
'journal_id': self.company_data['default_journal_misc'].id,
|
||||
'expense_accrual_account': self.env['account.account'].create({
|
||||
'name': 'Accrual Expense Account',
|
||||
'code': '234567',
|
||||
'user_type_id': self.env.ref('account.data_account_type_expenses').id,
|
||||
'reconcile': True,
|
||||
}).id,
|
||||
'revenue_accrual_account': self.env['account.account'].create({
|
||||
'name': 'Accrual Revenue Account',
|
||||
'code': '765432',
|
||||
'user_type_id': self.env.ref('account.data_account_type_expenses').id,
|
||||
'reconcile': True,
|
||||
}).id,
|
||||
})
|
||||
wizard_res = wizard.do_action()
|
||||
|
||||
for date, move, ref in zip(dates, moves, ['INV/2017/01/0001', 'INV/2017/01/0002', 'INV/2017/02/0001']):
|
||||
self.assertInvoiceValues(move, [
|
||||
{
|
||||
**self.product_line_vals_1,
|
||||
'currency_id': self.currency_data['currency'].id,
|
||||
'amount_currency': -1000.0,
|
||||
'debit': 0.0,
|
||||
'credit': 500.0,
|
||||
},
|
||||
{
|
||||
**self.product_line_vals_2,
|
||||
'currency_id': self.currency_data['currency'].id,
|
||||
'amount_currency': -200.0,
|
||||
'debit': 0.0,
|
||||
'credit': 100.0,
|
||||
},
|
||||
{
|
||||
**self.tax_line_vals_1,
|
||||
'currency_id': self.currency_data['currency'].id,
|
||||
'amount_currency': -180.0,
|
||||
'debit': 0.0,
|
||||
'credit': 90.0,
|
||||
},
|
||||
{
|
||||
**self.tax_line_vals_2,
|
||||
'currency_id': self.currency_data['currency'].id,
|
||||
'amount_currency': -30.0,
|
||||
'debit': 0.0,
|
||||
'credit': 15.0,
|
||||
},
|
||||
{
|
||||
**self.term_line_vals_1,
|
||||
'currency_id': self.currency_data['currency'].id,
|
||||
'name': ref,
|
||||
'amount_currency': 1410.0,
|
||||
'debit': 705.0,
|
||||
'credit': 0.0,
|
||||
'date_maturity': fields.Date.from_string(date),
|
||||
},
|
||||
], {
|
||||
**self.move_vals,
|
||||
'currency_id': self.currency_data['currency'].id,
|
||||
'date': fields.Date.from_string(date),
|
||||
'payment_reference': ref,
|
||||
})
|
||||
|
||||
moves = self.env['account.move'].browse(wizard_res['domain'][0][2])
|
||||
|
||||
accrual_lines = moves.line_ids.sorted('date')
|
||||
self.assertRecordValues(accrual_lines, [
|
||||
{'amount_currency': 600.0, 'debit': 300.0, 'credit': 0.0, 'account_id': self.product_line_vals_1['account_id'], 'reconciled': False},
|
||||
{'amount_currency': -600.0, 'debit': 0.0, 'credit': 300.0, 'account_id': wizard.revenue_accrual_account.id, 'reconciled': True},
|
||||
{'amount_currency': 120.0, 'debit': 60.0, 'credit': 0.0, 'account_id': self.product_line_vals_2['account_id'], 'reconciled': False},
|
||||
{'amount_currency': -120.0, 'debit': 0.0, 'credit': 60.0, 'account_id': wizard.revenue_accrual_account.id, 'reconciled': True},
|
||||
{'amount_currency': 600.0, 'debit': 300.0, 'credit': 0.0, 'account_id': self.product_line_vals_1['account_id'], 'reconciled': False},
|
||||
{'amount_currency': -600.0, 'debit': 0.0, 'credit': 300.0, 'account_id': wizard.revenue_accrual_account.id, 'reconciled': True},
|
||||
{'amount_currency': 120.0, 'debit': 60.0, 'credit': 0.0, 'account_id': self.product_line_vals_2['account_id'], 'reconciled': False},
|
||||
{'amount_currency': -120.0, 'debit': 0.0, 'credit': 60.0, 'account_id': wizard.revenue_accrual_account.id, 'reconciled': True},
|
||||
{'amount_currency': 600.0, 'debit': 300.0, 'credit': 0.0, 'account_id': self.product_line_vals_1['account_id'], 'reconciled': False},
|
||||
{'amount_currency': -600.0, 'debit': 0.0, 'credit': 300.0, 'account_id': wizard.revenue_accrual_account.id, 'reconciled': True},
|
||||
{'amount_currency': 120.0, 'debit': 60.0, 'credit': 0.0, 'account_id': self.product_line_vals_2['account_id'], 'reconciled': False},
|
||||
{'amount_currency': -120.0, 'debit': 0.0, 'credit': 60.0, 'account_id': wizard.revenue_accrual_account.id, 'reconciled': True},
|
||||
|
||||
{'amount_currency': -600.0, 'debit': 0.0, 'credit': 300.0, 'account_id': self.product_line_vals_1['account_id'], 'reconciled': False},
|
||||
{'amount_currency': 600.0, 'debit': 300.0, 'credit': 0.0, 'account_id': wizard.revenue_accrual_account.id, 'reconciled': True},
|
||||
{'amount_currency': -120.0, 'debit': 0.0, 'credit': 60.0, 'account_id': self.product_line_vals_2['account_id'], 'reconciled': False},
|
||||
{'amount_currency': 120.0, 'debit': 60.0, 'credit': 0.0, 'account_id': wizard.revenue_accrual_account.id, 'reconciled': True},
|
||||
{'amount_currency': -600.0, 'debit': 0.0, 'credit': 300.0, 'account_id': self.product_line_vals_1['account_id'], 'reconciled': False},
|
||||
{'amount_currency': 600.0, 'debit': 300.0, 'credit': 0.0, 'account_id': wizard.revenue_accrual_account.id, 'reconciled': True},
|
||||
{'amount_currency': -120.0, 'debit': 0.0, 'credit': 60.0, 'account_id': self.product_line_vals_2['account_id'], 'reconciled': False},
|
||||
{'amount_currency': 120.0, 'debit': 60.0, 'credit': 0.0, 'account_id': wizard.revenue_accrual_account.id, 'reconciled': True},
|
||||
{'amount_currency': -600.0, 'debit': 0.0, 'credit': 300.0, 'account_id': self.product_line_vals_1['account_id'], 'reconciled': False},
|
||||
{'amount_currency': 600.0, 'debit': 300.0, 'credit': 0.0, 'account_id': wizard.revenue_accrual_account.id, 'reconciled': True},
|
||||
{'amount_currency': -120.0, 'debit': 0.0, 'credit': 60.0, 'account_id': self.product_line_vals_2['account_id'], 'reconciled': False},
|
||||
{'amount_currency': 120.0, 'debit': 60.0, 'credit': 0.0, 'account_id': wizard.revenue_accrual_account.id, 'reconciled': True},
|
||||
])
|
||||
|
||||
def test_out_invoice_filter_zero_balance_lines(self):
|
||||
zero_balance_payment_term = self.env['account.payment.term'].create({
|
||||
'name': 'zero_balance_payment_term',
|
||||
|
||||
@@ -820,3 +820,19 @@ class TestAccountPayment(AccountTestInvoicingCommon):
|
||||
self.assertRecordValues(payment, [{
|
||||
'partner_bank_id': self.comp_bank_account2.id,
|
||||
}])
|
||||
|
||||
def test_internal_transfer_change_journal(self):
|
||||
self.bank_journal_1.bank_account_id = self.comp_bank_account1
|
||||
|
||||
payment = self.env['account.payment'].create({
|
||||
'journal_id': self.bank_journal_1.id,
|
||||
'amount': 50.0,
|
||||
'is_internal_transfer': True,
|
||||
'payment_type': 'outbound',
|
||||
'partner_bank_id': self.comp_bank_account2.id,
|
||||
})
|
||||
|
||||
# This should not raise an error.
|
||||
payment.write({
|
||||
'journal_id': self.company_data['default_journal_cash'].id
|
||||
})
|
||||
|
||||
@@ -92,7 +92,7 @@ class AutomaticEntryWizard(models.TransientModel):
|
||||
for record in self:
|
||||
total = (sum(record.move_line_ids.mapped('balance')) or record.total_amount)
|
||||
if total != 0:
|
||||
record.percentage = (record.total_amount / total) * 100
|
||||
record.percentage = min((record.total_amount / total) * 100, 100) # min() to avoid value being slightly over 100 due to rounding error
|
||||
else:
|
||||
record.percentage = 100
|
||||
|
||||
@@ -321,22 +321,31 @@ class AutomaticEntryWizard(models.TransientModel):
|
||||
created_moves._post()
|
||||
|
||||
destination_move = created_moves[0]
|
||||
destination_move_offset = 0
|
||||
destination_messages = []
|
||||
accrual_move_messages = defaultdict(lambda: [])
|
||||
accrual_move_offsets = defaultdict(int)
|
||||
for move in self.move_line_ids.move_id:
|
||||
amount = sum((self.move_line_ids._origin & move.line_ids).mapped('balance'))
|
||||
accrual_move = created_moves[1:].filtered(lambda m: m.date == move.date)
|
||||
|
||||
if accrual_account.reconcile:
|
||||
to_reconcile = (accrual_move + destination_move).mapped('line_ids').filtered(lambda line: line.account_id == accrual_account)
|
||||
to_reconcile.reconcile()
|
||||
destination_move_lines = destination_move.mapped('line_ids').filtered(lambda line: line.account_id == accrual_account)[destination_move_offset:destination_move_offset+2]
|
||||
destination_move_offset += 2
|
||||
accrual_move_lines = accrual_move.mapped('line_ids').filtered(lambda line: line.account_id == accrual_account)[accrual_move_offsets[accrual_move]:accrual_move_offsets[accrual_move]+2]
|
||||
accrual_move_offsets[accrual_move] += 2
|
||||
(accrual_move_lines + destination_move_lines).reconcile()
|
||||
move.message_post(body=self._format_strings(_('Adjusting Entries have been created for this invoice:<ul><li>%(link1)s cancelling '
|
||||
'{percent:f}%% of {amount}</li><li>%(link0)s postponing it to {new_date}</li></ul>',
|
||||
link0=self._format_move_link(destination_move),
|
||||
link1=self._format_move_link(accrual_move),
|
||||
), move, amount))
|
||||
destination_messages += [self._format_strings(_('Adjusting Entry {link}: {percent:f}% of {amount} recognized from {date}'), move, amount)]
|
||||
accrual_move.message_post(body=self._format_strings(_('Adjusting Entry for {link}: {percent:f}% of {amount} recognized on {new_date}'), move, amount))
|
||||
accrual_move_messages[accrual_move] += [self._format_strings(_('Adjusting Entry for {link}: {percent:f}% of {amount} recognized on {new_date}'), move, amount)]
|
||||
|
||||
destination_move.message_post(body='<br/>\n'.join(destination_messages))
|
||||
for accrual_move, messages in accrual_move_messages.items():
|
||||
accrual_move.message_post(body='<br/>\n'.join(messages))
|
||||
|
||||
# open the generated entries
|
||||
action = {
|
||||
|
||||
@@ -26,10 +26,11 @@
|
||||
|
||||
<!-- Amounts. -->
|
||||
<ram:SpecifiedLineTradeAgreement>
|
||||
<!-- Line information, with discount and unit price separate -->
|
||||
<ram:GrossPriceProductTradePrice>
|
||||
<ram:ChargeAmount
|
||||
t-att-currencyID="currency.name"
|
||||
t-esc="format_monetary(line.price_subtotal, currency)"/>
|
||||
t-esc="format_monetary(line.price_unit, currency)"/>
|
||||
|
||||
<!-- Discount. -->
|
||||
<ram:AppliedTradeAllowanceCharge t-if="line.discount">
|
||||
@@ -39,6 +40,12 @@
|
||||
<ram:CalculationPercent t-esc="line.discount"/>
|
||||
</ram:AppliedTradeAllowanceCharge>
|
||||
</ram:GrossPriceProductTradePrice>
|
||||
<!-- Line unit price, with discount applied -->
|
||||
<ram:NetPriceProductTradePrice>
|
||||
<ram:ChargeAmount
|
||||
t-att-currencyID="currency.name"
|
||||
t-esc="format_monetary(line.price_subtotal/line.quantity, currency)"/>
|
||||
</ram:NetPriceProductTradePrice>
|
||||
</ram:SpecifiedLineTradeAgreement>
|
||||
|
||||
<!-- Quantity. -->
|
||||
|
||||
@@ -82,7 +82,7 @@ class TestAccountEdiFacturx(AccountEdiTestCommon):
|
||||
</SpecifiedTradeProduct>
|
||||
<SpecifiedLineTradeAgreement>
|
||||
<GrossPriceProductTradePrice>
|
||||
<ChargeAmount currencyID="Gol">1100.000</ChargeAmount>
|
||||
<ChargeAmount currencyID="Gol">275.000</ChargeAmount>
|
||||
<AppliedTradeAllowanceCharge>
|
||||
<ChargeIndicator>
|
||||
<Indicator>true</Indicator>
|
||||
@@ -90,6 +90,9 @@ class TestAccountEdiFacturx(AccountEdiTestCommon):
|
||||
<CalculationPercent>20.0</CalculationPercent>
|
||||
</AppliedTradeAllowanceCharge>
|
||||
</GrossPriceProductTradePrice>
|
||||
<NetPriceProductTradePrice>
|
||||
<ChargeAmount currencyID="Gol">220.000</ChargeAmount>
|
||||
</NetPriceProductTradePrice>
|
||||
</SpecifiedLineTradeAgreement>
|
||||
<SpecifiedLineTradeDelivery>
|
||||
<BilledQuantity>5.0</BilledQuantity>
|
||||
@@ -163,8 +166,8 @@ class TestAccountEdiFacturx(AccountEdiTestCommon):
|
||||
})
|
||||
|
||||
applied_xpath = '''
|
||||
<xpath expr="//GrossPriceProductTradePrice/ChargeAmount" position="replace">
|
||||
<ChargeAmount currencyID="Gol">1000.000</ChargeAmount>
|
||||
<xpath expr="//NetPriceProductTradePrice/ChargeAmount" position="replace">
|
||||
<ChargeAmount currencyID="Gol">200.000</ChargeAmount>
|
||||
</xpath>
|
||||
<xpath expr="//SpecifiedLineTradeSettlement" position="replace">
|
||||
<SpecifiedLineTradeSettlement>
|
||||
|
||||
@@ -40,7 +40,6 @@
|
||||
<field name="name">Disable TOTP on users</field>
|
||||
<field name="model_id" ref="base.model_res_users"/>
|
||||
<field name="binding_model_id" ref="base.model_res_users"/>
|
||||
<field name="binding_view_types">list</field>
|
||||
<field name="state">code</field>
|
||||
<field name="code">
|
||||
action = records.totp_disable()
|
||||
|
||||
@@ -105,7 +105,7 @@ flectra_mailgate: "|/path/to/flectra-mailgate.py --host=localhost -u %(uid)d -p
|
||||
connection = IMAP4_SSL(self.server, int(self.port))
|
||||
else:
|
||||
connection = IMAP4(self.server, int(self.port))
|
||||
connection.login(self.user, self.password)
|
||||
self._imap_login(connection)
|
||||
elif self.server_type == 'pop':
|
||||
if self.is_ssl:
|
||||
connection = POP3_SSL(self.server, int(self.port))
|
||||
@@ -119,6 +119,16 @@ flectra_mailgate: "|/path/to/flectra-mailgate.py --host=localhost -u %(uid)d -p
|
||||
connection.sock.settimeout(MAIL_TIMEOUT)
|
||||
return connection
|
||||
|
||||
def _imap_login(self, connection):
|
||||
"""Authenticate the IMAP connection.
|
||||
|
||||
Can be overridden in other module for different authentication methods.
|
||||
|
||||
:param connection: The IMAP connection to authenticate
|
||||
"""
|
||||
self.ensure_one()
|
||||
connection.login(self.user, self.password)
|
||||
|
||||
def button_confirm_login(self):
|
||||
for server in self:
|
||||
try:
|
||||
|
||||
@@ -9,6 +9,7 @@ import requests
|
||||
from werkzeug import urls
|
||||
|
||||
from flectra import api, fields, models, _
|
||||
from flectra.exceptions import UserError
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -119,6 +120,42 @@ class GoogleService(models.AbstractModel):
|
||||
error_msg = _("Something went wrong during your token generation. Maybe your Authorization Code is invalid")
|
||||
raise self.env['res.config.settings'].get_config_warning(error_msg)
|
||||
|
||||
@api.model
|
||||
def _get_access_token(self, refresh_token, service, scope):
|
||||
"""Fetch the access token thanks to the refresh token."""
|
||||
get_param = self.env['ir.config_parameter'].sudo().get_param
|
||||
client_id = get_param('google_%s_client_id' % service, default=False)
|
||||
client_secret = get_param('google_%s_client_secret' % service, default=False)
|
||||
|
||||
if not client_id or not client_secret:
|
||||
raise UserError(_('Google %s is not yet configured.', service.title()))
|
||||
|
||||
if not refresh_token:
|
||||
raise UserError(_('The refresh token for authentication is not set.'))
|
||||
|
||||
try:
|
||||
result = requests.post(
|
||||
GOOGLE_TOKEN_ENDPOINT,
|
||||
data={
|
||||
'client_id': client_id,
|
||||
'client_secret': client_secret,
|
||||
'refresh_token': refresh_token,
|
||||
'grant_type': 'refresh_token',
|
||||
'scope': scope,
|
||||
},
|
||||
headers={'Content-type': 'application/x-www-form-urlencoded'},
|
||||
timeout=TIMEOUT,
|
||||
)
|
||||
result.raise_for_status()
|
||||
except requests.HTTPError:
|
||||
raise UserError(
|
||||
_('Something went wrong during the token generation. Please request again an authorization code.')
|
||||
)
|
||||
|
||||
json_result = result.json()
|
||||
|
||||
return json_result.get('access_token'), json_result.get('expires_in')
|
||||
|
||||
@api.model
|
||||
def _do_request(self, uri, params=None, headers=None, method='POST', preuri="https://www.googleapis.com", timeout=TIMEOUT):
|
||||
""" Execute the request to Google API. Return a tuple ('HTTP_CODE', 'HTTP_RESPONSE')
|
||||
|
||||
@@ -174,7 +174,7 @@ class AccountMove(models.Model):
|
||||
rec.l10n_ar_currency_rate = 1.0
|
||||
elif not rec.l10n_ar_currency_rate:
|
||||
rec.l10n_ar_currency_rate = rec.currency_id._convert(
|
||||
1.0, rec.company_id.currency_id, rec.company_id, rec.invoice_date or fields.Date.today(), round=False)
|
||||
1.0, rec.company_id.currency_id, rec.company_id, rec.date, round=False)
|
||||
|
||||
# We make validations here and not with a constraint because we want validation before sending electronic
|
||||
# data on l10n_ar_edi
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
<field name="name">GST amounts you owe the Tax Office from sales</field>
|
||||
<field name="report_id" ref="tax_report"/>
|
||||
<field name="sequence" eval="1"/>
|
||||
<field name="formula">None</field>
|
||||
</record>
|
||||
|
||||
<record id="account_tax_report_gstrpt_g1" model="account.tax.report.line">
|
||||
@@ -50,6 +51,7 @@
|
||||
|
||||
<record id="account_tax_report_gstrpt_g5" model="account.tax.report.line">
|
||||
<field name="name">G5: G2 + G3 + G4</field>
|
||||
<field name="code">G5</field>
|
||||
<field name="formula">G2+G3+G4</field>
|
||||
<field name="report_id" ref="tax_report"/>
|
||||
<field name="sequence" eval="6"/>
|
||||
@@ -60,7 +62,8 @@
|
||||
<field name="name">G6: Total sales subject to GST (G1 minus G5)</field>
|
||||
<field name="report_id" ref="tax_report"/>
|
||||
<field name="sequence" eval="7"/>
|
||||
<field name="formula">G1-(G2+G3+G4)</field>
|
||||
<field name="code">G6</field>
|
||||
<field name="formula">G1-G5</field>
|
||||
<field name="parent_id" ref="account_tax_report_gstrpt_sale_total"/>
|
||||
</record>
|
||||
|
||||
@@ -77,15 +80,17 @@
|
||||
<field name="name">G8: Total sales subject to GST after adjustments (G6 + G7)</field>
|
||||
<field name="report_id" ref="tax_report"/>
|
||||
<field name="sequence" eval="9"/>
|
||||
<field name="formula">(G1-(G2+G3+G4))+G7</field>
|
||||
<field name="code">G8</field>
|
||||
<field name="formula">G6+G7</field>
|
||||
<field name="parent_id" ref="account_tax_report_gstrpt_sale_total"/>
|
||||
</record>
|
||||
|
||||
<record id="account_tax_report_gstrpt_g9" model="account.tax.report.line">
|
||||
<field name="name">G9: GST on sales (G8 divided by eleven)</field>
|
||||
<field name="report_id" ref="tax_report"/>
|
||||
<field name="code">G9</field>
|
||||
<field name="sequence" eval="10"/>
|
||||
<field name="formula">((G1-(G2+G3+G4))+G7)/11</field>
|
||||
<field name="formula">G8/11</field>
|
||||
<field name="parent_id" ref="account_tax_report_gstrpt_sale_total"/>
|
||||
</record>
|
||||
|
||||
@@ -94,6 +99,7 @@
|
||||
<field name="name">GST amounts the Tax Office owes you from purchases</field>
|
||||
<field name="report_id" ref="tax_report"/>
|
||||
<field name="sequence" eval="101"/>
|
||||
<field name="formula">None</field>
|
||||
</record>
|
||||
|
||||
<record id="account_tax_report_gstrpt_g10" model="account.tax.report.line">
|
||||
@@ -118,6 +124,7 @@
|
||||
<field name="name">G12: G10 + G11</field>
|
||||
<field name="report_id" ref="tax_report"/>
|
||||
<field name="sequence" eval="104"/>
|
||||
<field name="code">G12</field>
|
||||
<field name="formula">G10+G11</field>
|
||||
<field name="parent_id" ref="account_tax_report_gstrpt_purchase_total"/>
|
||||
</record>
|
||||
@@ -153,6 +160,7 @@
|
||||
<field name="name">G16: G13 + G14 + G15</field>
|
||||
<field name="report_id" ref="tax_report"/>
|
||||
<field name="sequence" eval="108"/>
|
||||
<field name="code">G16</field>
|
||||
<field name="formula">G13+G14+G15</field>
|
||||
<field name="parent_id" ref="account_tax_report_gstrpt_purchase_total"/>
|
||||
</record>
|
||||
@@ -161,7 +169,8 @@
|
||||
<field name="name">G17: Total purchases subject to GST (G12 minus G16) </field>
|
||||
<field name="report_id" ref="tax_report"/>
|
||||
<field name="sequence" eval="109"/>
|
||||
<field name="formula">(G10+G11)-(G13+G14+G15)</field>
|
||||
<field name="code">G17</field>
|
||||
<field name="formula">G12-G16</field>
|
||||
<field name="parent_id" ref="account_tax_report_gstrpt_purchase_total"/>
|
||||
</record>
|
||||
|
||||
@@ -178,13 +187,15 @@
|
||||
<field name="name">G19: Total purchases subject to GST after adjustments (G17 + G18) </field>
|
||||
<field name="report_id" ref="tax_report"/>
|
||||
<field name="sequence" eval="111"/>
|
||||
<field name="formula">(G10+G11)-(G13+G14+G15)+G18</field>
|
||||
<field name="code">G19</field>
|
||||
<field name="formula">G17+G18</field>
|
||||
<field name="parent_id" ref="account_tax_report_gstrpt_purchase_total"/>
|
||||
</record>
|
||||
|
||||
<record id="account_tax_report_gstrpt_g20a" model="account.tax.report.line">
|
||||
<field name="name">GST on purchases (G19 divided by eleven)</field>
|
||||
<field name="formula">((G10+G11)-(G13+G14+G15)+G18)/11</field>
|
||||
<field name="code">GP</field>
|
||||
<field name="formula">G19/11</field>
|
||||
<field name="report_id" ref="tax_report"/>
|
||||
<field name="sequence" eval="112"/>
|
||||
<field name="parent_id" ref="account_tax_report_gstrpt_purchase_total"/>
|
||||
@@ -196,27 +207,71 @@
|
||||
<field name="code">ONLY</field>
|
||||
<field name="report_id" ref="tax_report"/>
|
||||
<field name="sequence" eval="113"/>
|
||||
<field name="parent_id" ref="account_tax_report_gstrpt_g20a"/>
|
||||
<field name="parent_id" ref="account_tax_report_gstrpt_purchase_total"/>
|
||||
</record>
|
||||
|
||||
<record id="account_tax_report_gstrpt_g20b" model="account.tax.report.line">
|
||||
<field name="name">G20: GST on purchases</field>
|
||||
<field name="formula">(((G10+G11)-(G13+G14+G15)+G18)/11)+ONLY</field>
|
||||
<field name="formula">GP+ONLY</field>
|
||||
<field name="report_id" ref="tax_report"/>
|
||||
<field name="code">G20</field>
|
||||
<field name="sequence" eval="114"/>
|
||||
<field name="parent_id" ref="account_tax_report_gstrpt_purchase_total"/>
|
||||
</record>
|
||||
|
||||
|
||||
<!-- Summary -->
|
||||
<record id="account_tax_report_gstrpt_summary" model="account.tax.report.line">
|
||||
<field name="name">Summary</field>
|
||||
<field name="sequence" eval="201"/>
|
||||
<field name="formula">None</field>
|
||||
<field name="report_id" ref="tax_report"/>
|
||||
</record>
|
||||
|
||||
<record id="account_tax_report_gstrpt_summary_1a" model="account.tax.report.line">
|
||||
<field name="name">1A: GST on sales</field>
|
||||
<field name="code">1A</field>
|
||||
<field name="sequence" eval="201"/>
|
||||
<field name="formula">G9</field>
|
||||
<field name="parent_id" eval="account_tax_report_gstrpt_summary"/>
|
||||
<field name="report_id" ref="tax_report"/>
|
||||
</record>
|
||||
|
||||
<record id="account_tax_report_gstrpt_summary_1b" model="account.tax.report.line">
|
||||
<field name="name">1B: GST on purchases</field>
|
||||
<field name="code">1B</field>
|
||||
<field name="sequence" eval="202"/>
|
||||
<field name="formula">G20</field>
|
||||
<field name="parent_id" eval="account_tax_report_gstrpt_summary"/>
|
||||
<field name="report_id" ref="tax_report"/>
|
||||
</record>
|
||||
|
||||
<record id="account_tax_report_gstrpt_summary_9" model="account.tax.report.line">
|
||||
<field name="name">9: Your payment</field>
|
||||
<field name="sequence" eval="203"/>
|
||||
<field name="formula">1A-1B</field>
|
||||
<field name="parent_id" eval="account_tax_report_gstrpt_summary"/>
|
||||
<field name="report_id" ref="tax_report"/>
|
||||
</record>
|
||||
|
||||
|
||||
<!-- Comparison -->
|
||||
<record id="account_tax_report_gstrpt_comparison" model="account.tax.report.line">
|
||||
<field name="name">Comparison</field>
|
||||
<field name="tag_name">Comparison</field>
|
||||
<field name="report_id" ref="tax_report"/>
|
||||
<field name="sequence" eval="201"/>
|
||||
<field name="tag_name" eval="False"/>
|
||||
<field name="sequence" eval="301"/>
|
||||
<field name="parent_id" eval="False"/>
|
||||
<field name="report_id" ref="tax_report"/>
|
||||
</record>
|
||||
|
||||
<record id="account_tax_report_gstrpt_comparison" model="account.tax.report.line">
|
||||
<field name="formula">None</field>
|
||||
</record>
|
||||
|
||||
<record id="account_tax_report_gstrpt_comparison_worksheet" model="account.tax.report.line">
|
||||
<field name="name">GST from worksheet (G20-G9)</field>
|
||||
<field name="formula">((((G10+G11)-(G13+G14+G15)+G18)/11)+ONLY)-(((G1-(G2+G3+G4))+G7)/11)</field>
|
||||
<field name="formula">G20-G9</field>
|
||||
<field name="report_id" ref="tax_report"/>
|
||||
<field name="sequence" eval="202"/>
|
||||
<field name="parent_id" ref="account_tax_report_gstrpt_comparison"/>
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
{
|
||||
'name': 'Denmark - Accounting',
|
||||
'version': '1.0',
|
||||
'author': 'Flectra House ApS',
|
||||
'website': 'https://odoohouse.dk',
|
||||
'author': 'Flectra House ApS, VK DATA ApS',
|
||||
'website': 'http://odoodanmark.dk',
|
||||
'category': 'Accounting/Localizations/Account Charts',
|
||||
'description': """
|
||||
|
||||
@@ -87,7 +87,6 @@ Produkt setup:
|
||||
|
||||
.
|
||||
|
||||
Copyright 2018 Flectra House ApS
|
||||
""",
|
||||
'depends': ['account', 'base_iban', 'base_vat'],
|
||||
'data': [
|
||||
@@ -95,6 +94,7 @@ Copyright 2018 Flectra House ApS
|
||||
'data/l10n_dk_chart_template_data.xml',
|
||||
'data/account.account.template.csv',
|
||||
'data/l10n_dk_chart_template_post_data.xml',
|
||||
'data/account_tax_report_data.xml',
|
||||
'data/account_tax_template_data.xml',
|
||||
'data/account_fiscal_position_template.xml',
|
||||
'data/account_fiscal_position_tax_template.xml',
|
||||
|
||||
@@ -1,5 +1,37 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<flectra>
|
||||
<!-- EU lande Business -->
|
||||
<record id="position_tax_salgvare_eu" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_eu_taxid"/>
|
||||
<field name="tax_src_id" ref="tax110"/>
|
||||
<field name="tax_dest_id" ref="tax210"/>
|
||||
</record>
|
||||
<record id="position_tax_salgydelser_eu" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_eu_taxid"/>
|
||||
<field name="tax_src_id" ref="tax120"/>
|
||||
<field name="tax_dest_id" ref="tax220"/>
|
||||
</record>
|
||||
<record id="position_tax_koebvare_eu" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_eu_taxid"/>
|
||||
<field name="tax_src_id" ref="tax400"/>
|
||||
<field name="tax_dest_id" ref="tax510"/>
|
||||
</record>
|
||||
<record id="position_tax_koebvare_indeholt_eu" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_eu_taxid"/>
|
||||
<field name="tax_src_id" ref="tax410"/>
|
||||
<field name="tax_dest_id" ref="tax510"/>
|
||||
</record>
|
||||
<record id="position_tax_koebydelser_eu" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_eu_taxid"/>
|
||||
<field name="tax_src_id" ref="tax420"/>
|
||||
<field name="tax_dest_id" ref="tax520"/>
|
||||
</record>
|
||||
<record id="position_tax_koebydelser_indeholdt_eu" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_eu_taxid"/>
|
||||
<field name="tax_src_id" ref="tax425"/>
|
||||
<field name="tax_dest_id" ref="tax520"/>
|
||||
</record>
|
||||
|
||||
<!-- 3. lande -->
|
||||
<record id="position_tax_salgvare_3" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_3lande"/>
|
||||
@@ -16,31 +48,19 @@
|
||||
<field name="tax_src_id" ref="tax400"/>
|
||||
<field name="tax_dest_id" ref="tax610"/>
|
||||
</record>
|
||||
<record id="position_tax_koebvare_indeholdt_3" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_3lande"/>
|
||||
<field name="tax_src_id" ref="tax410"/>
|
||||
<field name="tax_dest_id" ref="tax610"/>
|
||||
</record>
|
||||
<record id="position_tax_koebydelser_3" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_3lande"/>
|
||||
<field name="tax_src_id" ref="tax420"/>
|
||||
<field name="tax_dest_id" ref="tax620"/>
|
||||
</record>
|
||||
|
||||
<!-- EU lande -->
|
||||
<record id="position_tax_salgvare_eu" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_eu_taxid"/>
|
||||
<field name="tax_src_id" ref="tax110"/>
|
||||
<field name="tax_dest_id" ref="tax210"/>
|
||||
</record>
|
||||
<record id="position_tax_salgydelser_eu" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_eu_taxid"/>
|
||||
<field name="tax_src_id" ref="tax120"/>
|
||||
<field name="tax_dest_id" ref="tax220"/>
|
||||
</record>
|
||||
<record id="position_tax_koebvare_eu" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_eu_taxid"/>
|
||||
<field name="tax_src_id" ref="tax400"/>
|
||||
<field name="tax_dest_id" ref="tax510"/>
|
||||
</record>
|
||||
<record id="position_tax_koebydelser_eu" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_eu_taxid"/>
|
||||
<field name="tax_src_id" ref="tax420"/>
|
||||
<field name="tax_dest_id" ref="tax520"/>
|
||||
<record id="position_tax_koebydelser_indeholdt_3" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_3lande"/>
|
||||
<field name="tax_src_id" ref="tax425"/>
|
||||
<field name="tax_dest_id" ref="tax620"/>
|
||||
</record>
|
||||
</flectra>
|
||||
|
||||
171
addons/l10n_dk/data/account_tax_report_data.xml
Normal file
171
addons/l10n_dk/data/account_tax_report_data.xml
Normal file
@@ -0,0 +1,171 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<flectra>
|
||||
<record id="account_tax_report_skat_dk" model="account.tax.report">
|
||||
<field name="name">VAT Report</field>
|
||||
<field name="country_id" ref="base.dk"/>
|
||||
</record>
|
||||
<!-- Due VAT -->
|
||||
<record id="account_tax_report_line_sales_group" model="account.tax.report.line">
|
||||
<field name="name">Skyldig moms</field>
|
||||
<field name="code">DUE_VAT</field>
|
||||
<field name="sequence" eval="1"/>
|
||||
<field name="report_id" ref="account_tax_report_skat_dk"/>
|
||||
</record>
|
||||
<!-- classic VAT on sales -->
|
||||
<record id="account_tax_report_line_sales_tax" model="account.tax.report.line">
|
||||
<field name="name">Salgsmoms (udgående moms)</field>
|
||||
<field name="code">SALES_VAT</field>
|
||||
<field name="tag_name">UM</field>
|
||||
<field name="sequence" eval="1"/>
|
||||
<field name="parent_id" ref="l10n_dk.account_tax_report_line_sales_group"/>
|
||||
<field name="report_id" ref="account_tax_report_skat_dk"/>
|
||||
</record>
|
||||
<!-- VAT on goods purchases abroad with reverse charge -->
|
||||
<record id="account_tax_report_line_international_purchase_products" model="account.tax.report.line">
|
||||
<field name="name">Moms af varekøb i udlandet (både EU og lande uden for EU)</field>
|
||||
<field name="code">REVERSE_CHARGE_MERCHANDISES_PURCHASED_OUT_DK</field>
|
||||
<field name="tag_name">MVU</field>
|
||||
<field name="sequence" eval="2"/>
|
||||
<field name="parent_id" ref="l10n_dk.account_tax_report_line_sales_group"/>
|
||||
<field name="report_id" ref="account_tax_report_skat_dk"/>
|
||||
</record>
|
||||
<!-- VAT on service purchases abroad with reverse charge -->
|
||||
<record id="account_tax_report_line_international_purchase_services" model="account.tax.report.line">
|
||||
<field name="name">Moms af ydelseskøb i udlandet med omvendt betalingspligt</field>
|
||||
<field name="code">REVERSE_CHARGE_SERVICES_PURCHASED_OUT_DK</field>
|
||||
<field name="tag_name">MYUOB</field>
|
||||
<field name="sequence" eval="3"/>
|
||||
<field name="parent_id" ref="l10n_dk.account_tax_report_line_sales_group"/>
|
||||
<field name="report_id" ref="account_tax_report_skat_dk"/>
|
||||
</record>
|
||||
|
||||
<!-- Deduction VAT -->
|
||||
<record id="account_tax_report_line_deduction_group" model="account.tax.report.line">
|
||||
<field name="name">Fradrag</field>
|
||||
<field name="code">VAT_TO_DEDUCED</field>
|
||||
<field name="sequence" eval="2"/>
|
||||
<field name="report_id" ref="account_tax_report_skat_dk"/>
|
||||
</record>
|
||||
<record id="account_tax_report_line_deduction_purchase_tax" model="account.tax.report.line">
|
||||
<field name="name">Købsmoms (indgående moms)</field>
|
||||
<field name="code">PURCHASE_VAT</field>
|
||||
<field name="tag_name">KM</field>
|
||||
<field name="sequence" eval="1"/>
|
||||
<field name="parent_id" ref="l10n_dk.account_tax_report_line_deduction_group"/>
|
||||
<field name="report_id" ref="account_tax_report_skat_dk"/>
|
||||
</record>
|
||||
<record id="account_tax_report_line_deduction_oil_bottle_tax" model="account.tax.report.line">
|
||||
<field name="name">Olie- og flaskegasafgift</field>
|
||||
<field name="code">OIL_AND_BOTTLED_GAS_TAX</field>
|
||||
<field name="tag_name">OFA</field>
|
||||
<field name="sequence" eval="2"/>
|
||||
<field name="parent_id" ref="l10n_dk.account_tax_report_line_deduction_group"/>
|
||||
<field name="report_id" ref="account_tax_report_skat_dk"/>
|
||||
</record>
|
||||
<record id="account_tax_report_line_deduction_electrical_tax" model="account.tax.report.line">
|
||||
<field name="name">Elafgift</field>
|
||||
<field name="code">ELECTRICITY_TAX</field>
|
||||
<field name="tag_name">EA</field>
|
||||
<field name="sequence" eval="3"/>
|
||||
<field name="parent_id" ref="l10n_dk.account_tax_report_line_deduction_group"/>
|
||||
<field name="report_id" ref="account_tax_report_skat_dk"/>
|
||||
</record>
|
||||
<record id="account_tax_report_line_deduction_gas_tax" model="account.tax.report.line">
|
||||
<field name="name">Naturgas- og bygasafgift</field>
|
||||
<field name="code">NATURAL_AND_CITY_GAS_TAX</field>
|
||||
<field name="tag_name">NOBA</field>
|
||||
<field name="sequence" eval="4"/>
|
||||
<field name="parent_id" ref="l10n_dk.account_tax_report_line_deduction_group"/>
|
||||
<field name="report_id" ref="account_tax_report_skat_dk"/>
|
||||
</record>
|
||||
<record id="account_tax_report_line_deduction_coal_tax" model="account.tax.report.line">
|
||||
<field name="name">Kulafgift</field>
|
||||
<field name="code">COAL_TAX</field>
|
||||
<field name="tag_name">KA</field>
|
||||
<field name="sequence" eval="5"/>
|
||||
<field name="parent_id" ref="l10n_dk.account_tax_report_line_deduction_group"/>
|
||||
<field name="report_id" ref="account_tax_report_skat_dk"/>
|
||||
</record>
|
||||
<record id="account_tax_report_line_deduction_co2_tax" model="account.tax.report.line">
|
||||
<field name="name">CO2-afgift</field>
|
||||
<field name="code">CO2_TAX</field>
|
||||
<field name="tag_name">CO2A</field>
|
||||
<field name="sequence" eval="6"/>
|
||||
<field name="parent_id" ref="l10n_dk.account_tax_report_line_deduction_group"/>
|
||||
<field name="report_id" ref="account_tax_report_skat_dk"/>
|
||||
</record>
|
||||
<record id="account_tax_report_line_deduction_water_tax" model="account.tax.report.line">
|
||||
<field name="name">Vandafgift</field>
|
||||
<field name="code">WATER_TAX</field>
|
||||
<field name="tag_name">VA</field>
|
||||
<field name="sequence" eval="7"/>
|
||||
<field name="parent_id" ref="l10n_dk.account_tax_report_line_deduction_group"/>
|
||||
<field name="report_id" ref="account_tax_report_skat_dk"/>
|
||||
</record>
|
||||
|
||||
<!-- Report Results -->
|
||||
<record id="account_tax_report_line_vat_statement" model="account.tax.report.line">
|
||||
<field name="name">Momsangivelse (positivt beløb = betale, negativt beløb = penge tilgode)</field>
|
||||
<field name="sequence" eval="3"/>
|
||||
<field name="report_id" ref="account_tax_report_skat_dk"/>
|
||||
<field name="formula">DUE_VAT - VAT_TO_DEDUCED</field>
|
||||
</record>
|
||||
|
||||
<!-- additional required information -->
|
||||
<record id="account_tax_report_line_additional_info" model="account.tax.report.line">
|
||||
<field name="name">Supplerende oplysninger</field>
|
||||
<field name="sequence" eval="4"/>
|
||||
<field name="report_id" ref="account_tax_report_skat_dk"/>
|
||||
<field name="formula">None</field>
|
||||
</record>
|
||||
<!-- Notes: "in EU" implicitly also mean "out of DK" -->
|
||||
<!-- Bought merchandises base value in EU-->
|
||||
<record id="account_tax_report_line_section_a_products" model="account.tax.report.line">
|
||||
<!-- Rubrik A = varer - Værdien uden moms af varekøb i andre EU-lande (EU-erhvervelser)-->
|
||||
<field name="name">Rubrik A: varer (EU)</field>
|
||||
<field name="tag_name">R-A-V</field>
|
||||
<field name="sequence" eval="1"/>
|
||||
<field name="parent_id" ref="l10n_dk.account_tax_report_line_additional_info"/>
|
||||
<field name="report_id" ref="account_tax_report_skat_dk"/>
|
||||
</record>
|
||||
<!-- Bought services base value in EU -->
|
||||
<record id="account_tax_report_line_section_a_services" model="account.tax.report.line">
|
||||
<field name="name">Rubrik A = ydelser (EU)</field>
|
||||
<field name="tag_name">R-A-Y</field>
|
||||
<field name="sequence" eval="2"/>
|
||||
<field name="parent_id" ref="l10n_dk.account_tax_report_line_additional_info"/>
|
||||
<field name="report_id" ref="account_tax_report_skat_dk"/>
|
||||
</record>
|
||||
<!-- Merchandises base value sold in EU and reported under the no-VAT system (~reverse charge system)-->
|
||||
<record id="account_tax_report_line_section_b_product_eu" model="account.tax.report.line">
|
||||
<field name="name">Rubrik B = varer (Indberettes til EU-salg uden moms)</field>
|
||||
<field name="tag_name">R-B-MR</field>
|
||||
<field name="sequence" eval="3"/>
|
||||
<field name="parent_id" ref="l10n_dk.account_tax_report_line_additional_info"/>
|
||||
<field name="report_id" ref="account_tax_report_skat_dk"/>
|
||||
</record>
|
||||
<!-- Merchandises base value sold in EU without VAT (and thus not reported under the VAT system) to entity/people not subject to VAT -->
|
||||
<record id="account_tax_report_line_section_b_products_non_eu" model="account.tax.report.line">
|
||||
<field name="name">Rubrik B = varer (Indberettes ikke til EU-salg uden moms)</field>
|
||||
<field name="tag_name">R-B-UR</field>
|
||||
<field name="sequence" eval="4"/>
|
||||
<field name="parent_id" ref="l10n_dk.account_tax_report_line_additional_info"/>
|
||||
<field name="report_id" ref="account_tax_report_skat_dk"/>
|
||||
</record>
|
||||
<!-- Reported services base value sold in EU without VAT -->
|
||||
<record id="account_tax_report_line_section_b_services" model="account.tax.report.line">
|
||||
<field name="name">Rubrik B = ydelser - (EU-salg uden moms)</field>
|
||||
<field name="tag_name">R-C-MR</field>
|
||||
<field name="sequence" eval="5"/>
|
||||
<field name="parent_id" ref="l10n_dk.account_tax_report_line_additional_info"/>
|
||||
<field name="report_id" ref="account_tax_report_skat_dk"/>
|
||||
</record>
|
||||
<!-- Any other base value sold without tax (e.g. exportation out of EU) (amount that would go in any of the previous Rubrik) -->
|
||||
<record id="account_tax_report_line_section_c" model="account.tax.report.line">
|
||||
<field name="name">Rubrik C - Værdien af andre varer og ydelser (uanset landet)</field>
|
||||
<field name="tag_name">R-C-UR</field>
|
||||
<field name="sequence" eval="6"/>
|
||||
<field name="parent_id" ref="l10n_dk.account_tax_report_line_additional_info"/>
|
||||
<field name="report_id" ref="account_tax_report_skat_dk"/>
|
||||
</record>
|
||||
</flectra>
|
||||
@@ -1,11 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<flectra noupdate="1">
|
||||
<!-- Salgsmoms -->
|
||||
<!-- DK salgsmoms -->
|
||||
<!-- Salgsmoms (VAT) -->
|
||||
<!-- DK salgsmoms (taxes to set on Sales in DK) -->
|
||||
<record id="tax110" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="dk_chart_template"/>
|
||||
<field name="sequence">110</field>
|
||||
<field name="name">Salgsmoms 25%</field>
|
||||
<field name="name">Salgsmoms 25%, varer</field>
|
||||
<field name="description">25%</field>
|
||||
<field name="amount">25</field>
|
||||
<field name="amount_type">percent</field>
|
||||
@@ -19,6 +19,7 @@
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8720'),
|
||||
'plus_report_line_ids': [ref('l10n_dk.account_tax_report_line_sales_tax')],
|
||||
}),
|
||||
]"/>
|
||||
<field name="refund_repartition_line_ids" eval="[(5, 0, 0),
|
||||
@@ -30,6 +31,7 @@
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8720'),
|
||||
'minus_report_line_ids': [ref('l10n_dk.account_tax_report_line_sales_tax')],
|
||||
}),
|
||||
]"/>
|
||||
</record>
|
||||
@@ -50,6 +52,7 @@
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8720'),
|
||||
'plus_report_line_ids': [ref('l10n_dk.account_tax_report_line_sales_tax')],
|
||||
}),
|
||||
]"/>
|
||||
<field name="refund_repartition_line_ids" eval="[(5, 0, 0),
|
||||
@@ -61,187 +64,91 @@
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8720'),
|
||||
}),
|
||||
]"/>
|
||||
</record>
|
||||
<record id="tax140" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="dk_chart_template"/>
|
||||
<field name="sequence">140</field>
|
||||
<field name="name">Salg omvendt betalingspligt</field>
|
||||
<field name="description"></field>
|
||||
<field name="price_include" eval="0"/>
|
||||
<field name="amount">100</field>
|
||||
<field name="amount_type">percent</field>
|
||||
<field name="type_tax_use">sale</field>
|
||||
<field name="invoice_repartition_line_ids" eval="[(5, 0, 0),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8758'),
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': -100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8769'),
|
||||
}),
|
||||
]"/>
|
||||
<field name="refund_repartition_line_ids" eval="[(5, 0, 0),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8758'),
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': -100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8769'),
|
||||
'minus_report_line_ids': [ref('l10n_dk.account_tax_report_line_sales_tax')],
|
||||
}),
|
||||
]"/>
|
||||
</record>
|
||||
|
||||
<!-- EU salgsmoms-->
|
||||
<!-- EU salgsmoms (taxes to set on Sales in EU when outside of DK) -->
|
||||
<record id="tax210" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="dk_chart_template"/>
|
||||
<field name="sequence">210</field>
|
||||
<field name="name">EU Varesalg (Virksomheder)</field>
|
||||
<field name="description"></field>
|
||||
<field name="price_include" eval="0"/>
|
||||
<field name="amount">100</field>
|
||||
<field name="name">EU Varesalg (Virksomheder) - momsfritaget</field>
|
||||
<field name="amount">0</field>
|
||||
<field name="amount_type">percent</field>
|
||||
<field name="type_tax_use">sale</field>
|
||||
<field name="invoice_repartition_line_ids" eval="[(5, 0, 0),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8754'),
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': -100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8769'),
|
||||
'plus_report_line_ids': [ref('l10n_dk.account_tax_report_line_section_b_product_eu')],
|
||||
}),
|
||||
]"/>
|
||||
<field name="refund_repartition_line_ids" eval="[(5, 0, 0),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8754'),
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': -100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8769'),
|
||||
'minus_report_line_ids': [ref('l10n_dk.account_tax_report_line_section_b_product_eu')],
|
||||
}),
|
||||
]"/>
|
||||
</record>
|
||||
<record id="tax220" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="dk_chart_template"/>
|
||||
<field name="sequence">220</field>
|
||||
<field name="name">EU Ydelsessalg (Virksomheder)</field>
|
||||
<field name="description"></field>
|
||||
<field name="price_include" eval="0"/>
|
||||
<field name="amount">100</field>
|
||||
<field name="name">EU Ydelsessalg (Virksomheder) - momsfritaget</field>
|
||||
<field name="amount">0</field>
|
||||
<field name="amount_type">percent</field>
|
||||
<field name="type_tax_use">sale</field>
|
||||
<field name="invoice_repartition_line_ids" eval="[(5, 0, 0),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8755'),
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': -100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8769'),
|
||||
'plus_report_line_ids': [ref('l10n_dk.account_tax_report_line_section_b_services')],
|
||||
}),
|
||||
]"/>
|
||||
<field name="refund_repartition_line_ids" eval="[(5, 0, 0),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8755'),
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': -100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8769'),
|
||||
'minus_report_line_ids': [ref('l10n_dk.account_tax_report_line_section_b_services')],
|
||||
}),
|
||||
]"/>
|
||||
</record>
|
||||
|
||||
<!-- 3. Lande salgsmoms-->
|
||||
<!-- 3. Lande salgsmoms (taxes to set on Sales outside of EU) -->
|
||||
<record id="tax310" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="dk_chart_template"/>
|
||||
<field name="sequence">310</field>
|
||||
<field name="name">3. Land Salg Vare / Ydelser</field>
|
||||
<field name="description"></field>
|
||||
<field name="amount">100</field>
|
||||
<field name="amount">0</field>
|
||||
<field name="amount_type">percent</field>
|
||||
<field name="type_tax_use">sale</field>
|
||||
<field name="invoice_repartition_line_ids" eval="[(5, 0, 0),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8758'),
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': -100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8769'),
|
||||
'plus_report_line_ids': [ref('l10n_dk.account_tax_report_line_section_c')],
|
||||
}),
|
||||
]"/>
|
||||
<field name="refund_repartition_line_ids" eval="[(5, 0, 0),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8758'),
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': -100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8769'),
|
||||
'minus_report_line_ids': [ref('l10n_dk.account_tax_report_line_section_c')],
|
||||
}),
|
||||
]"/>
|
||||
</record>
|
||||
|
||||
<!-- Købsmoms -->
|
||||
<!-- DK købsmoms -->
|
||||
<!-- Købsmoms (VAT on purchase) -->
|
||||
|
||||
<!-- DK købsmoms (taxes to set on purchase inside DK) -->
|
||||
<!-- 2 different taxes for merchandises and services isn't required for local taxes but is required -->
|
||||
<!-- for EU related taxes and with fiscal position and we can't map one tax to 2 other taxes because it's -->
|
||||
<!-- a one on one relation. Thus, we set 2 taxes locally. -->
|
||||
<record id="tax400" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="dk_chart_template"/>
|
||||
<field name="sequence">400</field>
|
||||
<field name="name">Købsmoms 25%</field>
|
||||
<field name="name">Købsmoms 25%, varer</field>
|
||||
<field name="description">25%</field>
|
||||
<field name="amount">25</field>
|
||||
<field name="amount_type">percent</field>
|
||||
@@ -255,6 +162,7 @@
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8740'),
|
||||
'plus_report_line_ids': [ref('l10n_dk.account_tax_report_line_deduction_purchase_tax')],
|
||||
}),
|
||||
]"/>
|
||||
<field name="refund_repartition_line_ids" eval="[(5, 0, 0),
|
||||
@@ -266,13 +174,14 @@
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8740'),
|
||||
'minus_report_line_ids': [ref('l10n_dk.account_tax_report_line_deduction_purchase_tax')],
|
||||
}),
|
||||
]"/>
|
||||
</record>
|
||||
<record id="tax410" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="dk_chart_template"/>
|
||||
<field name="sequence">410</field>
|
||||
<field name="name">Købsmoms 25% indeholdt</field>
|
||||
<field name="name">Købsmoms 25% indeholdt, varer</field>
|
||||
<field name="description">25% indeholdt</field>
|
||||
<field name="amount">25</field>
|
||||
<field name="amount_type">percent</field>
|
||||
@@ -287,6 +196,7 @@
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8740'),
|
||||
'plus_report_line_ids': [ref('l10n_dk.account_tax_report_line_deduction_purchase_tax')],
|
||||
}),
|
||||
]"/>
|
||||
<field name="refund_repartition_line_ids" eval="[(5, 0, 0),
|
||||
@@ -298,6 +208,7 @@
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8740'),
|
||||
'minus_report_line_ids': [ref('l10n_dk.account_tax_report_line_deduction_purchase_tax')],
|
||||
}),
|
||||
]"/>
|
||||
</record>
|
||||
@@ -318,6 +229,7 @@
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8740'),
|
||||
'plus_report_line_ids': [ref('l10n_dk.account_tax_report_line_deduction_purchase_tax')],
|
||||
}),
|
||||
]"/>
|
||||
<field name="refund_repartition_line_ids" eval="[(5, 0, 0),
|
||||
@@ -329,6 +241,41 @@
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8740'),
|
||||
'minus_report_line_ids': [ref('l10n_dk.account_tax_report_line_deduction_purchase_tax')],
|
||||
}),
|
||||
]"/>
|
||||
</record>
|
||||
<record id="tax425" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="dk_chart_template"/>
|
||||
<field name="sequence">420</field>
|
||||
<field name="name">Købsmoms 25% indeholdt, ydelser</field>
|
||||
<field name="description">25%</field>
|
||||
<field name="amount">25</field>
|
||||
<field name="amount_type">percent</field>
|
||||
<field name="price_include" eval="True"/>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
<field name="invoice_repartition_line_ids" eval="[(5, 0, 0),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8740'),
|
||||
'plus_report_line_ids': [ref('l10n_dk.account_tax_report_line_deduction_purchase_tax')],
|
||||
}),
|
||||
]"/>
|
||||
<field name="refund_repartition_line_ids" eval="[(5, 0, 0),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8740'),
|
||||
'minus_report_line_ids': [ref('l10n_dk.account_tax_report_line_deduction_purchase_tax')],
|
||||
}),
|
||||
]"/>
|
||||
</record>
|
||||
@@ -336,8 +283,6 @@
|
||||
<field name="chart_template_id" ref="dk_chart_template"/>
|
||||
<field name="sequence">430</field>
|
||||
<field name="name">Køb omvendt betalingspligt</field>
|
||||
<field name="description"></field>
|
||||
<field name="price_include" eval="0"/>
|
||||
<field name="amount">25</field>
|
||||
<field name="amount_type">percent</field>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
@@ -346,15 +291,17 @@
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': -100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8725'),
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8740'),
|
||||
'plus_report_line_ids': [ref('l10n_dk.account_tax_report_line_deduction_purchase_tax')],
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': -100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8725'),
|
||||
'minus_report_line_ids': [ref('l10n_dk.account_tax_report_line_sales_tax')],
|
||||
}),
|
||||
]"/>
|
||||
<field name="refund_repartition_line_ids" eval="[(5, 0, 0),
|
||||
@@ -362,15 +309,17 @@
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': -100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8725'),
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8740'),
|
||||
'minus_report_line_ids': [ref('l10n_dk.account_tax_report_line_sales_tax')],
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': -100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8725'),
|
||||
'plus_report_line_ids': [ref('l10n_dk.account_tax_report_line_deduction_purchase_tax')],
|
||||
}),
|
||||
]"/>
|
||||
</record>
|
||||
@@ -391,6 +340,7 @@
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8740'),
|
||||
'plus_report_line_ids': [ref('l10n_dk.account_tax_report_line_deduction_purchase_tax')],
|
||||
}),
|
||||
]"/>
|
||||
<field name="refund_repartition_line_ids" eval="[(5, 0, 0),
|
||||
@@ -402,70 +352,55 @@
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8740'),
|
||||
'minus_report_line_ids': [ref('l10n_dk.account_tax_report_line_deduction_purchase_tax')],
|
||||
}),
|
||||
]"/>
|
||||
</record>
|
||||
|
||||
<!-- EU købsmoms-->
|
||||
<!-- EU købsmoms (taxes to set on purchase in EU outside DK) -->
|
||||
<record id="tax510" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="dk_chart_template"/>
|
||||
<field name="sequence">510</field>
|
||||
<field name="name">EU Varekøb</field>
|
||||
<field name="description"></field>
|
||||
<field name="price_include" eval="0"/>
|
||||
<field name="amount">100</field>
|
||||
<field name="amount">25</field>
|
||||
<field name="amount_type">percent</field>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
<field name="invoice_repartition_line_ids" eval="[(5, 0, 0),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': -25,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8730'),
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': 25,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8740'),
|
||||
'plus_report_line_ids': [ref('l10n_dk.account_tax_report_line_section_a_products')],
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8750'),
|
||||
'account_id': ref('a8740'),
|
||||
'plus_report_line_ids': [ref('l10n_dk.account_tax_report_line_deduction_purchase_tax')],
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': -100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8769'),
|
||||
'account_id': ref('a8730'),
|
||||
'minus_report_line_ids': [ref('l10n_dk.account_tax_report_line_international_purchase_products')],
|
||||
}),
|
||||
]"/>
|
||||
<field name="refund_repartition_line_ids" eval="[(5, 0, 0),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': -25,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8730'),
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': 25,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8740'),
|
||||
'minus_report_line_ids': [ref('l10n_dk.account_tax_report_line_section_a_products')],
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8750'),
|
||||
'account_id': ref('a8740'),
|
||||
'minus_report_line_ids': [ref('l10n_dk.account_tax_report_line_deduction_purchase_tax')],
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': -100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8769'),
|
||||
'account_id': ref('a8730'),
|
||||
'plus_report_line_ids': [ref('l10n_dk.account_tax_report_line_international_purchase_products')],
|
||||
}),
|
||||
]"/>
|
||||
</record>
|
||||
@@ -474,8 +409,149 @@
|
||||
<field name="chart_template_id" ref="dk_chart_template"/>
|
||||
<field name="sequence">520</field>
|
||||
<field name="name">EU Ydelseskøb</field>
|
||||
<field name="description"></field>
|
||||
<field name="price_include" eval="0"/>
|
||||
<field name="amount">25</field>
|
||||
<field name="amount_type">percent</field>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
<field name="invoice_repartition_line_ids" eval="[(5, 0, 0),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
'plus_report_line_ids': [ref('l10n_dk.account_tax_report_line_section_a_services')],
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8740'),
|
||||
'plus_report_line_ids': [ref('l10n_dk.account_tax_report_line_deduction_purchase_tax')],
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': -100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8731'),
|
||||
'minus_report_line_ids': [ref('l10n_dk.account_tax_report_line_international_purchase_services')],
|
||||
}),
|
||||
]"/>
|
||||
<field name="refund_repartition_line_ids" eval="[(5, 0, 0),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
'minus_report_line_ids': [ref('l10n_dk.account_tax_report_line_section_a_services')],
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8740'),
|
||||
'minus_report_line_ids': [ref('l10n_dk.account_tax_report_line_deduction_purchase_tax')],
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': -100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8731'),
|
||||
'plus_report_line_ids': [ref('l10n_dk.account_tax_report_line_international_purchase_services')],
|
||||
}),
|
||||
]"/>
|
||||
</record>
|
||||
|
||||
|
||||
<!-- 3. Lande købsmoms (taxes to set on purchase outside of EU) -->
|
||||
<record id="tax610" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="dk_chart_template"/>
|
||||
<field name="sequence">610</field>
|
||||
<field name="name">3. Land Varekøb</field>
|
||||
<field name="amount">25</field>
|
||||
<field name="amount_type">percent</field>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
<field name="invoice_repartition_line_ids" eval="[(5, 0, 0),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8740'),
|
||||
'plus_report_line_ids': [ref('l10n_dk.account_tax_report_line_international_purchase_products')],
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': -100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8730'),
|
||||
'minus_report_line_ids': [ref('l10n_dk.account_tax_report_line_deduction_purchase_tax')],
|
||||
}),
|
||||
]"/>
|
||||
<field name="refund_repartition_line_ids" eval="[(5, 0, 0),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8740'),
|
||||
'minus_report_line_ids': [ref('l10n_dk.account_tax_report_line_international_purchase_products')],
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': -100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8730'),
|
||||
'plus_report_line_ids': [ref('l10n_dk.account_tax_report_line_deduction_purchase_tax')],
|
||||
}),
|
||||
]"/>
|
||||
</record>
|
||||
<record id="tax620" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="dk_chart_template"/>
|
||||
<field name="sequence">620</field>
|
||||
<field name="name">3. Land Ydelseskøb</field>
|
||||
<field name="amount">25</field>
|
||||
<field name="amount_type">percent</field>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
<field name="invoice_repartition_line_ids" eval="[(5, 0, 0),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8740'),
|
||||
'plus_report_line_ids': [ref('l10n_dk.account_tax_report_line_deduction_purchase_tax')],
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': -100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8731'),
|
||||
'minus_report_line_ids': [ref('l10n_dk.account_tax_report_line_international_purchase_services')],
|
||||
}),
|
||||
]"/>
|
||||
<field name="refund_repartition_line_ids" eval="[(5, 0, 0),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8740'),
|
||||
'minus_report_line_ids': [ref('l10n_dk.account_tax_report_line_deduction_purchase_tax')],
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': -100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8731'),
|
||||
'plus_report_line_ids': [ref('l10n_dk.account_tax_report_line_international_purchase_services')],
|
||||
}),
|
||||
]"/>
|
||||
</record>
|
||||
|
||||
<!-- All Energy and water taxes -->
|
||||
|
||||
<!-- oil and bottled gas tax -->
|
||||
<!-- 92.83% of the tax is deductible -->
|
||||
<!-- https://skat.dk/data.aspx?oid=2246453 -->
|
||||
<record id="tax710" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="dk_chart_template"/>
|
||||
<field name="sequence">710</field>
|
||||
<field name="name">Olie- og flaskegasafgift</field>
|
||||
<field name="amount">100</field>
|
||||
<field name="amount_type">percent</field>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
@@ -485,24 +561,14 @@
|
||||
'repartition_type': 'base',
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': -25,
|
||||
'factor_percent': 92.83,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8731'),
|
||||
'account_id': ref('a8775'),
|
||||
'plus_report_line_ids': [ref('l10n_dk.account_tax_report_line_deduction_oil_bottle_tax')],
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': 25,
|
||||
'factor_percent': -92.83,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8740'),
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8751'),
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': -100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8769'),
|
||||
}),
|
||||
]"/>
|
||||
<field name="refund_repartition_line_ids" eval="[(5, 0, 0),
|
||||
@@ -511,36 +577,143 @@
|
||||
'repartition_type': 'base',
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': -25,
|
||||
'factor_percent': 92.83,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8731'),
|
||||
'account_id': ref('a8775'),
|
||||
'minus_report_line_ids': [ref('l10n_dk.account_tax_report_line_deduction_oil_bottle_tax')],
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': 25,
|
||||
'factor_percent': -92.83,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8740'),
|
||||
}),
|
||||
]"/>
|
||||
</record>
|
||||
<!-- 0.896 cent per kilowatt (to set as quantity) can be deduced -->
|
||||
<!-- https://skat.dk/data.aspx?oid=2246453 -->
|
||||
<record id="tax720" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="dk_chart_template"/>
|
||||
<field name="sequence">720</field>
|
||||
<field name="name">Elafgift</field>
|
||||
<field name="amount">0.896</field>
|
||||
<field name="amount_type">fixed</field>
|
||||
<field name="price_include" eval="True"/>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
<field name="invoice_repartition_line_ids" eval="[(5, 0, 0),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8751'),
|
||||
'account_id': ref('a8775'),
|
||||
'plus_report_line_ids': [ref('l10n_dk.account_tax_report_line_deduction_electrical_tax')],
|
||||
}),
|
||||
]"/>
|
||||
<field name="refund_repartition_line_ids" eval="[(5, 0, 0),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': -100,
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8769'),
|
||||
'account_id': ref('a8775'),
|
||||
'minus_report_line_ids': [ref('l10n_dk.account_tax_report_line_deduction_electrical_tax')],
|
||||
}),
|
||||
]"/>
|
||||
</record>
|
||||
|
||||
<!-- 3. Lande købsmoms-->
|
||||
<record id="tax610" model="account.tax.template">
|
||||
<!-- city gas and oil tax: same than bottled but appears on a different report line -->
|
||||
<!-- 92.83% of the tax is deductible -->
|
||||
<!-- https://skat.dk/data.aspx?oid=2246453 -->
|
||||
<record id="tax730" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="dk_chart_template"/>
|
||||
<field name="sequence">610</field>
|
||||
<field name="name">3. Land Varekøb</field>
|
||||
<field name="description"></field>
|
||||
<field name="price_include" eval="0"/>
|
||||
<field name="amount">25</field>
|
||||
<field name="sequence">730</field>
|
||||
<field name="name">Naturgas- og bygasafgift</field>
|
||||
<field name="amount">100</field>
|
||||
<field name="amount_type">percent</field>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
<field name="invoice_repartition_line_ids" eval="[(5, 0, 0),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': 92.83,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8780'),
|
||||
'plus_report_line_ids': [ref('l10n_dk.account_tax_report_line_deduction_gas_tax')],
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': -92.83,
|
||||
'repartition_type': 'tax',
|
||||
}),
|
||||
]"/>
|
||||
<field name="refund_repartition_line_ids" eval="[(5, 0, 0),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': 92.83,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8780'),
|
||||
'minus_report_line_ids': [ref('l10n_dk.account_tax_report_line_deduction_gas_tax')],
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': -92.83,
|
||||
'repartition_type': 'tax',
|
||||
}),
|
||||
]"/>
|
||||
</record>
|
||||
<!-- Coal tax: percentage is the same as oil and bottled gas but with it ends up in its own report line -->
|
||||
<record id="tax740" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="dk_chart_template"/>
|
||||
<field name="sequence">740</field>
|
||||
<field name="name">Kulafgift</field>
|
||||
<field name="amount">100</field>
|
||||
<field name="amount_type">percent</field>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
<field name="invoice_repartition_line_ids" eval="[(5, 0, 0),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': 92.83,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8785'),
|
||||
'plus_report_line_ids': [ref('l10n_dk.account_tax_report_line_deduction_coal_tax')],
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': -92.83,
|
||||
'repartition_type': 'tax',
|
||||
}),
|
||||
]"/>
|
||||
<field name="refund_repartition_line_ids" eval="[(5, 0, 0),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': 92.83,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8785'),
|
||||
'minus_report_line_ids': [ref('l10n_dk.account_tax_report_line_deduction_coal_tax')],
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': -92.83,
|
||||
'repartition_type': 'tax',
|
||||
}),
|
||||
]"/>
|
||||
</record>
|
||||
<!-- CO2-afgift is rarely used anymore, but we include it as inactive so that it can be customized when the need comes -->
|
||||
<record id="tax750" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="dk_chart_template"/>
|
||||
<field name="sequence">750</field>
|
||||
<field name="name">CO2-afgift</field>
|
||||
<field name="active" eval="False"/>
|
||||
<field name="amount">0</field>
|
||||
<field name="amount_type">percent</field>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
<field name="invoice_repartition_line_ids" eval="[(5, 0, 0),
|
||||
@@ -551,12 +724,13 @@
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8740'),
|
||||
'account_id': ref('a8785'),
|
||||
'plus_report_line_ids': [ref('l10n_dk.account_tax_report_line_deduction_co2_tax')],
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': -100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8730'),
|
||||
'account_id': ref('a4271'),
|
||||
}),
|
||||
]"/>
|
||||
<field name="refund_repartition_line_ids" eval="[(5, 0, 0),
|
||||
@@ -567,37 +741,36 @@
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8740'),
|
||||
'account_id': ref('a8785'),
|
||||
'minus_report_line_ids': [ref('l10n_dk.account_tax_report_line_deduction_co2_tax')],
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': -100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8730'),
|
||||
'account_id': ref('a4271'),
|
||||
}),
|
||||
]"/>
|
||||
</record>
|
||||
<record id="tax620" model="account.tax.template">
|
||||
<!-- water tax: 6.18 per cubic meter -->
|
||||
<!-- https://skat.dk/data.aspx?oid=2246453 -->
|
||||
<record id="tax760" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="dk_chart_template"/>
|
||||
<field name="sequence">620</field>
|
||||
<field name="name">3. Land Ydelseskøb</field>
|
||||
<field name="description"></field>
|
||||
<field name="amount">25</field>
|
||||
<field name="amount_type">percent</field>
|
||||
<field name="sequence">760</field>
|
||||
<field name="name">Vandafgift</field>
|
||||
<field name="amount">6.1800</field>
|
||||
<field name="amount_type">fixed</field>
|
||||
<field name="price_include" eval="True"/>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
<field name="invoice_repartition_line_ids" eval="[(5, 0, 0),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': -100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8731'),
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8740'),
|
||||
'account_id': ref('a8795'),
|
||||
'plus_report_line_ids': [ref('l10n_dk.account_tax_report_line_deduction_water_tax')],
|
||||
}),
|
||||
]"/>
|
||||
<field name="refund_repartition_line_ids" eval="[(5, 0, 0),
|
||||
@@ -605,15 +778,11 @@
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': -100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8731'),
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('a8740'),
|
||||
'account_id': ref('a8795'),
|
||||
'minus_report_line_ids': [ref('l10n_dk.account_tax_report_line_deduction_water_tax')],
|
||||
}),
|
||||
]"/>
|
||||
</record>
|
||||
|
||||
@@ -12,13 +12,13 @@
|
||||
<attribute name="attrs">{'readonly': [('pos_session_id', '!=', False)]}</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='journal_id']" position="attributes">
|
||||
<attribute name="attrs">{'readonly': [('pos_session_id', '!=', False)]}</attribute>
|
||||
<attribute name="attrs">{'readonly': ['|', ('move_line_count','!=', 0), ('pos_session_id', '!=', False)]}</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='date']" position="attributes">
|
||||
<attribute name="attrs">{'readonly': [('pos_session_id', '!=', False)]}</attribute>
|
||||
<attribute name="attrs">{'readonly': ['|', ('state', '!=', 'open'), ('pos_session_id', '!=', False)]}</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='line_ids']" position="attributes">
|
||||
<attribute name="attrs">{'readonly': [('pos_session_id', '!=', False)]}</attribute>
|
||||
<attribute name="attrs">{'readonly': ['|', ('state', '!=', 'open'), ('pos_session_id', '!=', False)]}</attribute>
|
||||
</xpath>
|
||||
|
||||
</field>
|
||||
|
||||
@@ -126,9 +126,13 @@ class AccountMove(models.Model):
|
||||
return False
|
||||
|
||||
def get_vat_number(vat):
|
||||
if vat[:2].isdecimal():
|
||||
return vat.replace(' ', '')
|
||||
return vat[2:].replace(' ', '')
|
||||
|
||||
def get_vat_country(vat):
|
||||
if vat[:2].isdecimal():
|
||||
return 'IT'
|
||||
return vat[:2].upper()
|
||||
|
||||
def in_eu(partner):
|
||||
|
||||
@@ -8,11 +8,15 @@ class AccountMoveReversal(models.TransientModel):
|
||||
_inherit = "account.move.reversal"
|
||||
|
||||
l10n_latam_use_documents = fields.Boolean(compute='_compute_document_type')
|
||||
l10n_latam_document_type_id = fields.Many2one('l10n_latam.document.type', 'Document Type', ondelete='cascade', domain="[('id', 'in', l10n_latam_available_document_type_ids)]", compute='_compute_document_type', readonly=False)
|
||||
l10n_latam_document_type_id = fields.Many2one('l10n_latam.document.type', 'Document Type', ondelete='cascade', domain="[('id', 'in', l10n_latam_available_document_type_ids)]", compute='_compute_document_type', readonly=False, inverse='_inverse_document_type')
|
||||
l10n_latam_available_document_type_ids = fields.Many2many('l10n_latam.document.type', compute='_compute_document_type')
|
||||
l10n_latam_document_number = fields.Char(string='Document Number')
|
||||
l10n_latam_manual_document_number = fields.Boolean(compute='_compute_l10n_latam_manual_document_number', string='Manual Number')
|
||||
|
||||
def _inverse_document_type(self):
|
||||
self._clean_pipe()
|
||||
self.l10n_latam_document_number = '%s|%s' % (self.l10n_latam_document_type_id.id or '', self.l10n_latam_document_number or '')
|
||||
|
||||
@api.depends('l10n_latam_document_type_id')
|
||||
def _compute_l10n_latam_manual_document_number(self):
|
||||
self.l10n_latam_manual_document_number = False
|
||||
@@ -59,15 +63,32 @@ class AccountMoveReversal(models.TransientModel):
|
||||
""" Set the default document type and number in the new revsersal move taking into account the ones selected in
|
||||
the wizard """
|
||||
res = super()._prepare_default_reversal(move)
|
||||
res.update({
|
||||
'l10n_latam_document_type_id': self.l10n_latam_document_type_id.id,
|
||||
'l10n_latam_document_number': self.l10n_latam_document_number,
|
||||
})
|
||||
# self.l10n_latam_document_number will have a ',' only if l10n_latam_document_type_id is changed and inverse methods is called
|
||||
if self.l10n_latam_document_number and '|' in self.l10n_latam_document_number:
|
||||
l10n_latam_document_type_id, l10n_latam_document_number = self.l10n_latam_document_number.split('|')
|
||||
res.update({
|
||||
'l10n_latam_document_type_id': int(l10n_latam_document_type_id) if l10n_latam_document_type_id else False,
|
||||
'l10n_latam_document_number': l10n_latam_document_number or False,
|
||||
})
|
||||
else:
|
||||
res.update({
|
||||
'l10n_latam_document_type_id': self.l10n_latam_document_type_id.id,
|
||||
'l10n_latam_document_number': self.l10n_latam_document_number,
|
||||
})
|
||||
return res
|
||||
|
||||
def _clean_pipe(self):
|
||||
""" Clean pipe in case the user confirm but he gets a raise, the l10n_latam_document_number is stored now
|
||||
with the doc type id, we should remove to append new one or to format properly"""
|
||||
latam_document = self.l10n_latam_document_number or ''
|
||||
if '|' in latam_document:
|
||||
latam_document = latam_document[latam_document.index('|')+1:]
|
||||
self.l10n_latam_document_number = latam_document
|
||||
|
||||
@api.onchange('l10n_latam_document_number', 'l10n_latam_document_type_id')
|
||||
def _onchange_l10n_latam_document_number(self):
|
||||
if self.l10n_latam_document_type_id:
|
||||
self._clean_pipe()
|
||||
l10n_latam_document_number = self.l10n_latam_document_type_id._format_document_number(
|
||||
self.l10n_latam_document_number)
|
||||
if self.l10n_latam_document_number != l10n_latam_document_number:
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
<field name="parent_id" ref="account_tax_report_line_2b_intra_community_acqui_of_goods_base"/>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="account_tax_report_line_2b_base_exempt" model="account.tax.report.line">
|
||||
<field name="name">194 - base exempt</field>
|
||||
<field name="tag_name">194</field>
|
||||
@@ -61,6 +60,15 @@
|
||||
<field name="parent_id" ref="account_tax_report_line_2b_intra_community_acqui_of_goods_base"/>
|
||||
</record>
|
||||
|
||||
<record id="account_tax_report_line_2b_manufactured_tobacco" model="account.tax.report.line">
|
||||
<field name="name">719 - of manufactured tobacco (VAT is collected at the exit of the tax warehouse with excise duties)</field>
|
||||
<field name="tag_name">719</field>
|
||||
<field name="sequence">10</field>
|
||||
<field name="code">LUTAX_719</field>
|
||||
<field name="report_id" ref="tax_report"/>
|
||||
<field name="parent_id" ref="account_tax_report_line_2b_intra_community_acqui_of_goods_base"/>
|
||||
</record>
|
||||
|
||||
<record id="account_tax_report_line_2d_importation_of_goods_base" model="account.tax.report.line">
|
||||
<field name="name">065 - Importation of goods – base</field>
|
||||
<field name="sequence">6</field>
|
||||
@@ -100,6 +108,15 @@
|
||||
<field name="parent_id" ref="account_tax_report_line_2d_importation_of_goods_base"/>
|
||||
</record>
|
||||
|
||||
<record id="account_tax_report_line_2d_1_manufactured_tobacco" model="account.tax.report.line">
|
||||
<field name="name">729 - of manufactured tobacco (VAT is collected at the exit of the tax warehouse with excise duties)</field>
|
||||
<field name="tag_name">729</field>
|
||||
<field name="sequence">8</field>
|
||||
<field name="code">LUTAX_729</field>
|
||||
<field name="report_id" ref="tax_report"/>
|
||||
<field name="parent_id" ref="account_tax_report_line_2d_importation_of_goods_base"/>
|
||||
</record>
|
||||
|
||||
<record id="account_tax_report_line_2d_2_base_17" model="account.tax.report.line">
|
||||
<field name="name">731 - for non-business purposes: base 17%</field>
|
||||
<field name="tag_name">731</field>
|
||||
@@ -312,7 +329,7 @@
|
||||
<field name="parent_id" ref="account_tax_report_line_1a_total_sale"/>
|
||||
<field name="report_id" ref="tax_report"/>
|
||||
<field name="code">LUTAX_472</field>
|
||||
<field name="formula">LUTAX_021 + LUTAX_037 - LUTAX_456</field>
|
||||
<field name="formula">LUTAX_021 + LUTAX_037 - LUTAX_456 - LUTAX_455 - LUTAX_471</field>
|
||||
</record>
|
||||
|
||||
<record id="account_tax_report_line_1a_app_goods_non_bus" model="account.tax.report.line">
|
||||
@@ -864,6 +881,7 @@
|
||||
|
||||
<record id="account_tax_report_line_3b1_rel_trans" model="account.tax.report.line">
|
||||
<field name="name">094 - relating to transactions which are exempt pursuant to articles 44 and 56quater</field>
|
||||
<field name="tag_name">094</field>
|
||||
<field name="sequence">1</field>
|
||||
<field name="parent_id" ref="account_tax_report_line_3b_total_input_tax_nd"/>
|
||||
<field name="code">LUTAX_094</field>
|
||||
@@ -872,12 +890,23 @@
|
||||
|
||||
<record id="account_tax_report_line_3b2_ded_prop" model="account.tax.report.line">
|
||||
<field name="name">095 - where the deductible proportion determined in accordance to article 50 is applied</field>
|
||||
<field name="tag_name">095</field>
|
||||
<field name="sequence">2</field>
|
||||
<field name="parent_id" ref="account_tax_report_line_3b_total_input_tax_nd"/>
|
||||
<field name="code">LUTAX_095</field>
|
||||
<field name="report_id" ref="tax_report"/>
|
||||
</record>
|
||||
|
||||
<record id="account_tax_report_line_3b2_input_tax_margin" model="account.tax.report.line">
|
||||
<field name="name">096 - Non recoverable input tax in accordance with Art. 56ter-1(7) and 56ter-2(7) (when applying the margin scheme)</field>
|
||||
<field name="tag_name">096</field>
|
||||
<field name="sequence">3</field>
|
||||
<field name="code">LUTAX_096</field>
|
||||
<field name="report_id" ref="tax_report"/>
|
||||
<field name="parent_id" ref="account_tax_report_line_3b_total_input_tax_nd"/>
|
||||
</record>
|
||||
|
||||
<!-- Note: any change in formula here should be reflected in section `IV.B. Total input tax deductible (104)` above -->
|
||||
<record id="account_tax_report_line_3c_total_input_tax_deductible" model="account.tax.report.line">
|
||||
<field name="name">102 - Total input tax deductible</field>
|
||||
<field name="sequence">3</field>
|
||||
|
||||
@@ -173,10 +173,13 @@ ORDER BY pid, cid, notif
|
||||
query_pid = """
|
||||
SELECT partner.id as pid, NULL::int AS cid,
|
||||
partner.active as active, partner.partner_share as pshare, NULL as ctype,
|
||||
users.notification_type AS notif, NULL AS groups
|
||||
users.notification_type AS notif,
|
||||
array_agg(groups_rel.gid) FILTER (WHERE groups_rel.gid IS NOT NULL) AS groups
|
||||
FROM res_partner partner
|
||||
LEFT JOIN res_users users ON users.partner_id = partner.id AND users.active
|
||||
WHERE partner.id IN %s"""
|
||||
LEFT JOIN res_users users ON users.partner_id = partner.id AND users.active
|
||||
LEFT JOIN res_groups_users_rel groups_rel ON groups_rel.uid = users.id
|
||||
WHERE partner.id IN %s
|
||||
GROUP BY partner.id, users.notification_type"""
|
||||
params.append(tuple(pids))
|
||||
if cids:
|
||||
query_cid = """
|
||||
|
||||
@@ -1459,6 +1459,7 @@ class MrpProduction(models.Model):
|
||||
new_moves_vals.append(move_vals[0])
|
||||
new_moves = self.env['stock.move'].create(new_moves_vals)
|
||||
backorders |= backorder_mo
|
||||
first_wo = self.env['mrp.workorder']
|
||||
for old_wo, wo in zip(production.workorder_ids, backorder_mo.workorder_ids):
|
||||
wo.qty_produced = max(old_wo.qty_produced - old_wo.qty_producing, 0)
|
||||
if wo.product_tracking == 'serial':
|
||||
@@ -1467,6 +1468,9 @@ class MrpProduction(models.Model):
|
||||
wo.qty_producing = wo.qty_remaining
|
||||
if wo.qty_producing == 0:
|
||||
wo.action_cancel()
|
||||
if not first_wo and wo.state != 'cancel':
|
||||
first_wo = wo
|
||||
first_wo.state = 'ready'
|
||||
|
||||
# We need to adapt `duration_expected` on both the original workorders and their
|
||||
# backordered workorders. To do that, we use the original `duration_expected` and the
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
from flectra import api, fields, models, _
|
||||
from flectra.exceptions import AccessError, UserError
|
||||
from flectra.tools import float_compare
|
||||
from flectra.tools import float_compare, float_round
|
||||
from flectra.osv import expression
|
||||
|
||||
|
||||
@@ -198,7 +198,7 @@ class MrpUnbuild(models.Model):
|
||||
})
|
||||
needed_quantity -= taken_quantity
|
||||
else:
|
||||
move.quantity_done = move.product_uom_qty
|
||||
move.quantity_done = float_round(move.product_uom_qty, precision_rounding=move.product_uom.rounding)
|
||||
|
||||
finished_moves._action_done()
|
||||
consume_moves._action_done()
|
||||
|
||||
@@ -476,8 +476,12 @@ class MrpWorkorder(models.Model):
|
||||
return self.production_id.move_finished_ids.filtered(lambda x: (x.product_id.id != self.production_id.product_id.id) and (x.state not in ('done', 'cancel')))
|
||||
|
||||
def _start_nextworkorder(self):
|
||||
if self.state == 'done' and self.next_work_order_id.state == 'pending':
|
||||
self.next_work_order_id.state = 'ready'
|
||||
if self.state == 'done':
|
||||
next_order = self.next_work_order_id
|
||||
while next_order and next_order.state == 'cancel':
|
||||
next_order = next_order.next_work_order_id
|
||||
if next_order.state == 'pending':
|
||||
next_order.state = 'ready'
|
||||
|
||||
@api.model
|
||||
def gantt_unavailability(self, start_date, end_date, scale, group_bys=None, rows=None):
|
||||
|
||||
@@ -597,3 +597,36 @@ class TestUnbuild(TestMrpCommon):
|
||||
self.assertEqual(StockQuant._get_available_quantity(finshed_product, self.stock_location), 0, 'Table should not be available in stock')
|
||||
self.assertEqual(StockQuant._get_available_quantity(component1, self.stock_location), 1, 'Table head should be available in stock as the picking is transferred')
|
||||
self.assertEqual(StockQuant._get_available_quantity(component2, self.stock_location), 1, 'Table stand should be available in stock as the picking is transferred')
|
||||
|
||||
def test_unbuild_decimal_qty(self):
|
||||
"""
|
||||
Use case:
|
||||
- decimal accuracy of Product UoM > decimal accuracy of Units
|
||||
- unbuild a product with a decimal quantity of component
|
||||
"""
|
||||
self.env['decimal.precision'].search([('name', '=', 'Product Unit of Measure')]).digits = 4
|
||||
self.uom_unit.rounding = 0.001
|
||||
|
||||
self.bom_1.product_qty = 3
|
||||
self.bom_1.bom_line_ids.product_qty = 5
|
||||
self.env['stock.quant']._update_available_quantity(self.product_2, self.stock_location, 3)
|
||||
|
||||
mo_form = Form(self.env['mrp.production'])
|
||||
mo_form.product_id = self.bom_1.product_id
|
||||
mo_form.bom_id = self.bom_1
|
||||
mo = mo_form.save()
|
||||
mo.action_confirm()
|
||||
mo.action_assign()
|
||||
|
||||
mo_form = Form(mo)
|
||||
mo_form.qty_producing = 3
|
||||
mo_form.save()
|
||||
mo.button_mark_done()
|
||||
|
||||
uo_form = Form(self.env['mrp.unbuild'])
|
||||
uo_form.mo_id = mo
|
||||
# Unbuilding one product means a decimal quantity equal to 1 / 3 * 5 for each component
|
||||
uo_form.product_qty = 1
|
||||
uo = uo_form.save()
|
||||
uo.action_unbuild()
|
||||
self.assertEqual(uo.state, 'done')
|
||||
|
||||
@@ -1813,7 +1813,8 @@ exports.Orderline = Backbone.Model.extend({
|
||||
}
|
||||
|
||||
// just like in sale.order changing the quantity will recompute the unit price
|
||||
if(! keep_price && ! this.price_manually_set){
|
||||
if (!keep_price && !this.price_manually_set && !(
|
||||
this.pos.config.product_configurator && _.some(this.product.attribute_line_ids, (id) => id in this.pos.attributes_by_ptal_id))){
|
||||
this.set_unit_price(this.product.get_price(this.order.pricelist, this.get_quantity(), this.get_price_extra()));
|
||||
this.order.fix_tax_included_price(this);
|
||||
}
|
||||
|
||||
@@ -300,13 +300,6 @@ models.Order = models.Order.extend({
|
||||
init_from_JSON: function(json){
|
||||
_super_order.init_from_JSON.apply(this,arguments);
|
||||
this.saved_resume = json.multiprint_resume && JSON.parse(json.multiprint_resume);
|
||||
// Since the order summary structure has changed, we need to remove the old lines
|
||||
// Otherwise, this fix deployment will lead to some errors
|
||||
for (var key in this.saved_resume) {
|
||||
if (this.saved_resume[key].pid == undefined) {
|
||||
delete this.saved_resume[key];
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -718,7 +718,7 @@ class ProductPackaging(models.Model):
|
||||
name = fields.Char('Package Type', required=True)
|
||||
sequence = fields.Integer('Sequence', default=1, help="The first in the sequence is the default one.")
|
||||
product_id = fields.Many2one('product.product', string='Product', check_company=True)
|
||||
qty = fields.Float('Contained Quantity', help="Quantity of products contained in the packaging.")
|
||||
qty = fields.Float('Contained Quantity', digits='Product Unit of Measure', help="Quantity of products contained in the packaging.")
|
||||
barcode = fields.Char('Barcode', copy=False, help="Barcode used for packaging identification. Scan this packaging barcode from a transfer in the Barcode app to move all the contained units")
|
||||
product_uom_id = fields.Many2one('uom.uom', related='product_id.uom_id', readonly=True)
|
||||
company_id = fields.Many2one('res.company', 'Company', index=True)
|
||||
|
||||
@@ -518,7 +518,9 @@ class ProductTemplateAttributeValue(models.Model):
|
||||
|
||||
def _get_combination_name(self):
|
||||
"""Exclude values from single value lines or from no_variant attributes."""
|
||||
return ", ".join([ptav.name for ptav in self._without_no_variant_attributes()._filter_single_value_lines()])
|
||||
ptavs = self._without_no_variant_attributes().with_prefetch(self._prefetch_ids)
|
||||
ptavs = ptavs._filter_single_value_lines().with_prefetch(self._prefetch_ids)
|
||||
return ", ".join([ptav.name for ptav in ptavs])
|
||||
|
||||
def _filter_single_value_lines(self):
|
||||
"""Return `self` with values from single value lines filtered out
|
||||
|
||||
@@ -5,8 +5,7 @@ from itertools import chain
|
||||
|
||||
from flectra import api, fields, models, tools, _
|
||||
from flectra.exceptions import UserError, ValidationError
|
||||
from flectra.tools import float_repr
|
||||
from flectra.tools.misc import get_lang
|
||||
from flectra.tools.misc import formatLang, get_lang
|
||||
|
||||
|
||||
class Pricelist(models.Model):
|
||||
@@ -486,23 +485,7 @@ class PricelistItem(models.Model):
|
||||
item.name = _("All Products")
|
||||
|
||||
if item.compute_price == 'fixed':
|
||||
decimal_places = self.env['decimal.precision'].precision_get('Product Price')
|
||||
if item.currency_id.position == 'after':
|
||||
item.price = "%s %s" % (
|
||||
float_repr(
|
||||
item.fixed_price,
|
||||
decimal_places,
|
||||
),
|
||||
item.currency_id.symbol,
|
||||
)
|
||||
else:
|
||||
item.price = "%s %s" % (
|
||||
item.currency_id.symbol,
|
||||
float_repr(
|
||||
item.fixed_price,
|
||||
decimal_places,
|
||||
),
|
||||
)
|
||||
item.price = formatLang(item.env, item.fixed_price, monetary=True, dp="Product Price", currency_obj=item.currency_id)
|
||||
elif item.compute_price == 'percentage':
|
||||
item.price = _("%s %% discount", item.percent_price)
|
||||
else:
|
||||
|
||||
@@ -12,6 +12,7 @@ class Partner(models.Model):
|
||||
property_product_pricelist = fields.Many2one(
|
||||
'product.pricelist', 'Pricelist', compute='_compute_product_pricelist',
|
||||
inverse="_inverse_product_pricelist", company_dependent=False,
|
||||
domain=lambda self: [('company_id', 'in', (self.env.company.id, False))],
|
||||
help="This pricelist will be used, instead of the default one, for sales to the current partner")
|
||||
|
||||
@api.depends('country_id')
|
||||
|
||||
@@ -1006,7 +1006,7 @@ class Task(models.Model):
|
||||
if partner_ids:
|
||||
new_allowed_users = self.env['res.partner'].browse(partner_ids).user_ids.filtered('share')
|
||||
tasks = self.filtered(lambda task: task.project_id.privacy_visibility == 'portal')
|
||||
tasks.sudo().write({'allowed_user_ids': [(4, user.id) for user in new_allowed_users]})
|
||||
tasks.sudo().allowed_user_ids |= new_allowed_users
|
||||
return res
|
||||
|
||||
# ----------------------------------------
|
||||
|
||||
@@ -95,6 +95,23 @@ class TestProjectFlow(TestProjectCommon):
|
||||
self.assertEqual(task.project_id.id, self.project_goats.id, 'project_task: incorrect project')
|
||||
self.assertEqual(task.stage_id.sequence, 1, "project_task: should have a stage with sequence=1")
|
||||
|
||||
@mute_logger('flectra.addons.mail.mail_thread')
|
||||
def test_portal_visibility(self):
|
||||
# change portal visibility to the project and add Portal user as invited
|
||||
self.project_goats.write({
|
||||
'privacy_visibility': 'portal',
|
||||
'allowed_portal_user_ids': [self.user_portal.id],
|
||||
})
|
||||
|
||||
# Do: incoming mail from an internal user on an alias creates a new task 'Rabbits'
|
||||
task = self.format_and_process(
|
||||
EMAIL_TPL, to='project+goats@mydomain.com, valid.lelitre@agrolait.com', cc='valid.other@gmail.com',
|
||||
email_from='%s' % self.user_projectmanager.email,
|
||||
subject='Rabbits', msg_id='<1198923581.41972151344608186760.JavaMail@agrolait.com>',
|
||||
target_model='project.task')
|
||||
|
||||
self.assertIn(self.user_portal, task.allowed_user_ids, 'Task should be visible for Portal User')
|
||||
|
||||
def test_subtask_process(self):
|
||||
"""
|
||||
Check subtask mecanism and change it from project.
|
||||
|
||||
@@ -438,9 +438,9 @@ class StockMoveLine(models.Model):
|
||||
precision_digits = self.env['decimal.precision'].precision_get('Product Unit of Measure')
|
||||
qty_done = float_round(ml.qty_done, precision_digits=precision_digits, rounding_method='HALF-UP')
|
||||
if float_compare(uom_qty, qty_done, precision_digits=precision_digits) != 0:
|
||||
raise UserError(_('The quantity done for the product "%s" doesn\'t respect the rounding precision \
|
||||
defined on the unit of measure "%s". Please change the quantity done or the \
|
||||
rounding precision of your unit of measure.') % (ml.product_id.display_name, ml.product_uom_id.name))
|
||||
raise UserError(_('The quantity done for the product "%s" doesn\'t respect the rounding precision '
|
||||
'defined on the unit of measure "%s". Please change the quantity done or the '
|
||||
'rounding precision of your unit of measure.') % (ml.product_id.display_name, ml.product_uom_id.name))
|
||||
|
||||
qty_done_float_compared = float_compare(ml.qty_done, 0, precision_rounding=ml.product_uom_id.rounding)
|
||||
if qty_done_float_compared > 0:
|
||||
|
||||
@@ -14,4 +14,7 @@
|
||||
.js_question-wrapper {
|
||||
page-break-inside: avoid;
|
||||
}
|
||||
html {
|
||||
height: unset;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ from flectra.addons.test_mail.tests.common import TestMailCommon
|
||||
from flectra.tests import tagged
|
||||
from flectra.tests import users
|
||||
from flectra.tools.misc import mute_logger
|
||||
from flectra.tests.common import users
|
||||
|
||||
|
||||
@tagged('mail_followers')
|
||||
@@ -189,6 +190,18 @@ class BaseFollowersTest(TestMailCommon):
|
||||
document._message_subscribe(partner_ids=(self.partner_portal | private_address).ids)
|
||||
self.assertEqual(document.message_follower_ids.partner_id, self.partner_portal | private_address)
|
||||
|
||||
@users('employee')
|
||||
def test_recipients_fetch_pids_only(self):
|
||||
""" Test that _get_recipient_data correctly fetch groups for additional pids
|
||||
"""
|
||||
users = self.user_admin + self.user_employee + self.user_portal
|
||||
recipient_data = self.env['mail.followers']._get_recipient_data(self.env['mail.thread'], False, False, pids=users.partner_id.ids)
|
||||
groups = {pid: set(groups) for pid, _, _, _, _, _, groups in recipient_data}
|
||||
|
||||
self.assertEqual(groups[self.user_admin.partner_id.id], set(self.user_admin.groups_id.ids), "User Admin groups are not correctly fetched")
|
||||
self.assertEqual(groups[self.user_employee.partner_id.id], set(self.user_employee.groups_id.ids), "User Employee groups are not correctly fetched")
|
||||
self.assertEqual(groups[self.user_portal.partner_id.id], set(self.user_portal.groups_id.ids), "User Portal groups are not correctly fetched")
|
||||
|
||||
|
||||
@tagged('mail_followers')
|
||||
class AdvancedFollowersTest(TestMailCommon):
|
||||
|
||||
@@ -605,6 +605,7 @@ $o-cw-filter-avatar-size: 20px;
|
||||
&.o_beside_avatar {
|
||||
@include size($o-cw-filter-avatar-size);
|
||||
border-radius: 2px;
|
||||
object-fit: cover;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,15 +13,30 @@ var ready = Promise.all([domReady, session.is_bound, ajax.loadXML()]);
|
||||
|
||||
tour.register('rte_translator', {
|
||||
test: true,
|
||||
url: '/fr_BE',
|
||||
url: '/',
|
||||
wait_for: ready,
|
||||
}, [{
|
||||
content : "click language dropdown",
|
||||
content: "click language dropdown",
|
||||
trigger: '.js_language_selector .dropdown-toggle',
|
||||
}, {
|
||||
content: "click on Add a language",
|
||||
trigger: 'a.o_add_language',
|
||||
}, {
|
||||
content: "select Parseltongue",
|
||||
trigger: 'select[name="lang"]',
|
||||
run: 'text "pa_GB"',
|
||||
}, {
|
||||
content: "load Parseltongue",
|
||||
trigger: '.modal-footer button:first',
|
||||
extra_trigger: '.modal select[name="lang"]:propValueContains(pa_GB)',
|
||||
}, {
|
||||
content : "click language dropdown (2)",
|
||||
trigger : '.js_language_selector .dropdown-toggle',
|
||||
timeout: 60000,
|
||||
}, {
|
||||
content: "go to english version",
|
||||
trigger: '.js_language_selector a[data-url_code="en"]',
|
||||
extra_trigger: 'html[lang*="fr"]',
|
||||
extra_trigger: 'html[lang*="pa-GB"]',
|
||||
}, {
|
||||
content: "Open new page menu",
|
||||
trigger: '#new-content-menu > a',
|
||||
@@ -56,12 +71,12 @@ tour.register('rte_translator', {
|
||||
trigger: 'button[data-action=save]',
|
||||
extra_trigger: '#wrap p:first b',
|
||||
}, {
|
||||
content : "click language dropdown",
|
||||
content : "click language dropdown (3)",
|
||||
trigger : '.js_language_selector .dropdown-toggle',
|
||||
extra_trigger: 'body:not(.o_wait_reload):not(:has(.note-editor)) a[data-action="edit"]',
|
||||
}, {
|
||||
content: "click on french version",
|
||||
trigger: '.js_language_selector a[data-url_code="fr_BE"]',
|
||||
content: "click on Parseltongue version",
|
||||
trigger: '.js_language_selector a[data-url_code="pa_GB"]',
|
||||
extra_trigger: 'html[lang*="en"]:not(:has(button[data-action=save]))',
|
||||
}, {
|
||||
content: "translate",
|
||||
@@ -76,7 +91,7 @@ tour.register('rte_translator', {
|
||||
content: "translate text",
|
||||
trigger: '#wrap p font:first',
|
||||
run: function (action_helper) {
|
||||
action_helper.text('translated french text');
|
||||
action_helper.text('translated Parseltongue text');
|
||||
Wysiwyg.setRange(this.$anchor.contents()[0], 22);
|
||||
this.$anchor.trigger($.Event( "keyup", {key: '_', keyCode: 95}));
|
||||
this.$anchor.trigger('input');
|
||||
@@ -94,22 +109,22 @@ tour.register('rte_translator', {
|
||||
}, {
|
||||
content: "click on input",
|
||||
trigger: '#wrap input:first',
|
||||
extra_trigger: '#wrap .o_dirty font:first:contains(translated french text)',
|
||||
extra_trigger: '#wrap .o_dirty font:first:contains(translated Parseltongue text)',
|
||||
run: 'click',
|
||||
}, {
|
||||
content: "translate placeholder",
|
||||
trigger: 'input:first',
|
||||
run: 'text test french placeholder',
|
||||
run: 'text test Parseltongue placeholder',
|
||||
}, {
|
||||
content: "close modal",
|
||||
trigger: '.modal-footer .btn-primary',
|
||||
extra_trigger: '.modal input:propValue(test french placeholder)',
|
||||
extra_trigger: '.modal input:propValue(test Parseltongue placeholder)',
|
||||
}, {
|
||||
content: "save translation",
|
||||
trigger: 'button[data-action=save]',
|
||||
}, {
|
||||
content: "check: content is translated",
|
||||
trigger: '#wrap p font:first:contains(translated french text)',
|
||||
trigger: '#wrap p font:first:contains(translated Parseltongue text)',
|
||||
extra_trigger: 'body:not(.o_wait_reload):not(:has(.note-editor)) a[data-action="edit_master"]',
|
||||
run: function () {}, // it's a check
|
||||
}, {
|
||||
@@ -119,13 +134,13 @@ tour.register('rte_translator', {
|
||||
|
||||
}, {
|
||||
content: "check: placeholder translation",
|
||||
trigger: 'input[placeholder="test french placeholder"]',
|
||||
trigger: 'input[placeholder="test Parseltongue placeholder"]',
|
||||
run: function () {}, // it's a check
|
||||
|
||||
}, {
|
||||
content: "open language selector",
|
||||
trigger: '.js_language_selector button:first',
|
||||
extra_trigger: 'html[lang*="fr"]:not(:has(#wrap p span))',
|
||||
extra_trigger: 'html[lang*="pa-GB"]:not(:has(#wrap p span))',
|
||||
}, {
|
||||
content: "return to english version",
|
||||
trigger: '.js_language_selector a[data-url_code="en"]',
|
||||
@@ -157,19 +172,19 @@ tour.register('rte_translator', {
|
||||
extra_trigger: '#wrap.o_dirty p u',
|
||||
|
||||
}, {
|
||||
content : "click language dropdown",
|
||||
content : "click language dropdown (4)",
|
||||
trigger : '.js_language_selector .dropdown-toggle',
|
||||
extra_trigger: 'body:not(.o_wait_reload):not(:has(.note-editor)) a[data-action="edit"]',
|
||||
}, {
|
||||
content: "return in french",
|
||||
trigger : 'html[lang="en-US"] .js_language_selector .js_change_lang[data-url_code="fr_BE"]',
|
||||
content: "return in Parseltongue",
|
||||
trigger : 'html[lang="en-US"] .js_language_selector .js_change_lang[data-url_code="pa_GB"]',
|
||||
}, {
|
||||
content: "check bis: content is translated",
|
||||
trigger: '#wrap p font:first:contains(translated french text)',
|
||||
extra_trigger: 'html[lang*="fr"] body:not(:has(button[data-action=save]))',
|
||||
trigger: '#wrap p font:first:contains(translated Parseltongue text)',
|
||||
extra_trigger: 'html[lang*="pa-GB"] body:not(:has(button[data-action=save]))',
|
||||
}, {
|
||||
content: "check bis: placeholder translation",
|
||||
trigger: 'input[placeholder="test french placeholder"]',
|
||||
trigger: 'input[placeholder="test Parseltongue placeholder"]',
|
||||
}, {
|
||||
content: "Open customize menu",
|
||||
trigger: "#customize-menu > .dropdown-toggle",
|
||||
|
||||
@@ -101,9 +101,12 @@ class TestUiHtmlEditor(flectra.tests.HttpCase):
|
||||
@flectra.tests.tagged('-at_install', 'post_install')
|
||||
class TestUiTranslate(flectra.tests.HttpCase):
|
||||
def test_admin_tour_rte_translator(self):
|
||||
fr_BE = self.env.ref('base.lang_fr_BE')
|
||||
fr_BE.active = True
|
||||
self.env.ref('website.default_website').language_ids |= fr_BE
|
||||
self.env['res.lang'].create({
|
||||
'name': 'Parseltongue',
|
||||
'code': 'pa_GB',
|
||||
'iso_code': 'pa_GB',
|
||||
'url_code': 'pa_GB',
|
||||
})
|
||||
self.start_tour("/", 'rte_translator', login='admin', timeout=120)
|
||||
|
||||
|
||||
|
||||
@@ -1807,8 +1807,7 @@
|
||||
<template id="language_selector_add_language">
|
||||
<a t-attf-class="o_add_language d-none #{dropdown and 'd-sm-block dropdown-item' or 'd-sm-inline-block list-inline-item'}"
|
||||
groups="website.group_website_publisher"
|
||||
t-attf-href="/web#action=base.action_view_base_language_install&website_id=#{website.id if website else ''}&url_return=#{url_return}">
|
||||
<t t-set="url_return" t-value="quote_plus(url_for('', '[lang]') + '?' + keep_query())"/>
|
||||
t-attf-href="/web#action=base.action_view_base_language_install&website_id=#{website.id if website else ''}&url_return=#{quote_plus(url_for('', '[lang]') + '?' + keep_query())}">
|
||||
<i class="fa fa-plus-circle"/>
|
||||
Add a language...
|
||||
</a>
|
||||
|
||||
@@ -91,7 +91,37 @@ flectra.define('website_form_editor.tour', function (require) {
|
||||
trigger: '#oe_snippets .oe_snippet:has(.s_website_form) .oe_snippet_thumbnail',
|
||||
run: 'drag_and_drop #wrap',
|
||||
}, {
|
||||
content: "Check dropped snippet and select it",
|
||||
content: "Select form by clicking on an input field",
|
||||
extra_trigger: '.s_website_form_field',
|
||||
trigger: 'section.s_website_form input',
|
||||
}, {
|
||||
content: "Verify that the form editor appeared",
|
||||
trigger: '.o_we_customize_panel .snippet-option-WebsiteFormEditor',
|
||||
run: () => null,
|
||||
}, {
|
||||
content: "Go back to blocks to unselect form",
|
||||
trigger: '.o_we_add_snippet_btn',
|
||||
}, {
|
||||
content: "Select form by clicking on a text area",
|
||||
extra_trigger: '.s_website_form_field',
|
||||
trigger: 'section.s_website_form textarea',
|
||||
}, {
|
||||
content: "Verify that the form editor appeared",
|
||||
trigger: '.o_we_customize_panel .snippet-option-WebsiteFormEditor',
|
||||
run: () => null,
|
||||
}, {
|
||||
content: "Rename the field label",
|
||||
trigger: 'we-input[data-set-label-text] input',
|
||||
run: "text Renamed",
|
||||
}, {
|
||||
content: "Leave the rename options",
|
||||
trigger: 'we-input[data-set-label-text] input',
|
||||
run: "text_blur",
|
||||
}, {
|
||||
content: "Go back to blocks to unselect form",
|
||||
trigger: '.o_we_add_snippet_btn',
|
||||
}, {
|
||||
content: "Select form itself (not a specific field)",
|
||||
extra_trigger: '.s_website_form_field',
|
||||
trigger: 'section.s_website_form',
|
||||
},
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
# Part of Odoo, Flectra. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from flectra import api, fields, models, _
|
||||
from flectra.exceptions import AccessError
|
||||
|
||||
|
||||
class MailChannel(models.Model):
|
||||
@@ -29,9 +30,9 @@ class MailChannel(models.Model):
|
||||
"""
|
||||
channel_infos = super(MailChannel, self).channel_info(extra_info)
|
||||
channel_infos_dict = dict((c['id'], c) for c in channel_infos)
|
||||
for channel in self:
|
||||
for channel in self.filtered('livechat_visitor_id'):
|
||||
visitor = channel.livechat_visitor_id
|
||||
if visitor:
|
||||
try:
|
||||
channel_infos_dict[channel.id]['visitor'] = {
|
||||
'name': visitor.display_name,
|
||||
'country_code': visitor.country_id.code.lower() if visitor.country_id else False,
|
||||
@@ -42,6 +43,8 @@ class MailChannel(models.Model):
|
||||
'lang': visitor.lang_id.name,
|
||||
'partner_id': visitor.partner_id.id,
|
||||
}
|
||||
except AccessError:
|
||||
pass
|
||||
return list(channel_infos_dict.values())
|
||||
|
||||
def _get_visitor_history(self, visitor):
|
||||
|
||||
@@ -9,12 +9,18 @@ class TestLivechatCommon(tests.TransactionCase):
|
||||
super(TestLivechatCommon, self).setUp()
|
||||
self.base_datetime = fields.Datetime.from_string("2019-11-11 21:30:00")
|
||||
|
||||
self.group_user = self.env.ref('base.group_user')
|
||||
self.group_livechat_user = self.env.ref('im_livechat.im_livechat_group_user')
|
||||
self.operator = self.env['res.users'].create({
|
||||
'name': 'Operator Michel',
|
||||
'login': 'operator',
|
||||
'email': 'operator@example.com',
|
||||
'password': "ideboulonate",
|
||||
'livechat_username': 'El Deboulonnator',
|
||||
'groups_id': [(6, 0, [
|
||||
self.group_user.id,
|
||||
self.group_livechat_user.id,
|
||||
])],
|
||||
})
|
||||
|
||||
self.livechat_channel = self.env['im_livechat.channel'].create({
|
||||
@@ -46,6 +52,7 @@ class TestLivechatCommon(tests.TransactionCase):
|
||||
|
||||
self.send_feedback_url = base_url + "/im_livechat/feedback"
|
||||
self.leave_session_url = base_url + "/im_livechat/visitor_leave_session"
|
||||
self.message_info_url = base_url + "/mail/init_messaging"
|
||||
|
||||
# override the get_available_users to return only Michel as available
|
||||
operators = self.operator
|
||||
|
||||
@@ -77,6 +77,25 @@ class TestLivechatBasicFlowHttpCase(tests.HttpCase, TestLivechatCommon):
|
||||
self.assertEqual(channel.message_ids[0].body, "<p>%s has left the conversation.</p>" % self.visitor.display_name)
|
||||
self.assertEqual(channel.livechat_active, False, "The livechat session must be inactive since visitor has left the conversation.")
|
||||
|
||||
def test_visitor_info_access_rights(self):
|
||||
channel = self._common_basic_flow()
|
||||
self.authenticate(self.operator.login, 'ideboulonate')
|
||||
|
||||
# Retrieve channels information, visitor info should be there
|
||||
res = self.opener.get(self.message_info_url, json={})
|
||||
self.assertEqual(res.status_code, 200)
|
||||
messages_info = res.json().get('result', {})
|
||||
livechat_info = messages_info['channel_slots']['channel_livechat']
|
||||
self.assertIn('visitor', livechat_info[0])
|
||||
|
||||
# Remove access to visitors and try again, visitors info shouldn't be included
|
||||
self.operator.groups_id -= self.group_livechat_user
|
||||
res = self.opener.get(self.message_info_url, json={})
|
||||
self.assertEqual(res.status_code, 200)
|
||||
messages_info = res.json().get('result', {})
|
||||
livechat_info = messages_info['channel_slots']['channel_livechat']
|
||||
self.assertNotIn('visitor', livechat_info[0])
|
||||
|
||||
def _common_basic_flow(self):
|
||||
# Open a new live chat
|
||||
res = self.opener.post(url=self.open_chat_url, json=self.open_chat_params)
|
||||
|
||||
@@ -25,9 +25,10 @@ class ProductTemplate(models.Model):
|
||||
'view_mode': 'kanban,form',
|
||||
'context': "{'default_res_model': '%s','default_res_id': %d, 'default_product_downloadable': True}" % (self._name, self.id),
|
||||
'help': """
|
||||
<p class="o_view_nocontent_smiling_face">Add attachments for this digital product</p>
|
||||
<p>The attached files are the ones that will be purchased and sent to the customer.</p>
|
||||
""",
|
||||
<p class="o_view_nocontent_smiling_face">%s</p>
|
||||
<p>%s</p>
|
||||
""" % (_("Add attachments for this digital product"),
|
||||
_("The attached files are the ones that will be purchased and sent to the customer.")),
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +56,8 @@ class Product(models.Model):
|
||||
'view_mode': 'kanban,form',
|
||||
'context': "{'default_res_model': '%s','default_res_id': %d, 'default_product_downloadable': True}" % (self._name, self.id),
|
||||
'help': """
|
||||
<p class="o_view_nocontent_smiling_face">Add attachments for this digital product</p>
|
||||
<p>The attached files are the ones that will be purchased and sent to the customer.</p>
|
||||
""",
|
||||
<p class="o_view_nocontent_smiling_face">%s</p>
|
||||
<p>%s</p>
|
||||
""" % (_("Add attachments for this digital product"),
|
||||
_("The attached files are the ones that will be purchased and sent to the customer.")),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user