Merge pull request #58 from expsa/dev_odex25_accounting
Dev odex25 accounting
This commit is contained in:
commit
51884ef7be
|
|
@ -2,7 +2,7 @@
|
|||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import api, fields, models, _
|
||||
from odoo.exceptions import UserError, ValidationError, Warning
|
||||
from odoo.exceptions import ValidationError, Warning
|
||||
|
||||
|
||||
class CrossoveredBudget(models.Model):
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from odoo import _, api, fields, models
|
||||
from odoo.exceptions import ValidationError
|
||||
from odoo.exceptions import ValidationError
|
||||
from odoo.osv import expression
|
||||
from dateutil.relativedelta import relativedelta
|
||||
|
||||
|
|
@ -304,7 +304,7 @@ class AccountFiscalYear(models.Model):
|
|||
"""
|
||||
for rec in self:
|
||||
if rec.state != 'draft':
|
||||
raise UserError(
|
||||
raise ValidationError(
|
||||
_('You cannot delete a fiscal year not in draft state.'))
|
||||
rec.periods_ids.unlink()
|
||||
return super().unlink()
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from odoo import _, api, fields, models
|
||||
from odoo.exceptions import ValidationError
|
||||
from odoo.exceptions import ValidationError
|
||||
from odoo.osv import expression
|
||||
|
||||
|
||||
|
|
@ -114,7 +114,7 @@ class fiscalyears_periods(models.Model):
|
|||
"""
|
||||
for rec in self:
|
||||
if rec.state != 'draft':
|
||||
raise UserError(
|
||||
raise ValidationError(
|
||||
_('You cannot delete a period not in draft state.'))
|
||||
|
||||
self.env['ir.translation'].search([('name', '=', "fiscalyears.periods,name"),
|
||||
|
|
@ -127,7 +127,7 @@ class fiscalyears_periods(models.Model):
|
|||
"""
|
||||
for rec in self:
|
||||
if rec.fiscalyear_id.state not in ['open']:
|
||||
raise UserError(
|
||||
raise ValidationError(
|
||||
_('''You cannot open a period where the fiscalyear not in open state.'''))
|
||||
rec.state = 'open'
|
||||
|
||||
|
|
|
|||
|
|
@ -210,17 +210,12 @@
|
|||
|
||||
<menuitem name="Petty Cash"
|
||||
id="menu_petty_cash_root"
|
||||
action="action_petty_cash"
|
||||
groups="hr_expense_petty_cash.group_petty_cash_manager,hr_expense_petty_cash.group_petty_cash_user"
|
||||
web_icon="hr_expense_petty_cash,static/description/odoo_icon.png"
|
||||
sequence="40"/>
|
||||
sequence="1"/>
|
||||
|
||||
|
||||
<menuitem
|
||||
id="menu_petty_cash"
|
||||
name="Petty Cash"
|
||||
action="action_petty_cash"
|
||||
parent="menu_petty_cash_root"
|
||||
sequence="1"
|
||||
/>
|
||||
<record id="hr_employee_form_inherit" model="ir.ui.view">
|
||||
<field name="name">hr_employee.extend.form</field>
|
||||
<field name="model">hr.employee</field>
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@ class AccountMove(models.Model):
|
|||
str_to_encode = seller_name_enc + company_vat_enc + timestamp_enc + invoice_total_enc + total_vat_enc
|
||||
qr_code_str = base64.b64encode(str_to_encode).decode('UTF-8')
|
||||
record.qr_string = qr_code_str
|
||||
record.l10n_sa_qr_code_str = qr_code_str
|
||||
|
||||
@api.depends('line_ids.sale_line_ids')
|
||||
def _get_sale_orders(self):
|
||||
|
|
@ -110,7 +111,7 @@ class AccountMove(models.Model):
|
|||
partner_name = rec.partner_id.name
|
||||
else:
|
||||
partner_name = rec.partner_id.name
|
||||
partner_name = str(_('اسم المورد: \t \t ' + partner_name))
|
||||
partner_name = str(_('اسم المورد: \t \t ' + str(partner_name) ))
|
||||
partner_vat = "##########"
|
||||
if rec.move_type in ['out_invoice', 'in_refund']:
|
||||
if rec.company_id.partner_id.vat:
|
||||
|
|
@ -120,14 +121,14 @@ class AccountMove(models.Model):
|
|||
if rec.partner_id.vat:
|
||||
partner_vat = rec.partner_id.vat
|
||||
|
||||
partner_vat = str(_('رقم تسجيل ضريبة: \t \t ' + partner_vat))
|
||||
partner_vat = str(_('رقم تسجيل ضريبة: \t \t ' + str(partner_vat)))
|
||||
|
||||
currency_total = ''.join([rec.currency_id.name, str(rec.amount_total)])
|
||||
total = str(_('إجمالي الفاتورة: \t \t ' + currency_total))
|
||||
total = str(_('إجمالي الفاتورة: \t \t ' + str(currency_total)))
|
||||
currency_tax = ''.join([rec.currency_id.name, str(rec.amount_tax)])
|
||||
tax = str(_('إجمالي ضريبة القيمة المضافة: \t \t ' + currency_tax))
|
||||
tax = str(_('إجمالي ضريبة القيمة المضافة: \t \t ' + str(currency_tax)))
|
||||
date_invoice = str(rec.invoice_date)
|
||||
date = str(_('الطابع الزمني للفاتورة: \t \t ' + date_invoice))
|
||||
date = str(_('الطابع الزمني للفاتورة: \t \t ' + str(date_invoice)))
|
||||
lf = '\n\n'
|
||||
ibanqr = lf.join([partner_name, partner_vat, date, total, tax])
|
||||
rec.qr_image = generate_qr_code(ibanqr)
|
||||
|
|
|
|||
Loading…
Reference in New Issue