pterm_list.sort()
res = {'value':{'date_due': pterm_list[-1]}}
else:
- raise osv.except_osv(_('Data Insufficient !'), _('The payment term of supplier does not have a payment term line!'))
+ raise osv.except_osv(_('Insufficient Data!'), _('The payment term of supplier does not have a payment term line.'))
return res
def onchange_invoice_line(self, cr, uid, ids, lines):
description = inv.name
if not period:
- raise osv.except_osv(_('Data Insufficient !'), \
+ raise osv.except_osv(_('Insufficient Data!'), \
_('No period found on the invoice.'))
refund_id = inv_obj.refund(cr, uid, [inv.id], date, period, description, journal_id)
('user_id', 'in', data['form']['employee_ids']),
], context=context)
if not ids_chk:
- raise osv.except_osv(_('Data Insufficient!'), _('No record(s) found for Report!'))
+ raise osv.except_osv(_('Insufficient Data!'), _('No record(s) found for this report.'))
data['form']['journal_ids'] = [(6, 0, data['form']['journal_ids'])] # Improve me => Change the rml/sxw so that it can support withou [0][2]
data['form']['employee_ids'] = [(6, 0, data['form']['employee_ids'])]
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
-#
-# Adapted by Noviat to
+#
+# Adapted by Noviat to
# - enforce correct vat number
# - support negative balance
# - assign amount of tax code 71-72 correclty to grid 71 or 72
obj_company = obj_user.browse(cr, uid, uid, context=context).company_id
vat_no = obj_company.partner_id.vat
if not vat_no:
- raise osv.except_osv(_('Data Insufficient'), _('No VAT Number Associated with Main Company!'))
+ raise osv.except_osv(_('Insufficient Data!'), _('No VAT Number Associated with Main Company.'))
vat_no = vat_no.replace(' ','').upper()
vat = vat_no[2:]
quarter = str(((int(starting_month) - 1) / 3) + 1)
if not email:
- raise osv.except_osv(_('Data Insufficient!'),_('No email address associated with the company.'))
+ raise osv.except_osv(_('Insufficient Data!'),_('No email address associated with the company.'))
if not phone:
- raise osv.except_osv(_('Data Insufficient!'),_('No phone associated with the company.'))
+ raise osv.except_osv(_('Insufficient Data!'),_('No phone associated with the company.'))
file_data = {
'issued_by': issued_by,
'vat_no': vat_no,
'ask_payment': (data['ask_payment'] and 'YES' or 'NO'),
'comments': comments,
}
-
+
data_of_file = """<?xml version="1.0"?>
<ns2:VATConsignment xmlns="http://www.minfin.fgov.be/InputCommon" xmlns:ns2="http://www.minfin.fgov.be/VATConsignment" VATDeclarationsNbr="1">
<ns2:Representative>
'amount': str(abs(item['sum_period'])),
}
data_of_file += '\n\t\t\t<ns2:Amount GridNumber="%(code)s">%(amount)s</ns2:Amount''>' % (grid_amount_data)
-
+
data_of_file += '\n\t\t</ns2:Data>'
data_of_file += '\n\t\t<ns2:ClientListingNihil>%(client_nihil)s</ns2:ClientListingNihil>' % (file_data)
data_of_file += '\n\t\t<ns2:Ask Restitution="%(ask_restitution)s" Payment="%(ask_payment)s"/>' % (file_data)
# Corrections & modifications by Noviat nv/sa, (http://www.noviat.be):
# - VAT listing based upon year in stead of fiscal year
# - sql query adapted to select only 'tax-out' move lines
-# - extra button to print readable PDF report
+# - extra button to print readable PDF report
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
company_id = self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.id
period_ids = obj_period.search(cr, uid, [('date_start' ,'>=', date_start), ('date_stop','<=',date_stop), ('company_id','=',company_id)])
if not period_ids:
- raise osv.except_osv(_('Data Insufficient!'), _('No data for the selected Year.'))
+ raise osv.except_osv(_('Insufficient Data!'), _('No data for the selected year.'))
partners = []
partner_ids = obj_partner.search(cr, uid, [('vat_subjected', '!=', False), ('vat','ilike','BE%')], context=context)
FROM account_move_line l2
LEFT JOIN account_tax_code c2 ON l2.tax_code_id = c2.id
WHERE c2.code IN ('54','64')
- AND l2.partner_id IN %s
+ AND l2.partner_id IN %s
AND l2.period_id IN %s
GROUP BY l2.partner_id) AS sub2 ON sub1.partner_id = sub2.partner_id
""",(tuple(partner_ids),tuple(period_ids),tuple(partner_ids),tuple(period_ids)))
company_vat = obj_cmpny.partner_id.vat
if not company_vat:
- raise osv.except_osv(_('Data Insufficient'),_('No VAT Number Associated with Main Company!'))
+ raise osv.except_osv(_('Insufficient Data!'),_('No VAT number associated with the company.'))
company_vat = company_vat.replace(' ','').upper()
SenderId = company_vat[2:]
comp_name = obj_cmpny.name
if not email:
- raise osv.except_osv(_('Data Insufficient!'),_('No email address associated with the company.'))
+ raise osv.except_osv(_('Insufficient Data!'),_('No email address associated with the company.'))
if not phone:
- raise osv.except_osv(_('Data Insufficient!'),_('No phone associated with the company.'))
+ raise osv.except_osv(_('Insufficient Data!'),_('No phone associated with the company.'))
annual_listing_data = {
'issued_by': issued_by,
'company_vat': company_vat,
<VATNumber>%(SenderId)s</VATNumber>
<Name>%(comp_name)s</Name>
<Street>%(street)s</Street>
- <PostCode>%(zip)s</PostCode>
- <City>%(city)s</City>
- <CountryCode>%(country)s</CountryCode>
- <EmailAddress>%(email)s</EmailAddress>
- <Phone>%(phone)s</Phone>
+ <PostCode>%(zip)s</PostCode>
+ <City>%(city)s</City>
+ <CountryCode>%(country)s</CountryCode>
+ <EmailAddress>%(email)s</EmailAddress>
+ <Phone>%(phone)s</Phone>
</ns2:Declarant>
<ns2:Period>%(period)s</ns2:Period>
""" % annual_listing_data
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
-# Adapted by Noviat to
+# Adapted by Noviat to
# - make the 'mand_id' field optional
# - support Noviat tax code scheme
#
data_company = wiz_data.tax_code_id.company_id
else:
data_company = obj_user.browse(cr, uid, uid, context=context).company_id
-
+
# Get Company vat
company_vat = data_company.partner_id.vat
if not company_vat:
- raise osv.except_osv(_('Data Insufficient'),_('No VAT Number Associated with Main Company!'))
+ raise osv.except_osv(_('Insufficient Data!'),_('No VAT number associated with the company.'))
company_vat = company_vat.replace(' ','').upper()
issued_by = company_vat[:2]
if len(wiz_data.period_code) != 6:
- raise osv.except_osv(_('Wrong Period Code'), _('Period code is not valid.'))
+ raise osv.except_osv(_('Error!'), _('Period code is not valid.'))
if not wiz_data.period_ids:
- raise osv.except_osv(_('Data Insufficient!'),_('Please select at least one Period.'))
+ raise osv.except_osv(_('Insufficient Data!'),_('Please select at least one Period.'))
p_id_list = obj_partner.search(cr, uid, [('vat','!=',False)], context=context)
if not p_id_list:
- raise osv.except_osv(_('Data Insufficient!'),_('No partner has a VAT Number asociated with him.'))
+ raise osv.except_osv(_('Insufficient Data!'),_('No partner has a VAT number asociated with him.'))
seq_declarantnum = obj_sequence.get(cr, uid, 'declarantnum')
dnum = company_vat[2:] + seq_declarantnum[-4:]
if not country:
country = company_vat[:2]
if not email:
- raise osv.except_osv(_('Data Insufficient!'),_('No email address associated with the company.'))
+ raise osv.except_osv(_('Insufficient Data!'),_('No email address associated with the company.'))
if not phone:
- raise osv.except_osv(_('Data Insufficient!'),_('No phone associated with the company.'))
+ raise osv.except_osv(_('Insufficient Data!'),_('No phone associated with the company.'))
xmldict.update({
'company_name': data_company.name,
- 'company_vat': company_vat,
+ 'company_vat': company_vat,
'vatnum': company_vat[2:],
- 'mand_id': wiz_data.mand_id,
+ 'mand_id': wiz_data.mand_id,
'sender_date': str(time.strftime('%Y-%m-%d')),
'street': street,
'city': city,
'email': email,
'phone': phone.replace('/','').replace('.','').replace('(','').replace(')','').replace(' ',''),
'period': wiz_data.period_code,
- 'clientlist': [],
+ 'clientlist': [],
'comments': comments,
'issued_by': issued_by,
})
-
+
codes = ('44', '46L', '46T', '48s44', '48s46L', '48s46T')
- cr.execute('''SELECT p.name As partner_name, l.partner_id AS partner_id, p.vat AS vat,
+ cr.execute('''SELECT p.name As partner_name, l.partner_id AS partner_id, p.vat AS vat,
(CASE WHEN t.code = '48s44' THEN '44'
WHEN t.code = '48s46L' THEN '46L'
WHEN t.code = '48s46T' THEN '46T'
xmldict['clientlist'].append({
'partner_name': row['partner_name'],
- 'seq': seq,
- 'vatnum': row['vat'][2:].replace(' ','').upper(),
+ 'seq': seq,
+ 'vatnum': row['vat'][2:].replace(' ','').upper(),
'vat': row['vat'],
'country': row['vat'][:2],
'amount': amt,
data_clientinfo = ''
for client in xml_data['clientlist']:
if not client['vatnum']:
- raise osv.except_osv(_('Data Insufficient!'),_('No vat number defined for %s') % client['partner_name'])
+ raise osv.except_osv(_('Insufficient Data!'),_('No vat number defined for %s.') % client['partner_name'])
data_clientinfo +='\n\t\t<ns2:IntraClient SequenceNumber="%(seq)s">\n\t\t\t<ns2:CompanyVATNumber issuedBy="%(country)s">%(vatnum)s</ns2:CompanyVATNumber>\n\t\t\t<ns2:Code>%(code)s</ns2:Code>\n\t\t\t<ns2:Amount>%(amount)s</ns2:Amount>\n\t\t</ns2:IntraClient>' % (client)
data_decl = '\n\t<ns2:IntraListing SequenceNumber="1" ClientsNbr="%(clientnbr)s" DeclarantReference="%(dnum)s" AmountSum="%(amountsum)s">' % (xml_data)
"""
return all(procurement.move_id.state == 'cancel' for procurement in self.browse(cr, uid, ids, context=context))
- #This Function is create to avoid a server side Error Like 'ERROR:tests.mrp:name 'check_move' is not defined'
+ #This Function is create to avoid a server side Error Like 'ERROR:tests.mrp:name 'check_move' is not defined'
def check_move(self, cr, uid, ids, context=None):
pass
if not res:
return False
return True
-
+
def check_buy(self, cr, uid, ids):
""" Checks product type.
@return: True or Product Id.
move_obj = self.pool.get('stock.move')
for procurement in self.browse(cr, uid, ids, context=context):
if procurement.product_qty <= 0.00:
- raise osv.except_osv(_('Data Insufficient !'),
- _('Please check the quantity in procurement order(s), it should not be 0 or less!'))
+ raise osv.except_osv(_('Insufficient Data!'),
+ _('Please check the quantity in procurement order(s), it should not be 0 or less.'))
if procurement.product_id.type in ('product', 'consu'):
if not procurement.move_id:
source = procurement.location_id.id
message = _('From stock: products assigned.')
self.write(cr, uid, ids, {'state': 'running',
'message': message}, context=context)
- self.message_append_note(cr, uid, ids, body=message, context=context)
+ self.message_append_note(cr, uid, ids, body=message, context=context)
self.running_send_note(cr, uid, ids, context=context)
return True
if message:
message = _("Procurement '%s' is in exception: ") % (procurement.name) + message
cr.execute('update procurement_order set message=%s where id=%s', (message, procurement.id))
- self.message_append_note(cr, uid, [procurement.id], body=message, context=context)
+ self.message_append_note(cr, uid, [procurement.id], body=message, context=context)
return ok
def action_produce_assign_service(self, cr, uid, ids, context=None):
v = {'product_uom': prod.uom_id.id}
return {'value': v}
return {}
-
+
def copy(self, cr, uid, id, default=None, context=None):
if not default:
default = {}
'name': self.pool.get('ir.sequence').get(cr, uid, 'stock.orderpoint') or '',
})
return super(stock_warehouse_orderpoint, self).copy(cr, uid, id, default, context=context)
-
+
stock_warehouse_orderpoint()
class product_product(osv.osv):
['default', 'invoice', 'delivery', 'contact'])
pricelist = partner.property_product_pricelist.id
if False in partner_addr.values():
- raise osv.except_osv(_('Data Insufficient!'), _('Customer has no addresses defined!'))
-
+ raise osv.except_osv(_('Insufficient Data!'), _('No addresse(s) defined for this customer.'))
+
vals = {
'origin': _('Opportunity: %s') % str(case.id),
'section_id': case.section_id and case.section_id.id or False,