bzr revid: uco@tinyerp.com-20101021045510-3qngb2t7yu0p312f
This commit is contained in:
uco (OpenERP)
2010-10-21 10:25:10 +05:30
9 changed files with 23 additions and 14 deletions
+1 -1
View File
@@ -830,7 +830,7 @@ class account_invoice(osv.osv):
total_fixed += line.value_amount
if line.value == 'procent':
total_percent += line.value_amount
total_fixed = (total_fixed * 100) / inv.amount_total
total_fixed = (total_fixed * 100) / (inv.amount_total or 1.0)
if (total_fixed + total_percent) > 100:
raise osv.except_osv(_('Error !'), _("Cannot create the invoice !\nThe payment term defined gives a computed amount greater than the total invoiced amount."))
@@ -79,9 +79,9 @@ class account_fiscalyear_close(osv.osv_memory):
if not new_journal.default_credit_account_id or not new_journal.default_debit_account_id:
raise osv.except_osv(_('UserError'),
_('The journal must have default credit and debit account'))
if not new_journal.centralisation:
if (not new_journal.centralisation) or new_journal.entry_posted:
raise osv.except_osv(_('UserError'),
_('The journal must have centralised counterpart'))
_('The journal must have centralised counterpart without the Skipping draft state option checked!'))
move_ids = obj_acc_move_line.search(cr, uid, [
('journal_id', '=', new_journal.id), ('period_id.fiscalyear_id', '=', new_fyear.id)])
@@ -10,7 +10,7 @@
<field name="arch" type="xml">
<form string="Validate Account Entries">
<separator string="Validate Journal Entries of a Journal" colspan="4"/>
<label string="All draft account entries in this journal and period will be validated. It means you won't be able to modify their accouting fields." colspan="4"/>
<label string="All draft account entries in this journal and period will be validated. It means you won't be able to modify their accounting fields." colspan="4"/>
<field name="journal_id"/>
<newline/>
<field name="period_id"/>
@@ -49,7 +49,7 @@
<form string="Validate Journal Entries">
<separator string="Post Journal Entries" colspan="4"/>
<image name="terp-referer"/>
<label string="All selected journal entries will be validated and posted. It means you won't be able to modify their accouting fields." colspan="2"/>
<label string="All selected journal entries will be validated and posted. It means you won't be able to modify their accounting fields." colspan="2"/>
<separator colspan="4"/>
<group colspan="4" col="6">
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
+4 -2
View File
@@ -110,6 +110,7 @@ class crossovered_budget_lines(osv.osv):
def _prac_amt(self, cr, uid, ids, context={}):
res = {}
result = 0.0
for line in self.browse(cr, uid, ids):
acc_ids = [x.id for x in line.general_budget_id.account_ids]
if not acc_ids:
@@ -120,10 +121,11 @@ class crossovered_budget_lines(osv.osv):
date_from = context['wizard_date_from']
if context.has_key('wizard_date_to'):
date_to = context['wizard_date_to']
cr.execute("SELECT SUM(amount) FROM account_analytic_line WHERE account_id=%s AND (date "
if line.analytic_account_id.id:
cr.execute("SELECT SUM(amount) FROM account_analytic_line WHERE account_id=%s AND (date "
"between to_date(%s,'yyyy-mm-dd') AND to_date(%s,'yyyy-mm-dd')) AND "
"general_account_id=ANY(%s)", (line.analytic_account_id.id, date_from, date_to,acc_ids,))
result = cr.fetchone()[0]
result = cr.fetchone()[0]
if result is None:
result = 0.00
res[line.id] = result
@@ -131,6 +131,7 @@
<field name="date_to"/>
<field name="paid_date" select="1"/>
<field name="planned_amount" select="1"/>
<field name="analytic_account_id"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
</form>
</field>
+1 -1
View File
@@ -124,7 +124,7 @@ class hr_employee(osv.osv):
flag = False
evaluation_plan = evaluation_plan_obj.browse(cr, uid, [evaluation_plan_id], context=context)[0]
if not evaluation_date:
evaluation_date=(parser.parse(datetime.date.today().strftime('%Y-%m-%d'))+ relativedelta(months=+evaluation_plan.month_first)).strftime('%Y-%m-%d')
evaluation_date=(parser.parse(datetime.now().strftime('%Y-%m-%d'))+ relativedelta(months=+evaluation_plan.month_first)).strftime('%Y-%m-%d')
flag = True
else:
if (parser.parse(evaluation_date) + relativedelta(months = int(evaluation_plan.month_next))).strftime('%Y-%m-%d') <= time.strftime("%Y-%m-%d"):
@@ -319,7 +319,7 @@ class hr_timesheet_sheet(osv.osv):
if r=='month':
return time.strftime('%Y-%m-01')
elif r=='week':
return (datetime.today() + relativedelta(weekday=0)).strftime('%Y-%m-%d')
return (datetime.today() + relativedelta(weekday=0, weeks=-1)).strftime('%Y-%m-%d')
elif r=='year':
return time.strftime('%Y-01-01')
return time.strftime('%Y-%m-%d')
@@ -10,11 +10,12 @@
<field eval="time.strftime('%Y-%m-%d', time.localtime(time.mktime(time.localtime()[0:2] + (0,)*7)-1))" name="date_to"/>
</record>
<!-- record id="sheet1" model="hr_timesheet_sheet.sheet">
<record id="sheet1" model="hr_timesheet_sheet.sheet">
<field name="name">Sheet 1</field>
<field name="user_id" ref="base.user_root"/>
<field name="employee_id" ref="hr.employee1" />
<field eval="time.strftime('%Y-%m-%d')" name="date_current"/>
</record-->
</record>
</data>
</openerp>
@@ -86,21 +86,26 @@ class purchase_requisition_partner(osv.osv_memory):
uom_id = line.product_id.uom_po_id and line.product_id.uom_po_id.id or False
newdate = datetime.strptime(tender.date_start, '%Y-%m-%d %H:%M:%S')
newdate = newdate - relativedelta(days=company.po_lead)
delay = partner_rec and partner_rec.delay or False
newdate = newdate -(delay or datetime.strptime(tender.date_start, '%Y-%m-%d %H:%M:%S') )
delay = partner_rec and partner_rec.delay or 0.0
newdate = newdate -(delay and relativedelta(days=delay) or datetime.strptime(tender.date_start, '%Y-%m-%d %H:%M:%S') )
partner = partner_rec and partner_rec.name or supplier_data
pricelist_id = partner.property_product_pricelist_purchase and partner.property_product_pricelist_purchase.id or False
price = pricelist_obj.price_get(cr, uid, [pricelist_id], line.product_id.id, line.product_qty, False, {'uom': uom_id})[pricelist_id]
product = prod_obj.browse(cr, uid, line.product_id.id, context=context)
location_id = self.pool.get('stock.warehouse').read(cr, uid, [tender.warehouse_id.id], ['lot_input_id'])[0]['lot_input_id'][0]
if not newdate:
date_planned = datetime.strptime(tender.date_start, '%Y-%m-%d %H:%M:%S')
else:
date_planned = newdate.strftime('%Y-%m-%d %H:%M:%S')
purchase_order_line= {
'name': product.partner_ref,
'product_qty': line.product_qty,
'product_id': line.product_id.id,
'product_uom': uom_id,
'price_unit': price,
'date_planned': newdate.strftime('%Y-%m-%d %H:%M:%S'),
'date_planned': date_planned,
'notes': product.description_purchase,
}
taxes_ids = line.product_id.product_tmpl_id.supplier_taxes_id