[PATCH] Upstream patch - 11102022

This commit is contained in:
Parthiv Patel
2022-10-11 08:34:47 +00:00
parent d15baf8d17
commit eb5ac5f3bd
7 changed files with 23 additions and 27 deletions
@@ -682,7 +682,7 @@ class AccountBankStatementLine(models.Model):
if balance_to_reconcile is None else balance_to_reconcile
if 'currency_id' in counterpart_vals:
currency_id = counterpart_vals['currency_id'] or company_currency.id
currency_id = counterpart_vals['currency_id'] or foreign_currency.id
elif move_line:
currency_id = move_line.currency_id.id or company_currency.id
else:
+5 -5
View File
@@ -2,18 +2,18 @@
from flectra import api, fields, models, _
ACCOUNT_DOMAIN = "['&', '&', '&', ('deprecated', '=', False), ('internal_type','=','other'), ('company_id', '=', current_company_id), ('is_off_balance', '=', False)]"
ACCOUNT_DOMAIN = "[('deprecated', '=', False), ('internal_type','=','other'), ('company_id', '=', current_company_id), ('is_off_balance', '=', False), ('internal_group', '=', '%s')]"
class ProductCategory(models.Model):
_inherit = "product.category"
property_account_income_categ_id = fields.Many2one('account.account', company_dependent=True,
string="Income Account",
domain=ACCOUNT_DOMAIN,
domain=ACCOUNT_DOMAIN % "income",
help="This account will be used when validating a customer invoice.")
property_account_expense_categ_id = fields.Many2one('account.account', company_dependent=True,
string="Expense Account",
domain=ACCOUNT_DOMAIN,
domain=ACCOUNT_DOMAIN % "expense",
help="The expense is accounted for when a vendor bill is validated, except in anglo-saxon accounting with perpetual inventory valuation in which case the expense (Cost of Goods Sold account) is recognized at the customer invoice validation.")
#----------------------------------------------------------
@@ -28,11 +28,11 @@ class ProductTemplate(models.Model):
domain=[('type_tax_use', '=', 'purchase')], default=lambda self: self.env.company.account_purchase_tax_id)
property_account_income_id = fields.Many2one('account.account', company_dependent=True,
string="Income Account",
domain=ACCOUNT_DOMAIN,
domain=ACCOUNT_DOMAIN % "income",
help="Keep this field empty to use the default value from the product category.")
property_account_expense_id = fields.Many2one('account.account', company_dependent=True,
string="Expense Account",
domain=ACCOUNT_DOMAIN,
domain=ACCOUNT_DOMAIN % "expense",
help="Keep this field empty to use the default value from the product category. If anglo-saxon accounting with automated valuation method is configured, the expense account on the product category will be used.")
def _get_product_accounts(self):
+2 -1
View File
@@ -384,7 +384,8 @@ class AccountTestInvoicingCommon(SavepointCase):
line_form.price_unit = amount
if taxes:
line_form.tax_ids.clear()
line_form.tax_ids.add(taxes)
for tax in taxes:
line_form.tax_ids.add(tax)
rslt = move_form.save()
+2 -2
View File
@@ -86,8 +86,8 @@
<group name="first" position="after">
<group name="account_property" >
<group string="Account Properties" groups="account.group_account_readonly">
<field name="property_account_income_categ_id" domain="[('internal_group', '=', 'income')]"/>
<field name="property_account_expense_categ_id" domain="[('internal_group', '=', 'expense')]"/>
<field name="property_account_income_categ_id"/>
<field name="property_account_expense_categ_id"/>
</group>
</group>
</group>
@@ -28,15 +28,6 @@
<field name="website">www.itexample.com</field>
</record>
<record id="base.res_partner_2" model="res.partner">
<field name="vat">IT00079760328</field>
<field name="l10n_it_pa_index">XS00001</field>
</record>
<record id="base.res_partner_12" model="res.partner">
<field name="vat">IT00140390501</field>
<field name="l10n_it_pa_index">XS00001</field>
</record>
<record id="demo_l10n_it_edi_bank" model="res.partner.bank">
<field name="acc_type">iban</field>
<field name="acc_number">BE71096123456769</field>
@@ -46,14 +37,15 @@
</record>
<record id="demo_l10n_it_edi_partner_a" model="res.partner">
<field name="name">Vendhoreconi</field>
<field name="name">Biscotti Oslenghi</field>
<field name="company_type">company</field>
<field name="country_id" ref="base.it"/>
<field name="street">1234 Strada del Caffè</field>
<field name="city">Test Milano</field>
<field name="zip">12345</field>
<field name="vat">IT04353580402</field>
<field name="l10n_it_codice_fiscale">04353580402</field>
<field name="city">Milano</field>
<field name="zip">20100</field>
<field name="vat">IT06289781004</field>
<field name="l10n_it_codice_fiscale">06289781004</field>
<field name="l10n_it_pa_index">N8MIMM9</field>
</record>
</data>
</flectra>
+4 -3
View File
@@ -839,6 +839,7 @@ Reason(s) of this behavior could be:
return False
def _find_mail_template(self, force_confirmation_template=False):
self.ensure_one()
template_id = False
if force_confirmation_template or (self.state == 'sale' and not self.env.context.get('proforma', False)):
@@ -899,9 +900,9 @@ Reason(s) of this behavior could be:
if self.env.su:
# sending mail in sudo was meant for it being sent from superuser
self = self.with_user(SUPERUSER_ID)
template_id = self._find_mail_template(force_confirmation_template=True)
if template_id:
for order in self:
for order in self:
template_id = order._find_mail_template(force_confirmation_template=True)
if template_id:
order.with_context(force_send=True).message_post_with_template(template_id, composition_mode='comment', email_layout_xmlid="mail.mail_notification_paynow")
def action_done(self):
+3 -1
View File
@@ -110,7 +110,7 @@ class ThemeMenu(models.Model):
def _convert_to_base_model(self, website, **kwargs):
self.ensure_one()
page_id = self.page_id.copy_ids.filtered(lambda x: x.website_id == website)
parent_id = self.copy_ids.filtered(lambda x: x.website_id == website)
parent_id = self.parent_id.copy_ids.filtered(lambda x: x.website_id == website)
new_menu = {
'name': self.name,
'url': self.url,
@@ -118,6 +118,7 @@ class ThemeMenu(models.Model):
'new_window': self.new_window,
'sequence': self.sequence,
'parent_id': parent_id and parent_id.id or False,
'website_id': website.id,
'theme_template_id': self.id,
}
return new_menu
@@ -143,6 +144,7 @@ class ThemePage(models.Model):
'url': self.url,
'view_id': view_id.id,
'website_indexed': self.website_indexed,
'website_id': website.id,
'theme_template_id': self.id,
}
return new_page