[IMP] Changed problems with store
bzr revid: jco@openerp.com-20121112173857-k8qws3orgd6fci6y
This commit is contained in:
@@ -22,17 +22,21 @@
|
||||
from osv import fields, osv
|
||||
from datetime import date
|
||||
import time
|
||||
import datetime
|
||||
|
||||
|
||||
from tools.translate import _
|
||||
|
||||
class followup(osv.osv):
|
||||
_name = 'account_followup.followup'
|
||||
_description = 'Account Follow-up'
|
||||
#_rec_name = 'company_id'
|
||||
_columns = {
|
||||
'name': fields.char('Name', size=64, required=True),
|
||||
'name': fields.char('Name', size=64, required=True),
|
||||
|
||||
'description': fields.text('Description'),
|
||||
'followup_line': fields.one2many('account_followup.followup.line', 'followup_id', 'Follow-up'),
|
||||
'company_id': fields.many2one('res.company', 'Company', required=True),
|
||||
'company_id': fields.many2one('res.company', 'Company', required=True),
|
||||
}
|
||||
_defaults = {
|
||||
'company_id': lambda s, cr, uid, c: s.pool.get('res.company')._company_default_get(cr, uid, 'account_followup.followup', context=c),
|
||||
@@ -41,13 +45,13 @@ class followup(osv.osv):
|
||||
|
||||
followup()
|
||||
|
||||
class followup_line(osv.osv):
|
||||
|
||||
|
||||
|
||||
class followup_line(osv.osv):
|
||||
|
||||
def _get_default_template(self, cr, uid, ids, context=None):
|
||||
res = False
|
||||
templ = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'account_followup', 'email_template_account_followup_default')
|
||||
print templ
|
||||
res = templ[1]
|
||||
return res
|
||||
|
||||
@@ -63,7 +67,7 @@ class followup_line(osv.osv):
|
||||
'send_email':fields.boolean('Send email', help="When processing, it will send an email"),
|
||||
'send_letter':fields.boolean('Send letter', help="When processing, it will print a letter"),
|
||||
'manual_action':fields.boolean('Manual action', help="When processing, it will set the manual action to be taken for that customer. "),
|
||||
'manual_action_note':fields.text('Action text', placeholder="e.g. Give a phonecall, check with others , ..."),
|
||||
'manual_action_note':fields.text('Action text', placeholder="e.g. Give a phone call, check with others , ..."),
|
||||
'manual_action_responsible_id':fields.many2one('res.users', 'Responsible', ondelete='set null'),
|
||||
'email_template_id':fields.many2one('email.template', 'Email template', ondelete='set null'),
|
||||
'email_body':fields.related('email_template_id', 'body_html', type='text', string="Email Message", relation="email.template", translate="True"),
|
||||
@@ -153,17 +157,15 @@ class res_partner(osv.osv):
|
||||
|
||||
def _get_latest_followup_date(self, cr, uid, ids, name, arg, context=None):
|
||||
res = {}
|
||||
for partner in self.browse(cr, uid, ids):
|
||||
amls = partner.accountmoveline_ids
|
||||
for partner in self.browse(cr, uid, ids, context):
|
||||
amls = partner.accountmoveline_ids
|
||||
res[partner.id] = max([x.followup_date for x in amls]) if len(amls) else False
|
||||
return res
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def _get_latest_followup_level_id(self, cr, uid, ids, name, arg, context=None):
|
||||
res = {}
|
||||
for partner in self.browse(cr, uid, ids):
|
||||
for partner in self.browse(cr, uid, ids, context):
|
||||
amls = partner.accountmoveline_ids
|
||||
level_id = 0
|
||||
level_days = False
|
||||
@@ -177,23 +179,58 @@ class res_partner(osv.osv):
|
||||
#res[partner.id] = max(x.followup_line_id.delay for x in amls) if len(amls) else False
|
||||
return res
|
||||
|
||||
def _get_latest_followup_level_id_without_lit(self, cr, uid, ids, name, arg, context=None):
|
||||
res = {}
|
||||
for partner in self.browse(cr, uid, ids):
|
||||
|
||||
def _get_latest(self, cr, uid, ids, names, arg, context=None):
|
||||
res={}
|
||||
print "change field"
|
||||
for partner in self.browse(cr, uid, ids, context):
|
||||
amls = partner.accountmoveline_ids
|
||||
level_id = 0
|
||||
level_days = False
|
||||
latest_level = False
|
||||
res[partner.id] = False
|
||||
for accountmoveline in amls:
|
||||
if (not accountmoveline.blocked) and (accountmoveline.followup_line_id != False) and (not level_days or level_days < accountmoveline.followup_line_id.delay):
|
||||
level_days = accountmoveline.followup_line_id.delay
|
||||
latest_level = accountmoveline.followup_line_id.id
|
||||
res[partner.id] = latest_level
|
||||
latest_date = False
|
||||
latest_level = False
|
||||
latest_level_without_lit = False
|
||||
latest_days_without_lit = False
|
||||
for aml in amls:
|
||||
|
||||
if latest_date == False:
|
||||
latest_date = aml.followup_date
|
||||
latest_level = aml.followup_line_id.id
|
||||
latest_days = aml.followup_line_id.delay
|
||||
if not aml.blocked:
|
||||
latest_level_without_lit = latest_level
|
||||
latest_days_without_lit = latest_days
|
||||
if latest_date and latest_level:
|
||||
if aml.followup_date > latest_date:
|
||||
latest_date = aml.followup_date
|
||||
if aml.followup_line_id.delay > latest_days:
|
||||
latest_days = aml.followup_line_id.delay
|
||||
latest_level = aml.followup_line_id.id
|
||||
if not aml.blocked:
|
||||
latest_level_without_lit = latest_level
|
||||
latest_days_without_lit = latest_days
|
||||
res[partner.id] = {'latest_followup_date': latest_date,
|
||||
'latest_followup_level_id': latest_level,
|
||||
'latest_followup_level_id_without_lit': latest_level_without_lit}
|
||||
return res
|
||||
|
||||
|
||||
|
||||
# def _get_latest_followup_level_id_without_lit(self, cr, uid, ids, name, arg, context=None):
|
||||
# res = {}
|
||||
# for partner in self.browse(cr, uid, ids):
|
||||
# amls = partner.accountmoveline_ids
|
||||
# level_id = 0
|
||||
# level_days = False
|
||||
# latest_level = False
|
||||
# res[partner.id] = False
|
||||
# for accountmoveline in amls:
|
||||
# if (not accountmoveline.blocked) and (accountmoveline.followup_line_id != False) and (not level_days or level_days < accountmoveline.followup_line_id.delay):
|
||||
# level_days = accountmoveline.followup_line_id.delay
|
||||
# latest_level = accountmoveline.followup_line_id.id
|
||||
# res[partner.id] = latest_level
|
||||
# return res
|
||||
|
||||
def get_latest_followup_level(self):
|
||||
amls = self.accountmoveline_ids
|
||||
#def get_latest_followup_level(self):
|
||||
# amls = self.accountmoveline_ids
|
||||
|
||||
# def _get_next_followup_level_id_optimized(self, cr, uid, ids, name, arg, context=None):
|
||||
# #Apparently there is still an error in this function
|
||||
@@ -333,25 +370,45 @@ class res_partner(osv.osv):
|
||||
partnerlist.append(aml.partner_id.id)
|
||||
return partnerlist
|
||||
|
||||
def _get_other_aml_storeids(self, cr, uid, ids, context=None):
|
||||
partnerlist = []
|
||||
for aml in self.pool.get("account.move.line").browse(cr, uid, ids, context):
|
||||
if aml.partner_id not in partnerlist:
|
||||
partnerlist.append(aml.partner_id.id)
|
||||
return partnerlist
|
||||
|
||||
_inherit = "res.partner"
|
||||
_columns = {
|
||||
'payment_responsible_id':fields.many2one('res.users', ondelete='set null', string='Responsible', help="Responsible for making sure the action happens."),
|
||||
#'payment_followup_level_id':fields.many2one('account_followup.followup.line', 'Followup line'),
|
||||
'payment_note':fields.text('Payment note', help="Payment Note"),
|
||||
'payment_next_action':fields.char('Next Action', 50, help="This is the next action to be taken by the user. It will automatically be set when the action fields are empty and the partner gets a follow-up level that requires a manual action. "), #Just a note
|
||||
'payment_next_action_date':fields.date('Next Action Date', help="This is when further follow-up is needed. The date will have been set to the current date if the action fields are empty and the partner gets a follow-up level that requires a manual action. "), # next action date
|
||||
'payment_note':fields.text('Payment Note', help="Payment Note"),
|
||||
'payment_next_action':fields.char('Next Action', 50,
|
||||
help="This is the next action to be taken by the user. It will automatically be set when the action fields are empty and the partner gets a follow-up level that requires a manual action. "), #Just an action
|
||||
'payment_next_action_date':fields.date('Next Action Date',
|
||||
help="This is when further follow-up is needed. The date will have been set to the current date if the action fields are empty and the partner gets a follow-up level that requires a manual action. "), # next action date
|
||||
'accountmoveline_ids':fields.one2many('account.move.line', 'partner_id', domain=['&', ('reconcile_id', '=', False), '&',
|
||||
('account_id.active','=', True), '&', ('account_id.type', '=', 'receivable'), ('state', '!=', 'draft')]),
|
||||
'latest_followup_date':fields.function(_get_latest_followup_date, method=True, type='date', string="Latest Follow-up Date", store={'account.move.line': (_get_aml_storeids, ['followup_line_id', 'followup_date'], 20)}, help="Latest date that the follow-up level of the partner was changed" ), #
|
||||
'latest_followup_level_id':fields.function(_get_latest_followup_level_id, method=True,
|
||||
type='many2one', relation='account_followup.followup.line', string="Latest Follow-up Level", store={'account.move.line': (_get_aml_storeids, ['followup_line_id', 'followup_date'], 20)}, help="The maximum follow-up level"),
|
||||
'latest_followup_level_id_without_lit':fields.function(_get_latest_followup_level_id_without_lit, method=True,
|
||||
type='many2one', relation='account_followup.followup.line', string="Latest Follow-up Level without litigation", help="The maximum follow-up level without taking into account the account move lines with litigation"),
|
||||
'next_followup_level_id':fields.function(_get_next_followup_level_id, method=True, type='many2one', relation='account_followup.followup.line', string="Next Level", help="The next follow-up level to come when the customer still refuses to pay", store={'account.move.line': (_get_aml_storeids, ['followup_line_id', 'followup_date'], 20)}),
|
||||
'payment_amount_overdue':fields.function(_get_amount_overdue, method=True, type='float', string="Amount Overdue", help="Amount Overdue: The amount the customer should already have paid"),
|
||||
('account_id.active','=', True), '&', ('account_id.type', '=', 'receivable'), ('state', '!=', 'draft')]),
|
||||
'latest_followup_date':fields.function(_get_latest, method=True, type='date', string="Latest Follow-up Date",
|
||||
help="Latest date that the follow-up level of the partner was changed",
|
||||
store={'account.move.line': (_get_aml_storeids, ['followup_line_id', 'followup_date'], 10)},
|
||||
multi="latest"),
|
||||
'latest_followup_level_id':fields.function(_get_latest, method=True,
|
||||
type='many2one', relation='account_followup.followup.line', string="Latest Follow-up Level",
|
||||
help="The maximum follow-up level",
|
||||
store={'account.move.line': (_get_aml_storeids, ['followup_line_id', 'followup_date'], 10)},
|
||||
multi="latest"),
|
||||
'latest_followup_level_id_without_lit':fields.function(_get_latest, method=True,
|
||||
type='many2one', relation='account_followup.followup.line', string="Latest Follow-up Level without litigation",
|
||||
help="The maximum follow-up level without taking into account the account move lines with litigation",
|
||||
store={'account.move.line': (_get_aml_storeids, ['followup_line_id', 'followup_date'], 10)},
|
||||
multi="latest"),
|
||||
'next_followup_level_id':fields.function(_get_next_followup_level_id, method=True, type='many2one', relation='account_followup.followup.line',
|
||||
string="Next Level", help="The next follow-up level to come when the customer still refuses to pay",
|
||||
store={'account.move.line': (_get_aml_storeids, ['followup_line_id', 'followup_date'], 10)}),
|
||||
'payment_amount_overdue':fields.function(_get_amount_overdue, method=True, type='float', string="Amount Overdue",
|
||||
help="Amount Overdue: The amount the customer should already have paid"),
|
||||
}
|
||||
|
||||
|
||||
res_partner()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
<field name="phone" />
|
||||
<!--<field name="sales" readonly="True"/>-->
|
||||
</group>
|
||||
|
||||
<separator string="Detail of accounts" />
|
||||
<group>
|
||||
<field name="accountmoveline_ids" nolabel="1" > <!--domain="[('reconcile_id', '=', False)]" not necessary-->
|
||||
@@ -58,10 +57,9 @@
|
||||
<group>
|
||||
<field name="payment_note"/>
|
||||
<!--<field name="payment_followup_level_id"/>-->
|
||||
<field name="latest_followup_level_id"/>
|
||||
<field name="latest_followup_level_id"/>
|
||||
<field name="latest_followup_date"/>
|
||||
<field name="next_followup_level_id"/>
|
||||
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
@@ -141,8 +139,8 @@
|
||||
<field name="name">res.partner.followup.form.inherit</field>
|
||||
<field name="inherit_id" ref="base.view_partner_form"/>
|
||||
<field name="model">res.partner</field>
|
||||
<field name="groups_id" eval="[(4, ref('account.group_account_invoice'))]"/><!-- or user? -->
|
||||
<field name="arch" type="xml">
|
||||
<field name="groups_id" eval="[(4, ref('account.group_account_manager'))]"/><!-- or user? -->
|
||||
<field name="arch" type="xml" eval="[(4, ref('account.group_account_manager'))]">
|
||||
<div name="buttons" position="inside">
|
||||
<button name="do_button_print" type="object" string="Print Overdue Payments Report" help="Print overdue payments report independent of follow-up line" attrs="{'invisible':[('payment_amount_overdue', '<=', 0.0)]}"/>
|
||||
<button name="do_button_mail" type="object" string="Send Overdue Email" help="If not specified by the latest follow-up level, it will send from the default follow-up of overdue invoices template" attrs="{'invisible':[('payment_amount_overdue', '<=', 0.0)]}"/>
|
||||
@@ -164,9 +162,10 @@
|
||||
<field name="latest_followup_level_id"/>
|
||||
<field name="latest_followup_date"/>
|
||||
<field name="next_followup_level_id"/>
|
||||
|
||||
<!-- test field
|
||||
<field name="latest_fol"/>
|
||||
<field name="latest_num"/>-->
|
||||
</group>
|
||||
|
||||
<group>
|
||||
<!--<field name="payment_next_action_date" help="This is when further follow-up is needed. The date will have been set to the current date when processing the follow-ups asks for a phone call"/>-->
|
||||
<field name="payment_responsible_id" help="The user who takes responsibility to follow it up. "/>
|
||||
@@ -177,23 +176,14 @@
|
||||
</group>
|
||||
</group>
|
||||
<group>
|
||||
<field name="accountmoveline_ids" nolabel="1" > <!--domain="[('reconcile_id', '=', False)]" not necessary-->
|
||||
<tree string="Account Move line" editable="bottom" colors="red:date_maturity and date_maturity<current_date or date<current_date"> <!---->
|
||||
<field name="accountmoveline_ids" nolabel="1" >
|
||||
<tree string="Account Move line" editable="bottom" colors="red:date_maturity and date_maturity<current_date or date<current_date">
|
||||
<field name="date" readonly="True"/>
|
||||
<field name="move_id" readonly="True"/>
|
||||
<!--<field name="ref" readonly="True"/>-->
|
||||
<!--<field name="debit" readonly="True"/>
|
||||
<field name="credit" readonly="True"/>-->
|
||||
<field name="result" readonly="True"/>
|
||||
<field name="followup_date" readonly="True"/>
|
||||
<!--<field name="followup_line_id" readonly="True"/>-->
|
||||
<field name="blocked" string="Litigation"/>
|
||||
<!--<field name="payment_commitment"/>
|
||||
<field name="payment_date"/>-->
|
||||
<field name="date_maturity" readonly="True"/>
|
||||
<!--<field name="reconcile_id" invisible="True"/>-->
|
||||
<field name="reconcile_partial_id" readonly="True"/>
|
||||
<!--<field name="invoice"/>-->
|
||||
</tree>
|
||||
</field>
|
||||
</group>
|
||||
@@ -201,13 +191,7 @@
|
||||
</page>
|
||||
|
||||
|
||||
<!--<field name="name" position="after">
|
||||
<field name="payment_next_action"/>
|
||||
</field>-->
|
||||
<!--<field name="payment_amount_outstanding" position="after">
|
||||
<separator string="Account Move Lines" colspan="4"/>
|
||||
<field name="accountmoveline_ids" nolabel="1" colspan="4"/>
|
||||
</field>-->
|
||||
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -229,7 +213,7 @@
|
||||
</record>
|
||||
|
||||
<!-- Menus about followup of customers -->
|
||||
<menuitem id="account_followup_" action="action_customer_followup" parent="account.menu_configuration_misc" name="Customer follow up"/>
|
||||
<menuitem id="account_followup_s" action="action_customer_followup" parent="account.menu_finance_periodical_processing_billing" name="Customer Follow-up"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
<!--Mail template level 0-->
|
||||
<record id="email_template_account_followup_level0" model="email.template">
|
||||
<field name="name">Followup of overdue invoices level 0</field>
|
||||
<field name="name">Follow-up of overdue invoices level 0</field>
|
||||
<field name="email_from">${user.email or ''}</field>
|
||||
<field name="subject">${object.company_id.name} Payments Follow-up</field>
|
||||
<field name="email_to">${object.email}</field>
|
||||
@@ -78,7 +78,7 @@ ${mel[aml.id]}
|
||||
|
||||
|
||||
</table>
|
||||
<center>Total overdue amount: ${object.payment_amount_overdue} </center>
|
||||
<center>Total overdue amount: ${object.payment_amount_overdue} ${object.company_id.currency_id.name} </center>
|
||||
<br/>
|
||||
</div>
|
||||
]]></field>
|
||||
@@ -88,7 +88,7 @@ ${mel[aml.id]}
|
||||
|
||||
<!--Mail template level 1 -->
|
||||
<record id="email_template_account_followup_level1" model="email.template">
|
||||
<field name="name">Followup of overdue invoices level 1</field>
|
||||
<field name="name">Follow-up of overdue invoices level 1</field>
|
||||
<field name="email_from">${user.email or ''}</field>
|
||||
<field name="subject">${object.company_id.name} Payments Follow-up</field>
|
||||
<field name="email_to">${object.email}</field>
|
||||
@@ -162,14 +162,14 @@ ${mel[aml.id]}
|
||||
|
||||
|
||||
</table>
|
||||
<center>Total overdue amount: ${object.payment_amount_overdue} </center>
|
||||
<center>Total overdue amount: ${object.payment_amount_overdue} ${object.company_id.currency_id.name} </center>
|
||||
<br/>
|
||||
</div>
|
||||
]]></field>
|
||||
</record>
|
||||
<!--Email template -->
|
||||
<record id="email_template_account_followup_level2" model="email.template">
|
||||
<field name="name">Followup of overdue invoices level 2</field>
|
||||
<field name="name">Follow-up of overdue invoices level 2</field>
|
||||
<field name="email_from">${user.email or ''}</field>
|
||||
<field name="subject">${object.company_id.name} Payments Follow-up</field>
|
||||
<field name="email_to">${object.email}</field>
|
||||
@@ -241,7 +241,7 @@ ${mel[aml.id]}
|
||||
|
||||
|
||||
</table>
|
||||
<center>Total overdue amount: ${object.payment_amount_overdue} </center>
|
||||
<center>Total overdue amount: ${object.payment_amount_overdue} ${object.company_id.currency_id.name} </center>
|
||||
<br/>
|
||||
<br/>
|
||||
</div>
|
||||
@@ -323,7 +323,7 @@ ${mel[aml.id]}
|
||||
% endfor
|
||||
|
||||
</table>
|
||||
<center>Total overdue amount: ${object.payment_amount_overdue} </center>
|
||||
<center>Total overdue amount: ${object.payment_amount_overdue} ${object.company_id.currency_id.name} </center>
|
||||
<br/>
|
||||
</div>
|
||||
]]></field>
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
</div>
|
||||
</group>
|
||||
<div class="oe_grey">
|
||||
<label string="When the follow-up sending wizard is run, for every partner the most overdue invoice is checked. If the amount of days overdue is greater or equal than the amount of days specified above
|
||||
<label string="When the wizard for processing the follow-ups is run, for every partner the most overdue invoice (without litigation) is checked. If the amount of days overdue is greater or equal than the amount of days specified above
|
||||
and the actions of the previous follow-up level were done, then the actions checked below will be executed. "/>
|
||||
</div>
|
||||
<separator string="Processing actions"/>
|
||||
@@ -168,11 +168,11 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<act_window domain="[('reconcile_id', '=', False),('account_id.type','=','receivable')]" id="act_account_partner_account_move_all" name="Receivable Items" res_model="account.move.line" src_model="" view_id="account_move_line_partner_tree"/>
|
||||
<act_window domain="[('reconcile_id', '=', False),('account_id.type','=','receivable')]" id="act_account_partner_account_move_all" name="Receivable Items" res_model="account.move.line" src_model="" view_id="account_move_line_partner_tree"/>
|
||||
|
||||
<!--<menuitem action="act_account_partner_account_move_all" id="menu_account_move_open_unreconcile" parent="account_followup.menu_action_followup_stat"/> -->
|
||||
<!-- <menuitem action="act_account_partner_account_move_all" id="menu_account_move_open_unreconcile" parent="account_followup.menu_action_followup_stat"/> -->
|
||||
|
||||
<act_window domain="[('reconcile_id', '=', False), ('account_id.type','=','payable')]" id="act_account_partner_account_move_payable_all" name="Payable Items" res_model="account.move.line" src_model="" view_id="account_move_line_partner_tree"/>
|
||||
<act_window domain="[('reconcile_id', '=', False), ('account_id.type','=','payable')]" id="act_account_partner_account_move_payable_all" name="Payable Items" res_model="account.move.line" src_model="" view_id="account_move_line_partner_tree"/>
|
||||
|
||||
<!-- <menuitem action="act_account_partner_account_move_payable_all" id="menu_account_move_open_unreconcile_payable" parent="account_followup.menu_action_followup_stat"/> -->
|
||||
|
||||
|
||||
@@ -27,14 +27,4 @@
|
||||
Unnecessary test of invoice
|
||||
-
|
||||
!assert {model: account.invoice, id: account.demo_invoice_0}:
|
||||
- check_total == 14.0
|
||||
-
|
||||
Test latest followup level changed Python
|
||||
-
|
||||
!python {model: res.partner, id: base.res_partner_12}: |
|
||||
assert(latest_followup_level_id == ref("demo_followup_line1"))
|
||||
-
|
||||
Test latest followup level changed
|
||||
-
|
||||
!assert {model: res.partner, id: base.res_partner_12} :
|
||||
- latest_followup_level_id == ref("demo_followup_line1")
|
||||
- check_total == 14.0
|
||||
@@ -142,12 +142,13 @@ class account_followup_print(osv.osv_memory):
|
||||
#update the followupo level on account.move.line
|
||||
for id in to_update.keys():
|
||||
if to_update[id]['partner_id'] in partner_list:
|
||||
cr.execute(
|
||||
"UPDATE account_move_line "\
|
||||
"SET followup_line_id=%s, followup_date=%s "\
|
||||
"WHERE id=%s",
|
||||
(to_update[id]['level'],
|
||||
date, int(id),))
|
||||
self.pool.get('account.move.line').write(cr, uid, [int(id)], {'followup_line_id': to_update[id]['level'], 'followup_date': date})
|
||||
# cr.execute(
|
||||
# "UPDATE account_move_line "\
|
||||
# "SET followup_line_id=%s, followup_date=%s "\
|
||||
# "WHERE id=%s",
|
||||
# (to_update[id]['level'],
|
||||
# date, int(id),))
|
||||
|
||||
def do_process(self, cr, uid, ids, context=None):
|
||||
tmp = self._get_partners_followp(cr, uid, ids, context=context)
|
||||
@@ -250,6 +251,8 @@ class account_followup_print(osv.osv_memory):
|
||||
return {'partner_ids': partner_list, 'to_update': to_update}
|
||||
|
||||
|
||||
|
||||
#OLD FUNCTION!
|
||||
def do_print(self, cr, uid, ids, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
@@ -261,12 +264,13 @@ class account_followup_print(osv.osv_memory):
|
||||
if not data['test_print']:
|
||||
for id in to_update.keys():
|
||||
if to_update[id]['partner_id'] in data['partner_ids']:
|
||||
cr.execute(
|
||||
"UPDATE account_move_line "\
|
||||
"SET followup_line_id=%s, followup_date=%s "\
|
||||
"WHERE id=%s",
|
||||
(to_update[id]['level'],
|
||||
date, int(id),))
|
||||
self.pool.get('account.move.line').write(cr, uid, [int(id)], {'followup_line_id': to_update[id], 'followup_date': date})
|
||||
# cr.execute(
|
||||
# "UPDATE account_move_line "\
|
||||
# "SET followup_line_id=%s, followup_date=%s "\
|
||||
# "WHERE id=%s",
|
||||
# (to_update[id]['level'],
|
||||
# date, int(id),))
|
||||
data.update({'date': context['date']})
|
||||
datas = {
|
||||
'ids': [],
|
||||
|
||||
Reference in New Issue
Block a user