mirror of
https://gitlab.com/flectra-hq/flectra.git
synced 2025-02-25 18:55:21 -06:00
[PATCH] Upstream patch - 22012023
This commit is contained in:
@@ -160,7 +160,7 @@ def update_taxes_from_templates(cr, chart_template_xmlid):
|
||||
|
||||
env = api.Environment(cr, SUPERUSER_ID, {})
|
||||
chart_template_id = env['ir.model.data'].xmlid_to_res_id(chart_template_xmlid)
|
||||
companies = env['res.company'].search([('chart_template_id', '=', chart_template_id)])
|
||||
companies = env['res.company'].search(['|', ('chart_template_id', '=', chart_template_id), ('chart_template_id', 'child_of', chart_template_id)])
|
||||
outdated_taxes = []
|
||||
new_taxes_template = []
|
||||
for company in companies:
|
||||
|
||||
@@ -791,6 +791,11 @@ class Meeting(models.Model):
|
||||
|
||||
return events.with_context(is_calendar_event_new=False)
|
||||
|
||||
def _compute_field_value(self, field):
|
||||
if field.compute_sudo:
|
||||
return super(Meeting, self.with_context(prefetch_fields=False))._compute_field_value(field)
|
||||
return super()._compute_field_value(field)
|
||||
|
||||
def _read(self, fields):
|
||||
if self.env.is_system():
|
||||
super()._read(fields)
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
{
|
||||
"name" : "Spain - Accounting (PGCE 2008)",
|
||||
"version" : "5.0",
|
||||
"version" : "5.1",
|
||||
"author" : "Spanish Localization Team",
|
||||
'category': 'Accounting/Localizations/Account Charts',
|
||||
"description": """
|
||||
|
||||
@@ -6,9 +6,15 @@
|
||||
<record id="tax_group_iva_0" model="account.tax.group">
|
||||
<field name="name">IVA 0%</field>
|
||||
</record>
|
||||
<record id="tax_group_recargo_0" model="account.tax.group">
|
||||
<field name="name">Recargo de Equivalencia 0%</field>
|
||||
</record>
|
||||
<record id="tax_group_recargo_0-5" model="account.tax.group">
|
||||
<field name="name">Recargo de Equivalencia 0.5%</field>
|
||||
</record>
|
||||
<record id="tax_group_recargo_0-62" model="account.tax.group">
|
||||
<field name="name">Recargo de Equivalencia 0.62%</field>
|
||||
</record>
|
||||
<record id="tax_group_retenciones_1" model="account.tax.group">
|
||||
<field name="name">Retenciones 1%</field>
|
||||
</record>
|
||||
|
||||
@@ -164,6 +164,16 @@
|
||||
|
||||
<!-- Extracomunitarios -->
|
||||
|
||||
<record id="fptt_extra_0b" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fp_extra"/>
|
||||
<field name="tax_src_id" ref="account_tax_template_p_iva0_s_bc"/>
|
||||
<field name="tax_dest_id" ref="account_tax_template_p_iva0_ibc"/>
|
||||
</record>
|
||||
<record id="fptt_extra_0s" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fp_extra"/>
|
||||
<field name="tax_src_id" ref="account_tax_template_p_iva0_s_sc"/>
|
||||
<field name="tax_dest_id" ref="account_tax_template_p_iva0_isc"/>
|
||||
</record>
|
||||
<record id="fptt_extra_4b" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fp_extra"/>
|
||||
<field name="tax_src_id" ref="account_tax_template_p_iva4_bc"/>
|
||||
@@ -180,6 +190,16 @@
|
||||
<field name="tax_src_id" ref="account_tax_template_p_iva4_bi"/>
|
||||
<field name="tax_dest_id" ref="account_tax_template_p_iva4_ibi"/>
|
||||
</record>
|
||||
<record id="fptt_extra_5b" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fp_extra"/>
|
||||
<field name="tax_src_id" ref="account_tax_template_p_iva5_bc"/>
|
||||
<field name="tax_dest_id" ref="account_tax_template_p_iva5_ibc"/>
|
||||
</record>
|
||||
<record id="fptt_extra_5s" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fp_extra"/>
|
||||
<field name="tax_src_id" ref="account_tax_template_p_iva5_sc"/>
|
||||
<field name="tax_dest_id" ref="account_tax_template_p_iva5_isc"/>
|
||||
</record>
|
||||
<record id="fptt_extra_10b" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fp_extra"/>
|
||||
<field name="tax_src_id" ref="account_tax_template_p_iva10_bc"/>
|
||||
@@ -212,6 +232,18 @@
|
||||
<field name="tax_src_id" ref="account_tax_template_p_iva21_bi"/>
|
||||
<field name="tax_dest_id" ref="account_tax_template_p_iva21_ibi"/>
|
||||
</record>
|
||||
<record id="fptt_extra_ventas_0b"
|
||||
model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fp_extra"/>
|
||||
<field name="tax_src_id" ref="account_tax_template_s_iva0b"/>
|
||||
<field name="tax_dest_id" ref="account_tax_template_s_iva0_e"/>
|
||||
</record>
|
||||
<record id="fptt_extra_ventas_0s"
|
||||
model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fp_extra"/>
|
||||
<field name="tax_src_id" ref="account_tax_template_s_iva0s"/>
|
||||
<field name="tax_dest_id" ref="account_tax_template_s_iva_e"/>
|
||||
</record>
|
||||
<record id="fptt_extra_ventas_4b"
|
||||
model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fp_extra"/>
|
||||
@@ -224,6 +256,18 @@
|
||||
<field name="tax_src_id" ref="account_tax_template_s_iva4s"/>
|
||||
<field name="tax_dest_id" ref="account_tax_template_s_iva_e"/>
|
||||
</record>
|
||||
<record id="fptt_extra_ventas_5b"
|
||||
model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fp_extra"/>
|
||||
<field name="tax_src_id" ref="account_tax_template_s_iva5b"/>
|
||||
<field name="tax_dest_id" ref="account_tax_template_s_iva0_e"/>
|
||||
</record>
|
||||
<record id="fptt_extra_ventas_5s"
|
||||
model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fp_extra"/>
|
||||
<field name="tax_src_id" ref="account_tax_template_s_iva5s"/>
|
||||
<field name="tax_dest_id" ref="account_tax_template_s_iva_e"/>
|
||||
</record>
|
||||
<record id="fptt_extra_ventas_10b"
|
||||
model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fp_extra"/>
|
||||
@@ -257,6 +301,16 @@
|
||||
|
||||
<!-- Intracomunitarios -->
|
||||
|
||||
<record id="fptt_intra_0b" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fp_intra"/>
|
||||
<field name="tax_src_id" ref="account_tax_template_p_iva0_s_bc"/>
|
||||
<field name="tax_dest_id" ref="account_tax_template_p_iva0_ic_bc"/>
|
||||
</record>
|
||||
<record id="fptt_intra_0s" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fp_intra"/>
|
||||
<field name="tax_src_id" ref="account_tax_template_p_iva0_s_sc"/>
|
||||
<field name="tax_dest_id" ref="account_tax_template_p_iva0_ic_sc"/>
|
||||
</record>
|
||||
<record id="fptt_intra_4b" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fp_intra"/>
|
||||
<field name="tax_src_id" ref="account_tax_template_p_iva4_bc"/>
|
||||
@@ -273,6 +327,16 @@
|
||||
<field name="tax_src_id" ref="account_tax_template_p_iva4_bi"/>
|
||||
<field name="tax_dest_id" ref="account_tax_template_p_iva4_ic_bi"/>
|
||||
</record>
|
||||
<record id="fptt_intra_5b" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fp_intra"/>
|
||||
<field name="tax_src_id" ref="account_tax_template_p_iva5_bc"/>
|
||||
<field name="tax_dest_id" ref="account_tax_template_p_iva5_ic_bc"/>
|
||||
</record>
|
||||
<record id="fptt_intra_5s" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fp_intra"/>
|
||||
<field name="tax_src_id" ref="account_tax_template_p_iva5_sc"/>
|
||||
<field name="tax_dest_id" ref="account_tax_template_p_iva5_ic_sc"/>
|
||||
</record>
|
||||
<record id="fptt_intra_10b" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fp_intra"/>
|
||||
<field name="tax_src_id" ref="account_tax_template_p_iva10_bc"/>
|
||||
@@ -305,6 +369,18 @@
|
||||
<field name="tax_src_id" ref="account_tax_template_p_iva21_bi"/>
|
||||
<field name="tax_dest_id" ref="account_tax_template_p_iva21_ic_bi"/>
|
||||
</record>
|
||||
<record id="fptt_intra_ventas_0b"
|
||||
model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fp_intra"/>
|
||||
<field name="tax_src_id" ref="account_tax_template_s_iva0b"/>
|
||||
<field name="tax_dest_id" ref="account_tax_template_s_iva0_ic"/>
|
||||
</record>
|
||||
<record id="fptt_intra_ventas_0s"
|
||||
model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fp_intra"/>
|
||||
<field name="tax_src_id" ref="account_tax_template_s_iva0s"/>
|
||||
<field name="tax_dest_id" ref="account_tax_template_s_iva0_sp_i"/>
|
||||
</record>
|
||||
<record id="fptt_intra_ventas_4b"
|
||||
model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fp_intra"/>
|
||||
@@ -317,6 +393,18 @@
|
||||
<field name="tax_src_id" ref="account_tax_template_s_iva4s"/>
|
||||
<field name="tax_dest_id" ref="account_tax_template_s_iva0_sp_i"/>
|
||||
</record>
|
||||
<record id="fptt_intra_ventas_5b"
|
||||
model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fp_intra"/>
|
||||
<field name="tax_src_id" ref="account_tax_template_s_iva5b"/>
|
||||
<field name="tax_dest_id" ref="account_tax_template_s_iva0_ic"/>
|
||||
</record>
|
||||
<record id="fptt_intra_ventas_5s"
|
||||
model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fp_intra"/>
|
||||
<field name="tax_src_id" ref="account_tax_template_s_iva5s"/>
|
||||
<field name="tax_dest_id" ref="account_tax_template_s_iva0_sp_i"/>
|
||||
</record>
|
||||
<record id="fptt_intra_ventas_10b"
|
||||
model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fp_intra"/>
|
||||
@@ -443,6 +531,28 @@
|
||||
|
||||
<!-- Recargo de equivalencia -->
|
||||
|
||||
<record id="fptt_recargo_0b" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fp_recargo"/>
|
||||
<field name="tax_src_id" ref="account_tax_template_s_iva0b"/>
|
||||
<field name="tax_dest_id" ref="account_tax_template_s_iva0b"/>
|
||||
</record>
|
||||
<record id="fptt_recargo_0b_2"
|
||||
model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fp_recargo"/>
|
||||
<field name="tax_src_id" ref="account_tax_template_s_iva0b"/>
|
||||
<field name="tax_dest_id" ref="account_tax_template_s_req0"/>
|
||||
</record>
|
||||
<record id="fptt_recargo_0s" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fp_recargo"/>
|
||||
<field name="tax_src_id" ref="account_tax_template_s_iva0s"/>
|
||||
<field name="tax_dest_id" ref="account_tax_template_s_iva0s"/>
|
||||
</record>
|
||||
<record id="fptt_recargo_0s_2"
|
||||
model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fp_recargo"/>
|
||||
<field name="tax_src_id" ref="account_tax_template_s_iva0s"/>
|
||||
<field name="tax_dest_id" ref="account_tax_template_s_req0"/>
|
||||
</record>
|
||||
<record id="fptt_recargo_4b" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fp_recargo"/>
|
||||
<field name="tax_src_id" ref="account_tax_template_s_iva4b"/>
|
||||
@@ -465,6 +575,28 @@
|
||||
<field name="tax_src_id" ref="account_tax_template_s_iva4s"/>
|
||||
<field name="tax_dest_id" ref="account_tax_template_s_req05"/>
|
||||
</record>
|
||||
<record id="fptt_recargo_5b" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fp_recargo"/>
|
||||
<field name="tax_src_id" ref="account_tax_template_s_iva5b"/>
|
||||
<field name="tax_dest_id" ref="account_tax_template_s_iva5b"/>
|
||||
</record>
|
||||
<record id="fptt_recargo_5b_2"
|
||||
model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fp_recargo"/>
|
||||
<field name="tax_src_id" ref="account_tax_template_s_iva5b"/>
|
||||
<field name="tax_dest_id" ref="account_tax_template_s_req062"/>
|
||||
</record>
|
||||
<record id="fptt_recargo_5s" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fp_recargo"/>
|
||||
<field name="tax_src_id" ref="account_tax_template_s_iva5s"/>
|
||||
<field name="tax_dest_id" ref="account_tax_template_s_iva5s"/>
|
||||
</record>
|
||||
<record id="fptt_recargo_5s_2"
|
||||
model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fp_recargo"/>
|
||||
<field name="tax_src_id" ref="account_tax_template_s_iva5s"/>
|
||||
<field name="tax_dest_id" ref="account_tax_template_s_req062"/>
|
||||
</record>
|
||||
<record id="fptt_recargo_10b" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fp_recargo"/>
|
||||
<field name="tax_src_id" ref="account_tax_template_s_iva10b"/>
|
||||
@@ -521,6 +653,30 @@
|
||||
<field name="tax_src_id" ref="account_tax_template_s_iva21isp"/>
|
||||
<field name="tax_dest_id" ref="account_tax_template_s_req52"/>
|
||||
</record>
|
||||
<record id="fptt_recargo_buy_0b"
|
||||
model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fp_recargo"/>
|
||||
<field name="tax_src_id" ref="account_tax_template_p_iva0_bc"/>
|
||||
<field name="tax_dest_id" ref="account_tax_template_p_iva0_bc"/>
|
||||
</record>
|
||||
<record id="fptt_recargo_buy_0b_2"
|
||||
model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fp_recargo"/>
|
||||
<field name="tax_src_id" ref="account_tax_template_p_iva0_bc"/>
|
||||
<field name="tax_dest_id" ref="account_tax_template_p_req0"/>
|
||||
</record>
|
||||
<record id="fptt_recargo_buy_0s"
|
||||
model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fp_recargo"/>
|
||||
<field name="tax_src_id" ref="account_tax_template_p_iva0_s_sc"/>
|
||||
<field name="tax_dest_id" ref="account_tax_template_p_iva0_s_sc"/>
|
||||
</record>
|
||||
<record id="fptt_recargo_buy_0s_2"
|
||||
model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fp_recargo"/>
|
||||
<field name="tax_src_id" ref="account_tax_template_p_iva0_s_sc"/>
|
||||
<field name="tax_dest_id" ref="account_tax_template_p_req0"/>
|
||||
</record>
|
||||
<record id="fptt_recargo_buy_4b"
|
||||
model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fp_recargo"/>
|
||||
@@ -557,6 +713,30 @@
|
||||
<field name="tax_src_id" ref="account_tax_template_p_iva4_bi"/>
|
||||
<field name="tax_dest_id" ref="account_tax_template_p_req05"/>
|
||||
</record>
|
||||
<record id="fptt_recargo_buy_5b"
|
||||
model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fp_recargo"/>
|
||||
<field name="tax_src_id" ref="account_tax_template_p_iva5_bc"/>
|
||||
<field name="tax_dest_id" ref="account_tax_template_p_iva5_bc"/>
|
||||
</record>
|
||||
<record id="fptt_recargo_buy_5b_2"
|
||||
model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fp_recargo"/>
|
||||
<field name="tax_src_id" ref="account_tax_template_p_iva5_bc"/>
|
||||
<field name="tax_dest_id" ref="account_tax_template_p_req062"/>
|
||||
</record>
|
||||
<record id="fptt_recargo_buy_5s"
|
||||
model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fp_recargo"/>
|
||||
<field name="tax_src_id" ref="account_tax_template_p_iva5_sc"/>
|
||||
<field name="tax_dest_id" ref="account_tax_template_p_iva5_sc"/>
|
||||
</record>
|
||||
<record id="fptt_recargo_buy_5s_2"
|
||||
model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fp_recargo"/>
|
||||
<field name="tax_src_id" ref="account_tax_template_p_iva5_sc"/>
|
||||
<field name="tax_dest_id" ref="account_tax_template_p_req062"/>
|
||||
</record>
|
||||
<record id="fptt_recargo_buy_10b"
|
||||
model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fp_recargo"/>
|
||||
|
||||
@@ -65,6 +65,16 @@
|
||||
<field name="country_id" ref="base.es"/>
|
||||
</record>
|
||||
|
||||
<record id="mod_303_150" model="account.account.tag">
|
||||
<field name="name">mod303[150]</field>
|
||||
<field name="applicability">taxes</field>
|
||||
<field name="country_id" ref="base.es"/>
|
||||
</record>
|
||||
<record id="mod_303_152" model="account.account.tag">
|
||||
<field name="name">mod303[152]</field>
|
||||
<field name="applicability">taxes</field>
|
||||
<field name="country_id" ref="base.es"/>
|
||||
</record>
|
||||
<record id="mod_303_01" model="account.account.tag">
|
||||
<field name="name">mod303[01]</field>
|
||||
<field name="applicability">taxes</field>
|
||||
@@ -75,6 +85,16 @@
|
||||
<field name="applicability">taxes</field>
|
||||
<field name="country_id" ref="base.es"/>
|
||||
</record>
|
||||
<record id="mod_303_153" model="account.account.tag">
|
||||
<field name="name">mod303[153]</field>
|
||||
<field name="applicability">taxes</field>
|
||||
<field name="country_id" ref="base.es"/>
|
||||
</record>
|
||||
<record id="mod_303_155" model="account.account.tag">
|
||||
<field name="name">mod303[155]</field>
|
||||
<field name="applicability">taxes</field>
|
||||
<field name="country_id" ref="base.es"/>
|
||||
</record>
|
||||
<record id="mod_303_04" model="account.account.tag">
|
||||
<field name="name">mod303[04]</field>
|
||||
<field name="applicability">taxes</field>
|
||||
@@ -130,6 +150,16 @@
|
||||
<field name="applicability">taxes</field>
|
||||
<field name="country_id" ref="base.es"/>
|
||||
</record>
|
||||
<record id="mod_303_156" model="account.account.tag">
|
||||
<field name="name">mod303[156]</field>
|
||||
<field name="applicability">taxes</field>
|
||||
<field name="country_id" ref="base.es"/>
|
||||
</record>
|
||||
<record id="mod_303_158" model="account.account.tag">
|
||||
<field name="name">mod303[158]</field>
|
||||
<field name="applicability">taxes</field>
|
||||
<field name="country_id" ref="base.es"/>
|
||||
</record>
|
||||
<record id="mod_303_16" model="account.account.tag">
|
||||
<field name="name">mod303[16]</field>
|
||||
<field name="applicability">taxes</field>
|
||||
@@ -1106,6 +1136,170 @@
|
||||
}),
|
||||
]"/>
|
||||
</record>
|
||||
<record id="account_tax_template_p_iva5_ic_bc" model="account.tax.template">
|
||||
<field name="amount" eval="5"/>
|
||||
<field name="chart_template_id" ref="l10n_es.account_chart_template_common"/>
|
||||
<field name="amount_type">percent</field>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
<field name="name">IVA 5% Adquisición Intracomunitario. Bienes corrientes</field>
|
||||
<field name="tax_group_id" ref="tax_group_iva_5"/>
|
||||
<field name="invoice_repartition_line_ids" eval="[(5, 0, 0),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
'tag_ids': [ref('mod_303_36'), ref('mod_303_10')],
|
||||
}),
|
||||
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
'tag_ids': [ref('mod_303_37')],
|
||||
'account_id': ref('l10n_es.account_common_472'),
|
||||
}),
|
||||
|
||||
(0,0, {
|
||||
'factor_percent': -100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('l10n_es.account_common_477'),
|
||||
'tag_ids': [ref('mod_303_11')],
|
||||
}),
|
||||
]"/>
|
||||
<field name="refund_repartition_line_ids" eval="[(5, 0, 0),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
'tag_ids': [ref('mod_303_40'), ref('mod_303_14_purchase')],
|
||||
}),
|
||||
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
'tag_ids': [ref('mod_303_41')],
|
||||
'account_id': ref('l10n_es.account_common_472'),
|
||||
}),
|
||||
|
||||
(0,0, {
|
||||
'factor_percent': -100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('l10n_es.account_common_477'),
|
||||
'tag_ids': [ref('mod_303_15')],
|
||||
}),
|
||||
]"/>
|
||||
</record>
|
||||
<record id="account_tax_template_p_iva5_ic_sc" model="account.tax.template">
|
||||
<field name="amount" eval="5"/>
|
||||
<field name="chart_template_id" ref="l10n_es.account_chart_template_common"/>
|
||||
<field name="amount_type">percent</field>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
<field name="name">IVA 5% Adquisición Intracomunitario. Servicios corrientes</field>
|
||||
<field name="tax_group_id" ref="tax_group_iva_5"/>
|
||||
<field name="invoice_repartition_line_ids" eval="[(5, 0, 0),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
'tag_ids': [ref('mod_303_36'), ref('mod_303_10')],
|
||||
}),
|
||||
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
'tag_ids': [ref('mod_303_37')],
|
||||
'account_id': ref('l10n_es.account_common_472'),
|
||||
}),
|
||||
|
||||
(0,0, {
|
||||
'factor_percent': -100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('l10n_es.account_common_477'),
|
||||
'tag_ids': [ref('mod_303_11')],
|
||||
}),
|
||||
]"/>
|
||||
<field name="refund_repartition_line_ids" eval="[(5, 0, 0),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
'tag_ids': [ref('mod_303_40'), ref('mod_303_14_purchase')],
|
||||
}),
|
||||
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
'tag_ids': [ref('mod_303_41')],
|
||||
'account_id': ref('l10n_es.account_common_472'),
|
||||
}),
|
||||
|
||||
(0,0, {
|
||||
'factor_percent': -100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('l10n_es.account_common_477'),
|
||||
'tag_ids': [ref('mod_303_15')],
|
||||
}),
|
||||
]"/>
|
||||
</record>
|
||||
<record id="account_tax_template_p_iva0_ic_bc" model="account.tax.template">
|
||||
<field name="amount" eval="0"/>
|
||||
<field name="chart_template_id" ref="l10n_es.account_chart_template_common"/>
|
||||
<field name="amount_type">percent</field>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
<field name="name">IVA 0% Adquisición Intracomunitario. Bienes corrientes</field>
|
||||
<field name="tax_group_id" ref="tax_group_iva_0"/>
|
||||
<field name="invoice_repartition_line_ids" eval="[(5, 0, 0),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
'tag_ids': [ref('mod_303_36'), ref('mod_303_10')],
|
||||
}),
|
||||
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
}),
|
||||
]"/>
|
||||
<field name="refund_repartition_line_ids" eval="[(5, 0, 0),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
'tag_ids': [ref('mod_303_40'), ref('mod_303_14_purchase')],
|
||||
}),
|
||||
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
}),
|
||||
]"/>
|
||||
</record>
|
||||
<record id="account_tax_template_p_iva0_ic_sc" model="account.tax.template">
|
||||
<field name="amount" eval="0"/>
|
||||
<field name="chart_template_id" ref="l10n_es.account_chart_template_common"/>
|
||||
<field name="amount_type">percent</field>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
<field name="name">IVA 0% Adquisición Intracomunitario. Servicios corrientes</field>
|
||||
<field name="tax_group_id" ref="tax_group_iva_0"/>
|
||||
<field name="invoice_repartition_line_ids" eval="[(5, 0, 0),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
'tag_ids': [ref('mod_303_36'), ref('mod_303_10')],
|
||||
}),
|
||||
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
}),
|
||||
]"/>
|
||||
<field name="refund_repartition_line_ids" eval="[(5, 0, 0),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
'tag_ids': [ref('mod_303_40'), ref('mod_303_14_purchase')],
|
||||
}),
|
||||
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
}),
|
||||
]"/>
|
||||
</record>
|
||||
<record id="account_tax_template_s_iva0_sp_i" model="account.tax.template">
|
||||
<field name="description">Intracomunitario exento (Servicios)</field>
|
||||
<field name="type_tax_use">sale</field>
|
||||
@@ -1462,6 +1656,206 @@
|
||||
}),
|
||||
]"/>
|
||||
</record>
|
||||
<record id="account_tax_template_p_iva5_ibc" model="account.tax.template">
|
||||
<field name="type_tax_use">purchase</field>
|
||||
<field name="name">IVA 5% Importaciones bienes corrientes</field>
|
||||
<field name="chart_template_id" ref="l10n_es.account_chart_template_common"/>
|
||||
<field name="amount" eval="5"/>
|
||||
<field name="amount_type">percent</field>
|
||||
<field name="tax_group_id" ref="tax_group_iva_5"/>
|
||||
<field name="invoice_repartition_line_ids" eval="[(5, 0, 0),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
'tag_ids': [ref('mod_303_32')],
|
||||
}),
|
||||
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
'tag_ids': [ref('mod_303_33')],
|
||||
'account_id': ref('l10n_es.account_common_472'),
|
||||
}),
|
||||
|
||||
]"/>
|
||||
<field name="refund_repartition_line_ids" eval="[(5, 0, 0),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
'tag_ids': [ref('mod_303_40')],
|
||||
}),
|
||||
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
'tag_ids': [ref('mod_303_41')],
|
||||
'account_id': ref('l10n_es.account_common_472'),
|
||||
}),
|
||||
]"/>
|
||||
</record>
|
||||
<record id="account_tax_template_p_iva5_isc" model="account.tax.template">
|
||||
<field name="type_tax_use">purchase</field>
|
||||
<field name="name">IVA 5% Importaciones servicios corrientes</field>
|
||||
<field name="chart_template_id" ref="l10n_es.account_chart_template_common"/>
|
||||
<field name="amount" eval="5"/>
|
||||
<field name="amount_type">percent</field>
|
||||
<field name="tax_group_id" ref="tax_group_iva_5"/>
|
||||
<field name="invoice_repartition_line_ids" eval="[(5, 0, 0),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
'tag_ids': [ref('mod_303_32')],
|
||||
}),
|
||||
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
'tag_ids': [ref('mod_303_33')],
|
||||
'account_id': ref('l10n_es.account_common_472'),
|
||||
}),
|
||||
|
||||
]"/>
|
||||
<field name="refund_repartition_line_ids" eval="[(5, 0, 0),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
'tag_ids': [ref('mod_303_40')],
|
||||
}),
|
||||
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
'tag_ids': [ref('mod_303_41')],
|
||||
'account_id': ref('l10n_es.account_common_472'),
|
||||
}),
|
||||
]"/>
|
||||
</record>
|
||||
<record id="account_tax_template_p_iva0_ibc" model="account.tax.template">
|
||||
<field name="type_tax_use">purchase</field>
|
||||
<field name="name">IVA 0% Importaciones bienes corrientes</field>
|
||||
<field name="chart_template_id" ref="l10n_es.account_chart_template_common"/>
|
||||
<field name="amount" eval="0"/>
|
||||
<field name="amount_type">percent</field>
|
||||
<field name="tax_group_id" ref="tax_group_iva_0"/>
|
||||
<field name="invoice_repartition_line_ids" eval="[(5, 0, 0),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
'tag_ids': [ref('mod_303_32')],
|
||||
}),
|
||||
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
}),
|
||||
|
||||
]"/>
|
||||
<field name="refund_repartition_line_ids" eval="[(5, 0, 0),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
'tag_ids': [ref('mod_303_40')],
|
||||
}),
|
||||
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
}),
|
||||
]"/>
|
||||
</record>
|
||||
<record id="account_tax_template_p_iva0_isc" model="account.tax.template">
|
||||
<field name="type_tax_use">purchase</field>
|
||||
<field name="name">IVA 0% Importaciones servicios corrientes</field>
|
||||
<field name="chart_template_id" ref="l10n_es.account_chart_template_common"/>
|
||||
<field name="amount" eval="0"/>
|
||||
<field name="amount_type">percent</field>
|
||||
<field name="tax_group_id" ref="tax_group_iva_0"/>
|
||||
<field name="invoice_repartition_line_ids" eval="[(5, 0, 0),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
'tag_ids': [ref('mod_303_32')],
|
||||
}),
|
||||
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
}),
|
||||
|
||||
]"/>
|
||||
<field name="refund_repartition_line_ids" eval="[(5, 0, 0),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
'tag_ids': [ref('mod_303_40')],
|
||||
}),
|
||||
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
}),
|
||||
]"/>
|
||||
</record>
|
||||
<record id="account_tax_template_p_iva0_s_bc" model="account.tax.template">
|
||||
<field name="type_tax_use">purchase</field>
|
||||
<field name="name">0% IVA soportado (bienes corrientes)</field>
|
||||
<field name="chart_template_id" ref="l10n_es.account_chart_template_common"/>
|
||||
<field name="amount" eval="0"/>
|
||||
<field name="amount_type">percent</field>
|
||||
<field name="tax_group_id" ref="tax_group_iva_0"/>
|
||||
<field name="invoice_repartition_line_ids" eval="[(5, 0, 0),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
'tag_ids': [ref('mod_303_28')],
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
}),
|
||||
]"/>
|
||||
<field name="refund_repartition_line_ids" eval="[(5, 0, 0),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
'tag_ids': [ref('mod_303_40')],
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
}),
|
||||
]"/>
|
||||
</record>
|
||||
<record id="account_tax_template_p_iva0_s_sc" model="account.tax.template">
|
||||
<field name="type_tax_use">purchase</field>
|
||||
<field name="name">0% IVA soportado (servicios corrientes)</field>
|
||||
<field name="chart_template_id" ref="l10n_es.account_chart_template_common"/>
|
||||
<field name="amount" eval="0"/>
|
||||
<field name="amount_type">percent</field>
|
||||
<field name="tax_group_id" ref="tax_group_iva_0"/>
|
||||
<field name="invoice_repartition_line_ids" eval="[(5, 0, 0),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
'tag_ids': [ref('mod_303_28')],
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
}),
|
||||
]"/>
|
||||
<field name="refund_repartition_line_ids" eval="[(5, 0, 0),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
'tag_ids': [ref('mod_303_40')],
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
}),
|
||||
]"/>
|
||||
</record>
|
||||
<record id="account_tax_template_p_iva4_bi" model="account.tax.template">
|
||||
<field name="description"/> <!-- for resetting the value on existing DBs -->
|
||||
<field name="type_tax_use">purchase</field>
|
||||
@@ -1538,10 +1932,44 @@
|
||||
}),
|
||||
]"/>
|
||||
</record>
|
||||
<record id="account_tax_template_p_iva5_bc" model="account.tax.template">
|
||||
<field name="type_tax_use">purchase</field>
|
||||
<field name="name">5% IVA soportado (bienes corrientes)</field>
|
||||
<field name="chart_template_id" ref="l10n_es.account_chart_template_common"/>
|
||||
<field name="amount" eval="5"/>
|
||||
<field name="amount_type">percent</field>
|
||||
<field name="tax_group_id" ref="tax_group_iva_5"/>
|
||||
<field name="invoice_repartition_line_ids" eval="[(5, 0, 0),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
'tag_ids': [ref('mod_303_28')],
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
'tag_ids': [ref('mod_303_29')],
|
||||
'account_id': ref('l10n_es.account_common_472'),
|
||||
}),
|
||||
]"/>
|
||||
<field name="refund_repartition_line_ids" eval="[(5, 0, 0),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
'tag_ids': [ref('mod_303_40')],
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
'tag_ids': [ref('mod_303_41')],
|
||||
'account_id': ref('l10n_es.account_common_472'),
|
||||
}),
|
||||
]"/>
|
||||
</record>
|
||||
<record id="account_tax_template_p_iva5_sc" model="account.tax.template">
|
||||
<field name="description"/> <!-- for resetting the value on existing DBs -->
|
||||
<field name="type_tax_use">purchase</field>
|
||||
<field name="name">5% IVA soportado</field>
|
||||
<field name="name">5% IVA soportado (servicios corrientes)</field>
|
||||
<field name="chart_template_id" ref="l10n_es.account_chart_template_common"/>
|
||||
<field name="amount" eval="5"/>
|
||||
<field name="amount_type">percent</field>
|
||||
@@ -1829,6 +2257,40 @@
|
||||
}),
|
||||
]"/>
|
||||
</record>
|
||||
<record id="account_tax_template_s_req0" model="account.tax.template">
|
||||
<field name="description">0% Rec. Eq.</field>
|
||||
<field name="type_tax_use">sale</field>
|
||||
<field name="name">0% Recargo Equivalencia Ventas</field>
|
||||
<field name="chart_template_id" ref="l10n_es.account_chart_template_common"/>
|
||||
<field name="amount" eval="0"/>
|
||||
<field name="amount_type">percent</field>
|
||||
<field name="tax_group_id" ref="tax_group_recargo_0"/>
|
||||
<field name="invoice_repartition_line_ids" eval="[(5, 0, 0),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
'tag_ids': [ref('mod_303_16')],
|
||||
}),
|
||||
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
}),
|
||||
|
||||
]"/>
|
||||
<field name="refund_repartition_line_ids" eval="[(5, 0, 0),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
'tag_ids': [ref('mod_303_25')],
|
||||
}),
|
||||
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
}),
|
||||
]"/>
|
||||
</record>
|
||||
<record id="account_tax_template_s_req05" model="account.tax.template">
|
||||
<field name="description">0.50% Rec. Eq.</field>
|
||||
<field name="type_tax_use">sale</field>
|
||||
@@ -1867,6 +2329,44 @@
|
||||
}),
|
||||
]"/>
|
||||
</record>
|
||||
<record id="account_tax_template_s_req062" model="account.tax.template">
|
||||
<field name="description">0.62% Rec. Eq.</field>
|
||||
<field name="type_tax_use">sale</field>
|
||||
<field name="name">0.62% Recargo Equivalencia Ventas</field>
|
||||
<field name="chart_template_id" ref="l10n_es.account_chart_template_common"/>
|
||||
<field name="amount" eval="0.62"/>
|
||||
<field name="amount_type">percent</field>
|
||||
<field name="tax_group_id" ref="tax_group_recargo_0-62"/>
|
||||
<field name="invoice_repartition_line_ids" eval="[(5, 0, 0),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
'tag_ids': [ref('mod_303_16')],
|
||||
}),
|
||||
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
'tag_ids': [ref('mod_303_18')],
|
||||
'account_id': ref('l10n_es.account_common_477'),
|
||||
}),
|
||||
|
||||
]"/>
|
||||
<field name="refund_repartition_line_ids" eval="[(5, 0, 0),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
'tag_ids': [ref('mod_303_25')],
|
||||
}),
|
||||
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
'tag_ids': [ref('mod_303_26')],
|
||||
'account_id': ref('l10n_es.account_common_477'),
|
||||
}),
|
||||
]"/>
|
||||
</record>
|
||||
<record id="account_tax_template_s_iva4b" model="account.tax.template">
|
||||
<field name="description"/> <!-- for resetting the value on existing DBs -->
|
||||
<field name="type_tax_use">sale</field>
|
||||
@@ -2040,6 +2540,66 @@
|
||||
}),
|
||||
]"/>
|
||||
</record>
|
||||
<record id="account_tax_template_s_iva0s" model="account.tax.template">
|
||||
<field name="type_tax_use">sale</field>
|
||||
<field name="name">IVA 0% (Servicios)</field>
|
||||
<field name="chart_template_id" ref="l10n_es.account_chart_template_common"/>
|
||||
<field name="amount" eval="0"/>
|
||||
<field name="amount_type">percent</field>
|
||||
<field name="tax_group_id" ref="tax_group_iva_0"/>
|
||||
<field name="invoice_repartition_line_ids" eval="[(5, 0, 0),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
'tag_ids': [ref('mod_303_153')],
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
}),
|
||||
]"/>
|
||||
<field name="refund_repartition_line_ids" eval="[(5, 0, 0),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
'tag_ids': [ref('mod_303_14_sale')],
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
}),
|
||||
]"/>
|
||||
</record>
|
||||
<record id="account_tax_template_s_iva0b" model="account.tax.template">
|
||||
<field name="type_tax_use">sale</field>
|
||||
<field name="name">IVA 0% (Bienes)</field>
|
||||
<field name="chart_template_id" ref="l10n_es.account_chart_template_common"/>
|
||||
<field name="amount" eval="0"/>
|
||||
<field name="amount_type">percent</field>
|
||||
<field name="tax_group_id" ref="tax_group_iva_0"/>
|
||||
<field name="invoice_repartition_line_ids" eval="[(5, 0, 0),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
'tag_ids': [ref('mod_303_153')],
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
}),
|
||||
]"/>
|
||||
<field name="refund_repartition_line_ids" eval="[(5, 0, 0),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
'tag_ids': [ref('mod_303_14_sale')],
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
}),
|
||||
]"/>
|
||||
</record>
|
||||
<record id="account_tax_template_s_iva4s" model="account.tax.template">
|
||||
<field name="description"/> <!-- for resetting the value on existing DBs -->
|
||||
<field name="type_tax_use">sale</field>
|
||||
@@ -2081,7 +2641,7 @@
|
||||
<record id="account_tax_template_s_iva5s" model="account.tax.template">
|
||||
<field name="description"/> <!-- for resetting the value on existing DBs -->
|
||||
<field name="type_tax_use">sale</field>
|
||||
<field name="name">IVA 5%</field>
|
||||
<field name="name">IVA 5% (Servicios)</field>
|
||||
<field name="chart_template_id" ref="l10n_es.account_chart_template_common"/>
|
||||
<field name="amount" eval="5"/>
|
||||
<field name="amount_type">percent</field>
|
||||
@@ -2090,12 +2650,46 @@
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
'tag_ids': [ref('mod_303_01')],
|
||||
'tag_ids': [ref('mod_303_153')],
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
'tag_ids': [ref('mod_303_03')],
|
||||
'tag_ids': [ref('mod_303_155')],
|
||||
'account_id': ref('l10n_es.account_common_477'),
|
||||
}),
|
||||
]"/>
|
||||
<field name="refund_repartition_line_ids" eval="[(5, 0, 0),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
'tag_ids': [ref('mod_303_14_sale')],
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
'tag_ids': [ref('mod_303_15')],
|
||||
'account_id': ref('l10n_es.account_common_477'),
|
||||
}),
|
||||
]"/>
|
||||
</record>
|
||||
<record id="account_tax_template_s_iva5b" model="account.tax.template">
|
||||
<field name="type_tax_use">sale</field>
|
||||
<field name="name">IVA 5% (Bienes)</field>
|
||||
<field name="chart_template_id" ref="l10n_es.account_chart_template_common"/>
|
||||
<field name="amount" eval="5"/>
|
||||
<field name="amount_type">percent</field>
|
||||
<field name="tax_group_id" ref="tax_group_iva_5"/>
|
||||
<field name="invoice_repartition_line_ids" eval="[(5, 0, 0),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
'tag_ids': [ref('mod_303_153')],
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
'tag_ids': [ref('mod_303_155')],
|
||||
'account_id': ref('l10n_es.account_common_477'),
|
||||
}),
|
||||
]"/>
|
||||
@@ -3078,6 +3672,39 @@
|
||||
}),
|
||||
]"/>
|
||||
</record>
|
||||
<record id="account_tax_template_p_req0" model="account.tax.template">
|
||||
<field name="type_tax_use">purchase</field>
|
||||
<field name="name">0% Recargo Equivalencia Compras</field>
|
||||
<field name="chart_template_id" ref="l10n_es.account_chart_template_common"/>
|
||||
<field name="amount" eval="0"/>
|
||||
<field name="amount_type">percent</field>
|
||||
<field name="tax_group_id" ref="tax_group_recargo_0"/>
|
||||
<field name="invoice_repartition_line_ids" eval="[(5, 0, 0),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
'tag_ids': [ref('mod_303_28')],
|
||||
}),
|
||||
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
}),
|
||||
|
||||
]"/>
|
||||
<field name="refund_repartition_line_ids" eval="[(5, 0, 0),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
'tag_ids': [ref('mod_303_40')],
|
||||
}),
|
||||
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
}),
|
||||
]"/>
|
||||
</record>
|
||||
<record id="account_tax_template_p_req05" model="account.tax.template">
|
||||
<field name="description"/> <!-- for resetting the value on existing DBs -->
|
||||
<field name="type_tax_use">purchase</field>
|
||||
@@ -3116,6 +3743,43 @@
|
||||
}),
|
||||
]"/>
|
||||
</record>
|
||||
<record id="account_tax_template_p_req062" model="account.tax.template">
|
||||
<field name="type_tax_use">purchase</field>
|
||||
<field name="name">0.62% Recargo Equivalencia Compras</field>
|
||||
<field name="chart_template_id" ref="l10n_es.account_chart_template_common"/>
|
||||
<field name="amount" eval="0.62"/>
|
||||
<field name="amount_type">percent</field>
|
||||
<field name="tax_group_id" ref="tax_group_recargo_0-62"/>
|
||||
<field name="invoice_repartition_line_ids" eval="[(5, 0, 0),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
'tag_ids': [ref('mod_303_28')],
|
||||
}),
|
||||
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('l10n_es.account_common_472'),
|
||||
'tag_ids': [ref('mod_303_29')],
|
||||
}),
|
||||
|
||||
]"/>
|
||||
<field name="refund_repartition_line_ids" eval="[(5, 0, 0),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
'tag_ids': [ref('mod_303_40')],
|
||||
}),
|
||||
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('l10n_es.account_common_472'),
|
||||
'tag_ids': [ref('mod_303_41')],
|
||||
}),
|
||||
]"/>
|
||||
</record>
|
||||
<record id="account_tax_template_p_req52" model="account.tax.template">
|
||||
<field name="description"/> <!-- for resetting the value on existing DBs -->
|
||||
<field name="type_tax_use">purchase</field>
|
||||
@@ -3257,7 +3921,7 @@
|
||||
]"/>
|
||||
</record>
|
||||
<record id="account_tax_template_s_irpf21a" model="account.tax.template">
|
||||
<field name="description">Retención 21% (Arrend.)</field>
|
||||
<field name="description">Retención 21% (Arrend.)</field>
|
||||
<field name="type_tax_use">sale</field>
|
||||
<field name="name">Retenciones a cuenta 21% (Arrendamientos)</field>
|
||||
<field name="chart_template_id" ref="l10n_es.account_chart_template_common"/>
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
# Part of Odoo, Flectra. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from flectra.addons.account.models.chart_template import update_taxes_from_templates
|
||||
|
||||
|
||||
def migrate(cr, version):
|
||||
update_taxes_from_templates(cr, 'l10n_es.account_chart_template_common')
|
||||
@@ -1357,7 +1357,7 @@ class MailThread(models.AbstractModel):
|
||||
if email_part:
|
||||
if email_part.get_content_type() == 'text/rfc822-headers':
|
||||
# Convert the message body into a message itself
|
||||
email_payload = message_from_string(email_part.get_payload(), policy=policy.SMTP)
|
||||
email_payload = message_from_string(email_part.get_content(), policy=policy.SMTP)
|
||||
else:
|
||||
email_payload = email_part.get_payload()[0]
|
||||
bounced_msg_id = tools.mail_header_msgid_re.findall(tools.decode_message_header(email_payload, 'Message-Id'))
|
||||
|
||||
@@ -426,10 +426,18 @@ class MailComposer(models.TransientModel):
|
||||
'subject': record.subject or False,
|
||||
'body_html': record.body or False,
|
||||
'model_id': model.id or False,
|
||||
'attachment_ids': [(6, 0, [att.id for att in record.attachment_ids])],
|
||||
'use_default_to': True,
|
||||
}
|
||||
template = self.env['mail.template'].create(values)
|
||||
|
||||
if record.attachment_ids:
|
||||
# transfer pending attachments to the new template
|
||||
attachments = self.env['ir.attachment'].sudo().browse(record.attachment_ids.ids).filtered(
|
||||
lambda a: a.res_model == 'mail.compose.message' and a.create_uid.id == self._uid)
|
||||
if attachments:
|
||||
attachments.write({'res_model': template._name, 'res_id': template.id})
|
||||
template.attachment_ids |= record.attachment_ids
|
||||
|
||||
# generate the saved template
|
||||
record.write({'template_id': template.id})
|
||||
record.onchange_template_id_wrapper()
|
||||
|
||||
@@ -597,10 +597,9 @@ class MrpWorkorder(models.Model):
|
||||
vals['leave_id'] = leave.id
|
||||
return self.write(vals)
|
||||
else:
|
||||
if self.date_planned_start > start_date:
|
||||
if not self.date_planned_start or self.date_planned_start > start_date:
|
||||
vals['date_planned_start'] = start_date
|
||||
if self.duration_expected:
|
||||
vals['date_planned_finished'] = self._calculate_date_planned_finished(start_date)
|
||||
vals['date_planned_finished'] = self._calculate_date_planned_finished(start_date)
|
||||
if self.date_planned_finished and self.date_planned_finished < start_date:
|
||||
vals['date_planned_finished'] = start_date
|
||||
return self.with_context(bypass_duration_calculation=True).write(vals)
|
||||
|
||||
@@ -24,6 +24,9 @@ models.PosModel = models.PosModel.extend({
|
||||
this.product_model = product_model;
|
||||
}
|
||||
return posmodel_super.load_server_data.apply(this, arguments).then(function () {
|
||||
// After loading the server data we have to add the product model as it is needed
|
||||
self.models.push(self.product_model)
|
||||
|
||||
// Give both the fields and domain to pos_cache in the
|
||||
// backend. This way we don't have to hardcode these
|
||||
// values in the backend and they automatically stay in
|
||||
|
||||
@@ -264,16 +264,27 @@ class ProductTemplate(models.Model):
|
||||
def _compute_barcode(self):
|
||||
self.barcode = False
|
||||
for template in self:
|
||||
if len(template.product_variant_ids) == 1:
|
||||
# TODO master: update product_variant_count depends and use it instead
|
||||
variant_count = len(template.product_variant_ids)
|
||||
if variant_count == 1:
|
||||
template.barcode = template.product_variant_ids.barcode
|
||||
elif variant_count == 0:
|
||||
archived_variants = template.with_context(active_test=False).product_variant_ids
|
||||
if len(archived_variants) == 1:
|
||||
template.barcode = archived_variants.barcode
|
||||
|
||||
def _search_barcode(self, operator, value):
|
||||
templates = self.with_context(active_test=False).search([('product_variant_ids.barcode', operator, value)])
|
||||
return [('id', 'in', templates.ids)]
|
||||
|
||||
def _set_barcode(self):
|
||||
if len(self.product_variant_ids) == 1:
|
||||
variant_count = len(self.product_variant_ids)
|
||||
if variant_count == 1:
|
||||
self.product_variant_ids.barcode = self.barcode
|
||||
elif variant_count == 0:
|
||||
archived_variants = self.with_context(active_test=False).product_variant_ids
|
||||
if len(archived_variants) == 1:
|
||||
archived_variants.barcode = self.barcode
|
||||
|
||||
@api.model
|
||||
def _get_weight_uom_id_from_ir_config_parameter(self):
|
||||
|
||||
@@ -287,6 +287,46 @@ class TestVariants(common.TestProductCommon):
|
||||
self.assertTrue(variant_1.active)
|
||||
self.assertTrue(template.active)
|
||||
|
||||
def test_template_barcode(self):
|
||||
template = self.env['product.template'].create({
|
||||
'name': 'template',
|
||||
'barcode': 'test',
|
||||
})
|
||||
self.assertEqual(len(template.product_variant_ids), 1)
|
||||
self.assertEqual(template.barcode, 'test')
|
||||
|
||||
template.product_variant_ids.action_archive()
|
||||
self.assertFalse(template.active)
|
||||
template.invalidate_cache(['barcode'])
|
||||
self.assertEqual(template.barcode, 'test')
|
||||
template.product_variant_ids.action_unarchive()
|
||||
template.action_unarchive()
|
||||
|
||||
template.write({
|
||||
'attribute_line_ids': [(0, False, {
|
||||
'attribute_id': self.size_attr.id,
|
||||
'value_ids': [
|
||||
(4, self.size_attr.value_ids[0].id, self.size_attr_value_s),
|
||||
(4, self.size_attr.value_ids[1].id, self.size_attr_value_m)
|
||||
],
|
||||
})]
|
||||
})
|
||||
self.assertFalse(template.barcode) # 2 active variants --> no barcode on template
|
||||
|
||||
variant_1 = template.product_variant_ids[0]
|
||||
variant_2 = template.product_variant_ids[1]
|
||||
|
||||
variant_1.barcode = 'v1_barcode'
|
||||
variant_2.barcode = 'v2_barcode'
|
||||
|
||||
variant_1.action_archive()
|
||||
template.invalidate_cache(['barcode'])
|
||||
self.assertEqual(template.barcode, variant_2.barcode) # 1 active variant --> barcode on template
|
||||
|
||||
variant_1.action_unarchive()
|
||||
template.invalidate_cache(['barcode'])
|
||||
self.assertFalse(template.barcode) # 2 active variants --> no barcode on template
|
||||
|
||||
def test_archive_all_variants(self):
|
||||
template = self.env['product.template'].create({
|
||||
'name': 'template'
|
||||
@@ -1127,6 +1167,19 @@ class TestVariantsArchive(common.TestProductCommon):
|
||||
|
||||
Product._revert_method('unlink')
|
||||
|
||||
def test_set_barcode(self):
|
||||
tmpl = self.product_0.product_tmpl_id
|
||||
tmpl.barcode = '123'
|
||||
self.assertEqual(tmpl.barcode, '123')
|
||||
self.assertEqual(self.product_0.barcode, '123')
|
||||
|
||||
tmpl.toggle_active()
|
||||
|
||||
tmpl.barcode = '456'
|
||||
tmpl.invalidate_cache(fnames=['barcode'], ids=tmpl.ids)
|
||||
self.assertEqual(tmpl.barcode, '456')
|
||||
self.assertEqual(self.product_0.barcode, '456')
|
||||
|
||||
def _update_color_vars(self, ptal):
|
||||
self.ptal_color = ptal
|
||||
self.assertEqual(self.ptal_color.attribute_id, self.pa_color)
|
||||
|
||||
@@ -82,12 +82,14 @@ tour.register('project_tour', {
|
||||
position: "bottom",
|
||||
}, {
|
||||
trigger: ".o_ChatterTopbar_buttonSendMessage",
|
||||
extra_trigger: '.o_form_project_tasks',
|
||||
content: _t("Use this chatter to <b>send emails</b> and communicate efficently with your customers. \
|
||||
Add new people in the followers list to make them aware about the main changes about this task."),
|
||||
width: 350,
|
||||
position: "bottom",
|
||||
}, {
|
||||
trigger: ".o_ChatterTopbar_buttonLogNote",
|
||||
extra_trigger: '.o_form_project_tasks',
|
||||
content: _t("<b>Log notes</b> for internal communications <i>(the people following this task won't be notified \
|
||||
of the note you are logging unless you specifically tag them)</i>. Use @ <b>mentions</b> to ping a colleague \
|
||||
or # <b>mentions</b> to reach an entire team."),
|
||||
@@ -95,9 +97,11 @@ tour.register('project_tour', {
|
||||
position: "bottom"
|
||||
}, {
|
||||
trigger: ".o_ChatterTopbar_buttonScheduleActivity",
|
||||
extra_trigger: '.o_form_project_tasks',
|
||||
content: _t("Use <b>activities</b> to organize your daily work."),
|
||||
}, {
|
||||
trigger: ".modal-dialog .btn-primary",
|
||||
extra_trigger: '.o_form_project_tasks',
|
||||
content: "Schedule your activity once it is ready",
|
||||
position: "bottom",
|
||||
run: "click",
|
||||
|
||||
@@ -12,7 +12,7 @@ class AccountMove(models.Model):
|
||||
def action_post(self):
|
||||
#inherit of the function from account.move to validate a new tax and the priceunit of a downpayment
|
||||
res = super(AccountMove, self).action_post()
|
||||
line_ids = self.mapped('line_ids').filtered(lambda line: line.sale_line_ids.is_downpayment)
|
||||
line_ids = self.mapped('line_ids').filtered(lambda line: any(line.sale_line_ids.mapped('is_downpayment')))
|
||||
for line in line_ids:
|
||||
try:
|
||||
line.sale_line_ids.tax_id = line.tax_ids
|
||||
|
||||
@@ -1215,8 +1215,6 @@ class SaleOrderLine(models.Model):
|
||||
'price_total': taxes['total_included'],
|
||||
'price_subtotal': taxes['total_excluded'],
|
||||
})
|
||||
if self.env.context.get('import_file', False) and not self.env.user.user_has_groups('account.group_account_manager'):
|
||||
line.tax_id.invalidate_cache(['invoice_repartition_line_ids'], [line.tax_id.id])
|
||||
|
||||
@api.depends('product_id', 'order_id.state', 'qty_invoiced', 'qty_delivered')
|
||||
def _compute_product_updatable(self):
|
||||
|
||||
@@ -279,6 +279,37 @@ class TestSaleToInvoice(TestSaleCommon):
|
||||
self.assertEqual(line.untaxed_amount_to_invoice, line.price_unit * line.qty_to_invoice, "Amount to invoice is now set as qty to invoice * unit price since no price change on invoice, for ordered products")
|
||||
self.assertEqual(line.untaxed_amount_invoiced, line.price_unit * line.qty_invoiced, "Amount invoiced is now set as qty invoiced * unit price since no price change on invoice, for ordered products")
|
||||
|
||||
def test_multiple_sale_orders_on_same_invoice(self):
|
||||
""" The model allows the association of multiple SO lines linked to the same invoice line.
|
||||
Check that the operations behave well, if a custom module creates such a situation.
|
||||
"""
|
||||
self.sale_order.action_confirm()
|
||||
payment = self.env['sale.advance.payment.inv'].with_context(self.context).create({
|
||||
'advance_payment_method': 'delivered'
|
||||
})
|
||||
payment.create_invoices()
|
||||
|
||||
# create a second SO whose lines are linked to the same invoice lines
|
||||
# this is a way to create a situation where sale_line_ids has multiple items
|
||||
sale_order_data = self.sale_order.copy_data()[0]
|
||||
sale_order_data['order_line'] = [
|
||||
(0, 0, line.copy_data({
|
||||
'invoice_lines': [(6, 0, line.invoice_lines.ids)],
|
||||
})[0])
|
||||
for line in self.sale_order.order_line
|
||||
]
|
||||
self.sale_order.create(sale_order_data)
|
||||
|
||||
# we should now have at least one move line linked to several order lines
|
||||
invoice = self.sale_order.invoice_ids[0]
|
||||
self.assertTrue(any(len(move_line.sale_line_ids) > 1
|
||||
for move_line in invoice.line_ids))
|
||||
|
||||
# however these actions should not raise
|
||||
invoice.action_post()
|
||||
invoice.button_draft()
|
||||
invoice.button_cancel()
|
||||
|
||||
def test_invoice_with_sections(self):
|
||||
""" Test create and invoice with sections from the SO, and check qty invoice/to invoice, and the related amounts """
|
||||
|
||||
|
||||
@@ -44,7 +44,9 @@ class SaleOrder(models.Model):
|
||||
return order
|
||||
|
||||
def action_confirm(self):
|
||||
self.generated_coupon_ids.write({'state': 'new'})
|
||||
valid_coupon_ids = self.generated_coupon_ids.filtered(lambda coupon: coupon.state not in ['expired', 'cancel'])
|
||||
valid_coupon_ids.write({'state': 'new', 'partner_id': self.partner_id})
|
||||
(self.generated_coupon_ids - valid_coupon_ids).write({'state': 'cancel', 'partner_id': self.partner_id})
|
||||
self.applied_coupon_ids.write({'state': 'used'})
|
||||
self._send_reward_coupon_mail()
|
||||
return super(SaleOrder, self).action_confirm()
|
||||
@@ -154,6 +156,10 @@ class SaleOrder(models.Model):
|
||||
# This allow manual overwrite of taxes for promotion.
|
||||
if program.discount_line_product_id.taxes_id:
|
||||
line_taxes = self.fiscal_position_id.map_tax(program.discount_line_product_id.taxes_id) if self.fiscal_position_id else program.discount_line_product_id.taxes_id
|
||||
lines = self._get_base_order_lines(program)
|
||||
discount_amount = min(
|
||||
sum(lines.mapped(lambda l: l.price_reduce * l.product_uom_qty)), discount_amount
|
||||
)
|
||||
return [{
|
||||
'name': _("Discount: %s", program.name),
|
||||
'product_id': program.discount_line_product_id.id,
|
||||
@@ -288,10 +294,15 @@ class SaleOrder(models.Model):
|
||||
self.ensure_one()
|
||||
self = self.with_context(lang=self.partner_id.lang)
|
||||
program = program.with_context(lang=self.partner_id.lang)
|
||||
values = []
|
||||
if program.reward_type == 'discount':
|
||||
return self._get_reward_values_discount(program)
|
||||
values = self._get_reward_values_discount(program)
|
||||
elif program.reward_type == 'product':
|
||||
return [self._get_reward_values_product(program)]
|
||||
values = [self._get_reward_values_product(program)]
|
||||
seq = max(self.order_line.mapped('sequence'), default=10) + 1
|
||||
for value in values:
|
||||
value['sequence'] = seq
|
||||
return values
|
||||
|
||||
def _create_reward_line(self, program):
|
||||
self.write({'order_line': [(0, False, value) for value in self._get_reward_line_values(program)]})
|
||||
@@ -322,7 +333,7 @@ class SaleOrder(models.Model):
|
||||
template = self.env.ref('coupon.mail_template_sale_coupon', raise_if_not_found=False)
|
||||
if template:
|
||||
for order in self:
|
||||
for coupon in order.generated_coupon_ids:
|
||||
for coupon in order.generated_coupon_ids.filtered(lambda coupon: coupon.state == 'new'):
|
||||
order.message_post_with_template(
|
||||
template.id, composition_mode='comment',
|
||||
model='coupon.coupon', res_id=coupon.id,
|
||||
|
||||
@@ -1476,6 +1476,31 @@ class TestSaleCouponProgramNumbers(TestSaleCouponCommon):
|
||||
self.assertEqual(len(order.order_line), 3, 'Promotion should add 1 line')
|
||||
self.assertEqual(order.amount_total, 5, '10$ discount should be applied on top of the 15$ original price')
|
||||
|
||||
def test_fixed_amount_with_tax_sale_order_amount_remain_positive(self):
|
||||
|
||||
prod = self.env['coupon.program'].create({
|
||||
'name': '$10 coupon',
|
||||
'program_type': 'promotion_program',
|
||||
'promo_code_usage': 'no_code_needed',
|
||||
'reward_type': 'discount',
|
||||
'discount_type': 'fixed_amount',
|
||||
'discount_fixed_amount': 10,
|
||||
'active': True,
|
||||
'discount_apply_on': 'on_order',
|
||||
})
|
||||
prod.discount_line_product_id.taxes_id = self.tax_15pc_excl
|
||||
|
||||
order = self.empty_order
|
||||
self.env['sale.order.line'].create({
|
||||
'product_id': self.drawerBlack.id,
|
||||
'price_unit': 5,
|
||||
'product_uom_qty': 1.0,
|
||||
'order_id': order.id,
|
||||
'tax_id': self.tax_15pc_excl,
|
||||
})
|
||||
order.recompute_coupon_lines()
|
||||
self.assertEqual(order.amount_total, 0, 'Sale Order total amount cannot be negative')
|
||||
|
||||
def test_fixed_amount_change_promo_amount(self):
|
||||
|
||||
promo = self.env['coupon.program'].create({
|
||||
|
||||
@@ -244,7 +244,7 @@ class SaleOrderLine(models.Model):
|
||||
if supplierinfo:
|
||||
price_unit = self.env['account.tax'].sudo()._fix_tax_included_price_company(supplierinfo.price, self.product_id.supplier_taxes_id, taxes, self.company_id)
|
||||
if purchase_order.currency_id and supplierinfo.currency_id != purchase_order.currency_id:
|
||||
price_unit = supplierinfo.currency_id._convert(price_unit, purchase_order.currency_id, purchase_order.company_id, fields.datetime.today())
|
||||
price_unit = supplierinfo.currency_id._convert(price_unit, purchase_order.currency_id, purchase_order.company_id, fields.Date.context_today(self))
|
||||
product_ctx.update({'seller_id': supplierinfo.id})
|
||||
else:
|
||||
product_ctx.update({'partner_id': purchase_order.partner_id.id})
|
||||
|
||||
@@ -119,7 +119,8 @@ class AccountMoveLine(models.Model):
|
||||
if so_line:
|
||||
is_line_reversing = bool(self.move_id.reversed_entry_id)
|
||||
qty_to_invoice = self.product_uom_id._compute_quantity(self.quantity, self.product_id.uom_id)
|
||||
posted_cogs = so_line.invoice_lines.move_id.line_ids.filtered(lambda l: l.is_anglo_saxon_line and l.product_id == self.product_id and l.balance > 0)
|
||||
account_moves = so_line.invoice_lines.move_id.filtered(lambda m: m.state == 'posted' and bool(m.reversed_entry_id) == is_line_reversing)
|
||||
posted_cogs = account_moves.line_ids.filtered(lambda l: l.is_anglo_saxon_line and l.product_id == self.product_id and l.balance > 0)
|
||||
qty_invoiced = sum([line.product_uom_id._compute_quantity(line.quantity, line.product_id.uom_id) for line in posted_cogs])
|
||||
value_invoiced = sum(posted_cogs.mapped('balance'))
|
||||
|
||||
|
||||
@@ -1357,6 +1357,20 @@ class TestAngloSaxonValuation(ValuationReconciliationTestCommon):
|
||||
invoice = so._create_invoices()
|
||||
invoice.action_post()
|
||||
|
||||
# Receive one @100
|
||||
in_moves = self.env['stock.move'].create({
|
||||
'name': 'IN move @100',
|
||||
'product_id': self.product.id,
|
||||
'location_id': self.env.ref('stock.stock_location_suppliers').id,
|
||||
'location_dest_id': self.company_data['default_warehouse'].lot_stock_id.id,
|
||||
'product_uom': self.product.uom_id.id,
|
||||
'product_uom_qty': 1,
|
||||
'price_unit': 100,
|
||||
})
|
||||
in_moves._action_confirm()
|
||||
in_moves.quantity_done = 1
|
||||
in_moves._action_done()
|
||||
|
||||
# Return the second picking (i.e. 1@20)
|
||||
ctx = {'active_id': pickings[1].id, 'active_model': 'stock.picking'}
|
||||
return_wizard = Form(self.env['stock.return.picking'].with_context(ctx)).save()
|
||||
|
||||
@@ -472,64 +472,64 @@ class StockWarehouseOrderpoint(models.Model):
|
||||
self = self.with_company(company_id)
|
||||
orderpoints_noprefetch = self.read(['id'])
|
||||
orderpoints_noprefetch = [orderpoint['id'] for orderpoint in orderpoints_noprefetch]
|
||||
|
||||
for orderpoints_batch in split_every(1000, orderpoints_noprefetch):
|
||||
if use_new_cursor:
|
||||
cr = registry(self._cr.dbname).cursor()
|
||||
self = self.with_env(self.env(cr=cr))
|
||||
orderpoints_batch = self.env['stock.warehouse.orderpoint'].browse(orderpoints_batch)
|
||||
orderpoints_exceptions = []
|
||||
while orderpoints_batch:
|
||||
procurements = []
|
||||
for orderpoint in orderpoints_batch:
|
||||
if float_compare(orderpoint.qty_to_order, 0.0, precision_rounding=orderpoint.product_uom.rounding) == 1:
|
||||
date = datetime.combine(orderpoint.lead_days_date, time.min)
|
||||
values = orderpoint._prepare_procurement_values(date=date)
|
||||
procurements.append(self.env['procurement.group'].Procurement(
|
||||
orderpoint.product_id, orderpoint.qty_to_order, orderpoint.product_uom,
|
||||
orderpoint.location_id, orderpoint.name, orderpoint.name,
|
||||
orderpoint.company_id, values))
|
||||
try:
|
||||
orderpoints_batch = self.env['stock.warehouse.orderpoint'].browse(orderpoints_batch)
|
||||
orderpoints_exceptions = []
|
||||
while orderpoints_batch:
|
||||
procurements = []
|
||||
for orderpoint in orderpoints_batch:
|
||||
if float_compare(orderpoint.qty_to_order, 0.0, precision_rounding=orderpoint.product_uom.rounding) == 1:
|
||||
date = datetime.combine(orderpoint.lead_days_date, time.min)
|
||||
values = orderpoint._prepare_procurement_values(date=date)
|
||||
procurements.append(self.env['procurement.group'].Procurement(
|
||||
orderpoint.product_id, orderpoint.qty_to_order, orderpoint.product_uom,
|
||||
orderpoint.location_id, orderpoint.name, orderpoint.name,
|
||||
orderpoint.company_id, values))
|
||||
|
||||
try:
|
||||
with self.env.cr.savepoint():
|
||||
self.env['procurement.group'].with_context(from_orderpoint=True).run(procurements, raise_user_error=raise_user_error)
|
||||
except ProcurementException as errors:
|
||||
for procurement, error_msg in errors.procurement_exceptions:
|
||||
orderpoints_exceptions += [(procurement.values.get('orderpoint_id'), error_msg)]
|
||||
failed_orderpoints = self.env['stock.warehouse.orderpoint'].concat(*[o[0] for o in orderpoints_exceptions])
|
||||
if not failed_orderpoints:
|
||||
_logger.error('Unable to process orderpoints')
|
||||
break
|
||||
orderpoints_batch -= failed_orderpoints
|
||||
try:
|
||||
with self.env.cr.savepoint():
|
||||
self.env['procurement.group'].with_context(from_orderpoint=True).run(procurements, raise_user_error=raise_user_error)
|
||||
except ProcurementException as errors:
|
||||
for procurement, error_msg in errors.procurement_exceptions:
|
||||
orderpoints_exceptions += [(procurement.values.get('orderpoint_id'), error_msg)]
|
||||
failed_orderpoints = self.env['stock.warehouse.orderpoint'].concat(*[o[0] for o in orderpoints_exceptions])
|
||||
if not failed_orderpoints:
|
||||
_logger.error('Unable to process orderpoints')
|
||||
break
|
||||
orderpoints_batch -= failed_orderpoints
|
||||
|
||||
except OperationalError:
|
||||
if use_new_cursor:
|
||||
cr.rollback()
|
||||
continue
|
||||
except OperationalError:
|
||||
if use_new_cursor:
|
||||
cr.rollback()
|
||||
continue
|
||||
else:
|
||||
raise
|
||||
else:
|
||||
raise
|
||||
else:
|
||||
orderpoints_batch._post_process_scheduler()
|
||||
break
|
||||
orderpoints_batch._post_process_scheduler()
|
||||
break
|
||||
|
||||
# Log an activity on product template for failed orderpoints.
|
||||
for orderpoint, error_msg in orderpoints_exceptions:
|
||||
existing_activity = self.env['mail.activity'].search([
|
||||
('res_id', '=', orderpoint.product_id.product_tmpl_id.id),
|
||||
('res_model_id', '=', self.env.ref('product.model_product_template').id),
|
||||
('note', '=', error_msg)])
|
||||
if not existing_activity:
|
||||
orderpoint.product_id.product_tmpl_id.activity_schedule(
|
||||
'mail.mail_activity_data_warning',
|
||||
note=error_msg,
|
||||
user_id=orderpoint.product_id.responsible_id.id or SUPERUSER_ID,
|
||||
)
|
||||
|
||||
if use_new_cursor:
|
||||
try:
|
||||
cr.commit()
|
||||
finally:
|
||||
cr.close()
|
||||
# Log an activity on product template for failed orderpoints.
|
||||
for orderpoint, error_msg in orderpoints_exceptions:
|
||||
existing_activity = self.env['mail.activity'].search([
|
||||
('res_id', '=', orderpoint.product_id.product_tmpl_id.id),
|
||||
('res_model_id', '=', self.env.ref('product.model_product_template').id),
|
||||
('note', '=', error_msg)])
|
||||
if not existing_activity:
|
||||
orderpoint.product_id.product_tmpl_id.activity_schedule(
|
||||
'mail.mail_activity_data_warning',
|
||||
note=error_msg,
|
||||
user_id=orderpoint.product_id.responsible_id.id or SUPERUSER_ID,
|
||||
)
|
||||
finally:
|
||||
if use_new_cursor:
|
||||
try:
|
||||
cr.commit()
|
||||
finally:
|
||||
cr.close()
|
||||
|
||||
return {}
|
||||
|
||||
|
||||
@@ -958,6 +958,90 @@ OyI+T2RvbzwvYT4uCjwvcD4KPC9kaXY+CiAgICAgICAg
|
||||
--92726A5F09.1555335666/mail2.test.ironsky--
|
||||
"""
|
||||
|
||||
|
||||
MAIL_BOUNCE_QP_RFC822_HEADERS = """\
|
||||
Received: by mailserver.flectrahq.com (Postfix)
|
||||
id EA0B917B8E4; Tue, 29 Feb 2023 11:11:11 +0100 (CET)
|
||||
From: {email_from}
|
||||
Subject: Undelivered Mail Returned to Sender
|
||||
To: {email_to}
|
||||
Auto-Submitted: auto-replied
|
||||
MIME-Version: 1.0
|
||||
Content-Type: multipart/report; report-type=delivery-status;
|
||||
boundary="DFFDC17AA03.1673346179/mailserver.flectrahq.com"
|
||||
Message-Id: <40230110102259.EA0B917B8E4@mailserver.flectrahq.com>
|
||||
Content-Transfer-Encoding: 7bit
|
||||
Delivered-To: {delivered_to}
|
||||
Return-Path: <>
|
||||
|
||||
--DFFDC17AA03.1673346179/mailserver.flectrahq.com
|
||||
Content-Description: Notification
|
||||
Content-Type: text/plain; charset=utf-8
|
||||
Content-Transfer-Encoding: quoted-printable
|
||||
|
||||
I'm sorry to have to inform you that your message could not
|
||||
be delivered to one or more recipients.
|
||||
|
||||
<rdesfrdgtfdrfesd@outlook.com>: host
|
||||
outlook-com.olc.protection.outlook.com[104.47.56.33] said: 550 5.5.0
|
||||
Requested action not taken: mailbox unavailable (S2017062302). (in re=
|
||||
ply to
|
||||
RCPT TO command)
|
||||
|
||||
--DFFDC17AA03.1673346179/mailserver.flectrahq.com
|
||||
Content-Description: Delivery report
|
||||
Content-Type: message/delivery-status
|
||||
|
||||
Reporting-MTA: dns; mailserver.flectrahq.com
|
||||
X-Postfix-Queue-ID: DFFDC17AA03
|
||||
X-Postfix-Sender: rfc822; bounce@xxx.flectrahq.com
|
||||
Arrival-Date: Tue, 29 Feb 2023 10:10:10 +0100 (CET)
|
||||
|
||||
Final-Recipient: rfc822; rdesfrdgtfdrfesd@outlook.com
|
||||
Original-Recipient: rfc822;rdesfrdgtfdrfesd@outlook.com
|
||||
Action: failed
|
||||
Status: 5.5.0
|
||||
Remote-MTA: dns; outlook-com.olc.protection.outlook.com
|
||||
Diagnostic-Code: smtp; 550 5.5.0 Requested action not taken: mailbox
|
||||
unavailable (S2017062302).
|
||||
|
||||
--DFFDC17AA03.1673346179/mailserver.flectrahq.com
|
||||
Content-Description: Undelivered Message Headers
|
||||
Content-Type: text/rfc822-headers
|
||||
Content-Transfer-Encoding: quoted-printable
|
||||
|
||||
Return-Path: <bounce@xxx.flectrahq.com>
|
||||
Received: from eupp00.flectrahq.com (00.72.79.34.bc.googleusercontent.com [34.=
|
||||
79.72.00])
|
||||
by mailserver.flectrahq.com (Postfix) with ESMTPS id DFFDC17AA03;
|
||||
Tue, 10 Jan 2023 11:22:57 +0100 (CET)
|
||||
DKIM-Signature: v=3D1; a=3Drsa-sha256; c=3Dsimple/simple; d=3Dxxx.be;
|
||||
s=3Dflectra; t=3D1673346178;
|
||||
bh=3DYPJOqkUi8B28X1MrRUsgmsL8KRz/ZIkpbYyc6wNITXA=3D;
|
||||
h=3Dreferences:Subject:From:Reply-To:To:Date:From;
|
||||
b=3DCMqh7mUvpgUw+JpCeGluv1+MZ3y6EsXd0acmsfzpYBjcoy1InvD6FLT1/lQCcgetf
|
||||
cGyL/8R4vvDKATyE0AtOIpoYDsbpnMoiYWqaSXnDVuLTrEZzyrK/2j10ZTnHZ2uDTC
|
||||
b7wPjFfQ9pted/t6CAUhVT1XydDNalSwEZovy/QI=3D
|
||||
Message-Id: <368396033905967.1673346177.695352554321289-openerp-11-sale.o=
|
||||
rder@eupp00>
|
||||
references: <792105153140463.1673746527.352018594741821-openerp-11-sale.o=
|
||||
rder@xxx.flectrahq.com> <368396033905967.1673346177.695352554321289-openerp-11=
|
||||
-sale.order@eupp00>
|
||||
Subject: Thi is a SO (Ref SO/11)
|
||||
From: info@xxx.flectrahq.com
|
||||
Reply-To: "SO/11" <catchall@xxx.flectrahq.com=
|
||||
>
|
||||
To: "rdesfrdgtfdrfesd@outlook.com" <rdesfrdgtfdrfesd@outlook.com>
|
||||
Date: Tue, 29 Feb 2023 06:09:06 -0000
|
||||
X-Flectra-Objects: sale.order-11
|
||||
MIME-Version: 1.0
|
||||
Content-Type: multipart/mixed; boundary=3D"=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
|
||||
=3D=3D=3D=3D=3D5706316606908750110=3D=3D"
|
||||
|
||||
--DFFDC17AA03.1673346179/mailserver.flectrahq.com--
|
||||
|
||||
"""
|
||||
|
||||
MAIL_NO_BODY = '''\
|
||||
Return-Path: <{email_from}>
|
||||
Delivered-To: catchall@xxxx.xxxx
|
||||
|
||||
@@ -98,6 +98,31 @@ class TestEmailParsing(TestMailCommon):
|
||||
|
||||
self.assertEqual(res['bounced_msg_id'], [msg_id], "Message-Id is not extracted from Text/RFC822-Headers attachment")
|
||||
|
||||
def test_message_parse_extract_bounce_rfc822_headers_qp(self):
|
||||
# Incoming bounce for unexisting Outlook address
|
||||
# bounce back sometimes with a Content-Type `text/rfc822-headers`
|
||||
# and Content-Type-Encoding `quoted-printable`
|
||||
partner = self.env['res.partner'].create({
|
||||
'name':'Mitchelle Admine',
|
||||
'email':'rdesfrdgtfdrfesd@outlook.com'
|
||||
})
|
||||
message = self.env['mail.message'].create({
|
||||
'message_id' : '<368396033905967.1673346177.695352554321289-openerp-11-sale.order@eupp00>'
|
||||
})
|
||||
incoming_bounce = self.format(
|
||||
test_mail_data.MAIL_BOUNCE_QP_RFC822_HEADERS,
|
||||
email_from='MAILER-DAEMON@mailserver.flectrahq.com (Mail Delivery System)',
|
||||
email_to='bounce@xxx.flectrahq.com',
|
||||
delivered_to='bounce@xxx.flectrahq.com'
|
||||
)
|
||||
|
||||
msg_dict = {}
|
||||
msg = self.env['mail.thread']._message_parse_extract_bounce(self.from_string(incoming_bounce), msg_dict)
|
||||
self.assertEqual(msg['bounced_email'], partner.email, "The sender email should be correctly parsed")
|
||||
self.assertEqual(msg['bounced_partner'], partner, "A partner with this email should exist")
|
||||
self.assertEqual(msg['bounced_msg_id'][0], message.message_id, "The sender message-id should correctly parsed")
|
||||
self.assertEqual(msg['bounced_message'], message, "An existing message with this message_id should exist")
|
||||
|
||||
def test_message_parse_plaintext(self):
|
||||
""" Incoming email in plaintext should be stored as html """
|
||||
mail = self.format(test_mail_data.MAIL_TEMPLATE_PLAINTEXT, email_from='"Sylvie Lelitre" <test.sylvie.lelitre@agrolait.com>', to='generic@test.com')
|
||||
|
||||
@@ -357,7 +357,9 @@ class TestMessageAccess(TestMailCommon):
|
||||
def test_mail_message_access_read_notification(self):
|
||||
attachment = self.env['ir.attachment'].create({
|
||||
'datas': base64.b64encode(b'My attachment'),
|
||||
'name': 'doc.txt'})
|
||||
'name': 'doc.txt',
|
||||
'res_model': self.message._name,
|
||||
'res_id': self.message.id})
|
||||
# attach the attachment to the message
|
||||
self.message.write({'attachment_ids': [(4, attachment.id)]})
|
||||
self.message.write({'partner_ids': [(4, self.user_employee.partner_id.id)]})
|
||||
|
||||
@@ -193,7 +193,10 @@ class WebsiteForum(WebsiteProfile):
|
||||
fields=['id', 'name'],
|
||||
limit=int(limit),
|
||||
)
|
||||
return json.dumps(data)
|
||||
return request.make_response(
|
||||
json.dumps(data),
|
||||
headers=[("Content-Type", "application/json")]
|
||||
)
|
||||
|
||||
@http.route(['/forum/<model("forum.forum"):forum>/tag', '/forum/<model("forum.forum"):forum>/tag/<string:tag_char>'], type='http', auth="public", website=True, sitemap=False)
|
||||
def tags(self, forum, tag_char=None, **post):
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<template id="user_profile_sub_nav" inherit_id="website_profile.user_profile_sub_nav">
|
||||
<xpath expr="//nav" position="before">
|
||||
<div t-if="request.params.get('forum_origin')" class="o_wprofile_all_users_nav_btn_container col pr-0 flex-grow-0">
|
||||
<a t-att-href="request.website._get_http_domain() + request.params.get('forum_origin')"
|
||||
<a t-att-href="request.website._get_http_domain() + '/' + request.params.get('forum_origin').lstrip('/')"
|
||||
class="o_wprofile_all_users_nav_btn btn text-nowrap">
|
||||
<i class="fa fa-chevron-left small"/> Back
|
||||
</a>
|
||||
|
||||
@@ -403,7 +403,7 @@
|
||||
<nav t-if="request.params.get('url_origin') and request.params.get('name_origin')" aria-label="breadcrumb">
|
||||
<ol class="breadcrumb p-0 bg-white">
|
||||
<li class="breadcrumb-item">
|
||||
<a t-att-href="request.website._get_http_domain() + request.params.get('url_origin')" t-esc="request.params.get('name_origin')"/>
|
||||
<a t-att-href="request.website._get_http_domain() + '/' + request.params.get('url_origin').lstrip('/')" t-esc="request.params.get('name_origin')"/>
|
||||
</li>
|
||||
<li class="breadcrumb-item">Badges</li>
|
||||
</ol>
|
||||
|
||||
Reference in New Issue
Block a user