commit
108bdfb958
|
@ -559,12 +559,12 @@ class account_move_line(osv.osv):
|
|||
GROUP BY account_id,reconcile_id')
|
||||
r = cr.fetchall()
|
||||
#TODO: move this check to a constraint in the account_move_reconcile object
|
||||
if (len(r) != 1) and context.get('same_account', True):
|
||||
if (len(r) != 1) and not context.get('fy_closing', False):
|
||||
raise osv.except_osv(_('Error'), _('Entries are not of the same account or already reconciled ! '))
|
||||
if not unrec_lines:
|
||||
raise osv.except_osv(_('Error'), _('Entry is already reconciled'))
|
||||
account = self.pool.get('account.account').browse(cr, uid, account_id, context=context)
|
||||
if not account.reconcile:
|
||||
if not context.get('fy_closing', False) and not account.reconcile:
|
||||
raise osv.except_osv(_('Error'), _('The account is not defined to be reconcile !'))
|
||||
if r[0][1] != None:
|
||||
raise osv.except_osv(_('Error'), _('Some entries are already reconciled !'))
|
||||
|
|
|
@ -427,6 +427,8 @@ class account_invoice(osv.osv):
|
|||
return ok
|
||||
|
||||
def button_reset_taxes(self, cr, uid, ids, context=None):
|
||||
if not context:
|
||||
context = {}
|
||||
ait_obj = self.pool.get('account.invoice.tax')
|
||||
for id in ids:
|
||||
cr.execute("DELETE FROM account_invoice_tax WHERE invoice_id=%s", (id,))
|
||||
|
|
|
@ -56,13 +56,13 @@ def _data_save(self, cr, uid, data, context):
|
|||
pool = pooler.get_pool(cr.dbname)
|
||||
|
||||
fy_id = data['form']['fy_id']
|
||||
new_fyear = pool.get('account.fiscalyear').browse(cr, uid, data['form']['fy2_id'])
|
||||
period_ids = pool.get('account.period').search(cr, uid, [('fiscalyear_id', '=', fy_id)])
|
||||
fy_period_set = ','.join(map(str, period_ids))
|
||||
periods_fy2 = pool.get('account.period').search(cr, uid, [('fiscalyear_id', '=', data['form']['fy2_id'])])
|
||||
fy2_period_set = ','.join(map(str, periods_fy2))
|
||||
|
||||
periods_fy2 = new_fyear.period_ids
|
||||
if not periods_fy2:
|
||||
raise wizard.except_wizard(_('UserError'),
|
||||
_('There are no periods defined on New Fiscal Year.'))
|
||||
period=periods_fy2[0]
|
||||
period = pool.get('account.period').browse(cr, uid, data['form']['period_id'], context=context)
|
||||
new_fyear = pool.get('account.fiscalyear').browse(cr, uid, data['form']['fy2_id'], context=context)
|
||||
|
||||
new_journal = data['form']['journal_id']
|
||||
new_journal = pool.get('account.journal').browse(cr, uid, new_journal, context=context)
|
||||
|
@ -87,6 +87,7 @@ def _data_save(self, cr, uid, data, context):
|
|||
ids = map(lambda x: x[0], cr.fetchall())
|
||||
for account in pool.get('account.account').browse(cr, uid, ids,
|
||||
context={'fiscalyear': fy_id}):
|
||||
|
||||
accnt_type_data = account.user_type
|
||||
if not accnt_type_data:
|
||||
continue
|
||||
|
@ -120,7 +121,40 @@ def _data_save(self, cr, uid, data, context):
|
|||
if not result:
|
||||
break
|
||||
for move in result:
|
||||
parent_id = move['id']
|
||||
move.pop('id')
|
||||
move.update({
|
||||
'date': period.date_start,
|
||||
'journal_id': new_journal.id,
|
||||
'period_id': period.id,
|
||||
})
|
||||
pool.get('account.move.line').create(cr, uid, move, {
|
||||
'journal_id': new_journal.id,
|
||||
'period_id': period.id,
|
||||
})
|
||||
offset += limit
|
||||
|
||||
#We have also to consider all move_lines that were reconciled
|
||||
#on another fiscal year, and report them too
|
||||
offset = 0
|
||||
limit = 100
|
||||
while True:
|
||||
#TODO: this query could be improved in order to work if there is more than 2 open FY
|
||||
# a.period_id IN ('+fy2_period_set+') is the problematic clause
|
||||
cr.execute('SELECT b.id, b.name, b.quantity, b.debit, b.credit, b.account_id, b.ref, ' \
|
||||
'b.amount_currency, b.currency_id, b.blocked, b.partner_id, ' \
|
||||
'b.date_maturity, b.date_created ' \
|
||||
'FROM account_move_line a, account_move_line b ' \
|
||||
'WHERE b.account_id = %s ' \
|
||||
'AND b.reconcile_id is NOT NULL ' \
|
||||
'AND a.reconcile_id = b.reconcile_id ' \
|
||||
'AND b.period_id IN ('+fy_period_set+') ' \
|
||||
'AND a.period_id IN ('+fy2_period_set+') ' \
|
||||
'ORDER BY id ' \
|
||||
'LIMIT %s OFFSET %s', (account.id, limit, offset))
|
||||
result = cr.dictfetchall()
|
||||
if not result:
|
||||
break
|
||||
for move in result:
|
||||
move.pop('id')
|
||||
move.update({
|
||||
'date': period.date_start,
|
||||
|
@ -148,7 +182,6 @@ def _data_save(self, cr, uid, data, context):
|
|||
if not result:
|
||||
break
|
||||
for move in result:
|
||||
parent_id = move['id']
|
||||
move.pop('id')
|
||||
move.update({
|
||||
'date': period.date_start,
|
||||
|
@ -160,10 +193,8 @@ def _data_save(self, cr, uid, data, context):
|
|||
|
||||
ids = pool.get('account.move.line').search(cr, uid, [('journal_id','=',new_journal.id),
|
||||
('period_id.fiscalyear_id','=',new_fyear.id)])
|
||||
|
||||
context['same_account'] = False
|
||||
context['fy_closing'] = True
|
||||
pool.get('account.move.line').reconcile(cr, uid, ids, context=context)
|
||||
|
||||
new_period = data['form']['period_id']
|
||||
ids = pool.get('account.journal.period').search(cr, uid, [('journal_id','=',new_journal.id),('period_id','=',new_period)])
|
||||
if ids:
|
||||
|
|
|
@ -451,6 +451,7 @@ class account_analytic_account_summary_user(osv.osv):
|
|||
'user' : fields.many2one('res.users', 'User'),
|
||||
}
|
||||
def init(self, cr):
|
||||
tools.sql.drop_view_if_exists(cr, 'account_analytic_analysis_summary_user')
|
||||
cr.execute('CREATE OR REPLACE VIEW account_analytic_analysis_summary_user AS (' \
|
||||
'SELECT ' \
|
||||
'(u.account_id * u.max_user) + u."user" AS id, ' \
|
||||
|
|
|
@ -45,8 +45,8 @@
|
|||
'update_xml': [
|
||||
'security/ir.model.access.csv',
|
||||
'wizard/wizard_view.xml',
|
||||
'followup_report_view.xml',
|
||||
'followup_view.xml',
|
||||
'followup_report_view.xml'
|
||||
],
|
||||
'demo_xml': ['followup_demo.xml'],
|
||||
'installable': True,
|
||||
|
|
|
@ -31,13 +31,9 @@
|
|||
<separator string="Legend" colspan="4"/>
|
||||
|
||||
<label string="%%(partner_name)s: Partner name" colspan="2"/>
|
||||
<label string="%%(user_signature)s: User name" colspan="2"/>
|
||||
<label string="%%(followup_amount)s: Total Amount Due" colspan="2"/>
|
||||
<label string="%%(date)s: Current Date" colspan="2"/>
|
||||
<label string="%%(user_signature)s: User name" colspan="2"/>
|
||||
<label string="%%(company_name)s: User's Company name" colspan="2"/>
|
||||
<label string="%%(company_currency)s: User's Company Currency" colspan="2"/>
|
||||
<label string="%%(heading)s: Move line header" colspan="2"/>
|
||||
<label string="%%(line)s: Account Move lines" colspan="2"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
@ -134,11 +130,11 @@
|
|||
|
||||
<act_window domain="[('reconcile_id', '=', False),('account_id.type','=','receivable')]" id="act_account_partner_account_move_all" name="All receivable entries" res_model="account.move.line" src_model="" view="account_move_line_partner_tree"/>
|
||||
|
||||
<menuitem action="act_account_partner_account_move_all" id="menu_account_move_open_unreconcile" parent="account_followup.account_followup_wizard_menu"/>
|
||||
<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="All payable entries" res_model="account.move.line" src_model="" view="account_move_line_partner_tree"/>
|
||||
|
||||
<menuitem action="act_account_partner_account_move_payable_all" id="menu_account_move_open_unreconcile_payable" parent="account_followup.account_followup_wizard_menu"/>
|
||||
<menuitem action="act_account_partner_account_move_payable_all" id="menu_account_move_open_unreconcile_payable" parent="account_followup.menu_action_followup_stat"/>
|
||||
|
||||
|
||||
</data>
|
||||
|
|
|
@ -61,7 +61,7 @@ class report_rappel(report_sxw.rml_parse):
|
|||
movelines = moveline_obj.read(self.cr, self.uid, movelines)
|
||||
return movelines
|
||||
|
||||
def _get_text(self, partner, followup_id):
|
||||
def _get_text(self, partner, followup_id, context={}):
|
||||
fp_obj = pooler.get_pool(self.cr.dbname).get('account_followup.followup')
|
||||
fp_line = fp_obj.browse(self.cr, self.uid, followup_id).followup_line
|
||||
li_delay = []
|
||||
|
@ -82,7 +82,12 @@ class report_rappel(report_sxw.rml_parse):
|
|||
partner_delay.append(delay)
|
||||
text = partner_delay and a[max(partner_delay)] or ''
|
||||
if text:
|
||||
text = text % {'partner_name':partner.name}
|
||||
text = text % {
|
||||
'partner_name': partner.name,
|
||||
'date': time.strftime('%Y-%m-%d'),
|
||||
'company_name': fp_obj.browse(self.cr, self.uid, followup_id).company_id.name,
|
||||
'user_signature': pooler.get_pool(self.cr.dbname).get('res.users').browse(self.cr, self.uid, self.uid, context).signature,
|
||||
}
|
||||
return text
|
||||
|
||||
|
||||
|
|
|
@ -204,7 +204,7 @@ class followup_all_print(wizard.interface):
|
|||
summary = msg_unsent + line + msg_sent
|
||||
return {'summary' : summary}
|
||||
else:
|
||||
return {'summary' : '\n\n\nMain not sent to any partner if you want to sent it please tick send email confirmation on wizard'}
|
||||
return {'summary' : '\n\n\nMail not sent to any partner if you want to sent it please tick send email confirmation on wizard'}
|
||||
|
||||
def _get_partners(self, cr, uid, data, context):
|
||||
pool = pooler.get_pool(cr.dbname)
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
{
|
||||
'name': 'Reporting for accounting',
|
||||
'version': '1.0',
|
||||
'version': '1.1',
|
||||
'category': 'Generic Modules/Accounting',
|
||||
'description': """Financial and accounting reporting
|
||||
Fiscal statements
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
|
||||
# $Id$
|
||||
#
|
||||
|
@ -140,12 +140,12 @@ class account_invoice_line(osv.osv):
|
|||
else:
|
||||
return super(account_invoice_line, self).product_id_change_unit_price_inv(cr, uid, tax_id, price_unit, qty, address_invoice_id, product, partner_id, context=context)
|
||||
|
||||
def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition=False, price_unit=False, address_invoice_id=False, price_type='tax_excluded', context=None):
|
||||
# note: will call product_id_change_unit_price_inv with context...
|
||||
def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition_id=False, price_unit=False, address_invoice_id=False, price_type='tax_excluded', context=None):
|
||||
# note: will call product_id_change_unit_price_inv with context...
|
||||
if context is None:
|
||||
context = {}
|
||||
context.update({'price_type': price_type})
|
||||
return super(account_invoice_line, self).product_id_change(cr, uid, ids, product, uom, qty, name, type, partner_id, fposition, price_unit, address_invoice_id, context=context)
|
||||
return super(account_invoice_line, self).product_id_change(cr, uid, ids, product, uom, qty, name, type, partner_id, fposition_id, price_unit, address_invoice_id, context=context)
|
||||
account_invoice_line()
|
||||
|
||||
class account_invoice_tax(osv.osv):
|
||||
|
|
|
@ -30,7 +30,7 @@ This module install the base for IBAN bank accounts.
|
|||
|
||||
""",
|
||||
'author': 'Tiny',
|
||||
'depends': ['base'],
|
||||
'depends': ['base', 'account'],
|
||||
'init_xml': ['base_iban_data.xml'],
|
||||
'update_xml': ['base_iban_view.xml'],
|
||||
'installable': True,
|
||||
|
|
|
@ -40,7 +40,7 @@ init_fields = {
|
|||
finish_form = '''<?xml version="1.0"?>
|
||||
<form string="Finish">
|
||||
<separator string="Module successfully exported !" colspan="4"/>
|
||||
<field name="module_file"/>
|
||||
<field name="module_file" filename='module_filename'/>
|
||||
<newline/>
|
||||
<field name="module_filename"/>
|
||||
</form>'''
|
||||
|
|
|
@ -498,6 +498,7 @@
|
|||
<xsl:call-template name="make_alignment" />
|
||||
<xsl:call-template name="make_background" />
|
||||
<xsl:call-template name="make_space_beforeafter" />
|
||||
<xsl:call-template name="make_fontcolor" />
|
||||
</paraStyle>
|
||||
</xsl:template>
|
||||
|
||||
|
@ -670,6 +671,17 @@
|
|||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="make_fontcolor">
|
||||
<xsl:variable name="textColor">
|
||||
<xsl:value-of select="style:properties/@fo:color"/>
|
||||
</xsl:variable>
|
||||
<xsl:if test="not($textColor='') and boolean(style:properties/@fo:color)">
|
||||
<xsl:attribute name="textColor">
|
||||
<xsl:value-of select="$textColor" />
|
||||
</xsl:attribute>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<!--
|
||||
This stylesheet is part of:
|
||||
PyOpenOffice Version 0.4
|
||||
|
|
|
@ -499,6 +499,7 @@
|
|||
<xsl:call-template name="make_alignment" />
|
||||
<xsl:call-template name="make_background" />
|
||||
<xsl:call-template name="make_space_beforeafter" />
|
||||
<xsl:call-template name="make_fontcolor" />
|
||||
</paraStyle>
|
||||
</xsl:template>
|
||||
|
||||
|
@ -670,6 +671,16 @@
|
|||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
<xsl:template name="make_fontcolor">
|
||||
<xsl:variable name="textColor">
|
||||
<xsl:value-of select="style:properties/@fo:color"/>
|
||||
</xsl:variable>
|
||||
<xsl:if test="not($textColor='') and boolean(style:properties/@fo:color)">
|
||||
<xsl:attribute name="textColor">
|
||||
<xsl:value-of select="$textColor" />
|
||||
</xsl:attribute>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<!--
|
||||
This stylesheet is part of:
|
||||
|
|
|
@ -158,7 +158,7 @@
|
|||
|
||||
<record id="crm_case_patcheserrorinprogram0" model="crm.case">
|
||||
<field name="partner_address_id" ref="base.res_partner_address_9"/>
|
||||
<field eval="time.strftime('%Y-%m-30 16:30:00')" name="date"/>
|
||||
<field eval="time.strftime('%Y-%m-28 16:30:00')" name="date"/>
|
||||
<field name="category2_id" ref="crm_configuration.category2"/>
|
||||
<field eval=""2"" name="priority"/>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
|
|
|
@ -85,8 +85,8 @@
|
|||
<field eval=""More than 5 yrs Experience in PHP"" name="name"/>
|
||||
</record>
|
||||
<record id="crm_case_marketingjob0" model="crm.case">
|
||||
<field eval="time.strftime('%Y-%m-29 17:15:32')" name="date"/>
|
||||
<field eval="time.strftime('%Y-%m-30')" name="date_deadline"/>
|
||||
<field eval="time.strftime('%Y-%m-26 17:15:32')" name="date"/>
|
||||
<field eval="time.strftime('%Y-%m-28')" name="date_deadline"/>
|
||||
<field name="category2_id" ref="crm_configuration.category_job2"/>
|
||||
<field name="partner_id" ref="base.res_partner_11"/>
|
||||
<field eval=""4"" name="priority"/>
|
||||
|
|
|
@ -90,7 +90,7 @@
|
|||
<field name="categ_id" ref="crm_configuration.categ_meet2"/>
|
||||
<field name="stage_id" ref="crm_configuration.stage_meet2"/>
|
||||
<field eval=""Changes in Designing"" name="name"/>
|
||||
<field eval="time.strftime('%Y-%m-30')" name="date_deadline"/>
|
||||
<field eval="time.strftime('%Y-%m-28')" name="date_deadline"/>
|
||||
<field eval=""info@opensides.be"" name="email_from"/>
|
||||
</record>
|
||||
|
||||
|
|
|
@ -3403,6 +3403,7 @@
|
|||
<field name="type">view</field>
|
||||
<field name="user_type" ref="account_type_view"/>
|
||||
<field name="parent_id" ref="pcg_Classe_4"/>
|
||||
<field name="reconcile" eval="True"/>
|
||||
</record>
|
||||
|
||||
<record id="pcg_400" model="account.account.template">
|
||||
|
@ -3417,7 +3418,7 @@
|
|||
<record id="pcg_401" model="account.account.template">
|
||||
<field name="name">Fournisseurs</field>
|
||||
<field name="code">401</field>
|
||||
<field name="type">payable</field>
|
||||
<field name="type">view</field>
|
||||
<field name="user_type" ref="account_type_payable"/>
|
||||
<field name="parent_id" ref="pcg_40"/>
|
||||
<field name="reconcile" eval="True"/>
|
||||
|
@ -3530,7 +3531,7 @@
|
|||
<record id="pcg_409" model="account.account.template">
|
||||
<field name="name">Fournisseurs débiteurs</field>
|
||||
<field name="code">409</field>
|
||||
<field name="type">payable</field>
|
||||
<field name="type">view</field>
|
||||
<field name="user_type" ref="account_type_payable"/>
|
||||
|
||||
<field name="parent_id" ref="pcg_40"/>
|
||||
|
@ -3561,7 +3562,7 @@
|
|||
<field name="name">Fournisseurs - Autres avoirs</field>
|
||||
<field name="code">4097</field>
|
||||
<field name="type">other</field>
|
||||
<field name="user_type" ref="account_type_stocks" />
|
||||
<field name="user_type" ref="account_type_stocks" />
|
||||
|
||||
<field name="parent_id" ref="pcg_409"/>
|
||||
<field name="reconcile" eval="True"/>
|
||||
|
@ -3604,6 +3605,7 @@
|
|||
<field name="user_type" ref="account_type_view"/>
|
||||
|
||||
<field name="parent_id" ref="pcg_Classe_4"/>
|
||||
<field name="reconcile" eval="True"/>
|
||||
</record>
|
||||
|
||||
<record id="pcg_410" model="account.account.template">
|
||||
|
@ -3619,7 +3621,7 @@
|
|||
<record id="pcg_411" model="account.account.template">
|
||||
<field name="name">Clients</field>
|
||||
<field name="code">411</field>
|
||||
<field name="type">receivable</field>
|
||||
<field name="type">view</field>
|
||||
<field name="user_type" ref="account_type_receivable"/>
|
||||
|
||||
<field name="parent_id" ref="pcg_41"/>
|
||||
|
@ -3701,7 +3703,7 @@
|
|||
<record id="pcg_419" model="account.account.template">
|
||||
<field name="name">Clients créditeurs</field>
|
||||
<field name="code">419</field>
|
||||
<field name="type">receivable</field>
|
||||
<field name="type">view</field>
|
||||
<field name="user_type" ref="account_type_receivable"/>
|
||||
|
||||
<field name="parent_id" ref="pcg_41"/>
|
||||
|
@ -3760,7 +3762,7 @@
|
|||
<record id="pcg_421" model="account.account.template">
|
||||
<field name="name">Personnel - Rémunérations dues</field>
|
||||
<field name="code">421</field>
|
||||
<field name="type">other</field>
|
||||
<field name="type">view</field>
|
||||
<field name="user_type" ref="account_type_dettes"/>
|
||||
|
||||
<field name="parent_id" ref="pcg_42"/>
|
||||
|
@ -3909,7 +3911,7 @@
|
|||
<record id="pcg_437" model="account.account.template">
|
||||
<field name="name">Autres organismes sociaux</field>
|
||||
<field name="code">437</field>
|
||||
<field name="type">other</field>
|
||||
<field name="type">view</field>
|
||||
<field name="user_type" ref="account_type_dettes"/>
|
||||
|
||||
<field name="parent_id" ref="pcg_43"/>
|
||||
|
@ -4168,7 +4170,7 @@
|
|||
<record id="pcg_4456" model="account.account.template">
|
||||
<field name="name">Taxes sur le chiffre d'affaires déductibles</field>
|
||||
<field name="code">4456</field>
|
||||
<field name="type">other</field>
|
||||
<field name="type">view</field>
|
||||
<field name="user_type" ref="account_type_tax"/>
|
||||
|
||||
<field name="parent_id" ref="pcg_445"/>
|
||||
|
@ -4239,7 +4241,7 @@
|
|||
<record id="pcg_4457" model="account.account.template">
|
||||
<field name="name">Taxes sur le chiffre d'affaires collectées par l'entreprise</field>
|
||||
<field name="code">4457</field>
|
||||
<field name="type">other</field>
|
||||
<field name="type">view</field>
|
||||
<field name="user_type" ref="account_type_tax"/>
|
||||
|
||||
<field name="parent_id" ref="pcg_445"/>
|
||||
|
@ -5268,7 +5270,7 @@
|
|||
<record id="fr_pcg_cash" model="account.account.template">
|
||||
<field name="name">Banques</field>
|
||||
<field name="code">512</field>
|
||||
<field name="type">other</field>
|
||||
<field name="type">view</field>
|
||||
<field name="user_type" ref="account_type_cash"/>
|
||||
<field name="note">Créer 1 compte par compte bancaire</field>
|
||||
|
||||
|
@ -5472,6 +5474,7 @@
|
|||
<field name="user_type" ref="account_type_view"/>
|
||||
|
||||
<field name="parent_id" ref="pcg_Classe_5"/>
|
||||
<field name="reconcile" eval="True"/>
|
||||
</record>
|
||||
|
||||
<record id="pcg_59" model="account.account.template">
|
||||
|
@ -6940,7 +6943,7 @@
|
|||
<record id="pcg_645" model="account.account.template">
|
||||
<field name="name">Charges de Sécurité sociale et de prévoyance</field>
|
||||
<field name="code">645</field>
|
||||
<field name="type">other</field>
|
||||
<field name="type">view</field>
|
||||
<field name="user_type" ref="account_type_expense"/>
|
||||
|
||||
<field name="parent_id" ref="pcg_64"/>
|
||||
|
@ -6994,7 +6997,7 @@
|
|||
<record id="pcg_646" model="account.account.template">
|
||||
<field name="name">Cotisations sociales personnelles de l'exploitant</field>
|
||||
<field name="code">646</field>
|
||||
<field name="type">other</field>
|
||||
<field name="type">view</field>
|
||||
<field name="user_type" ref="account_type_expense"/>
|
||||
|
||||
<field name="parent_id" ref="pcg_64"/>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
|
||||
# $Id$
|
||||
#
|
||||
|
@ -55,7 +55,7 @@ class pos_order(osv.osv):
|
|||
def onchange_partner_pricelist(self, cr, uid, ids, part, context={}):
|
||||
if not part:
|
||||
return {}
|
||||
pricelist = self.pool.get('res.partner').browse(cr, uid, part).property_product_pricelist.id
|
||||
pricelist = self.pool.get('res.partner').browse(cr, uid, part).property_product_pricelist.id
|
||||
return {'value':{'pricelist_id': pricelist}}
|
||||
|
||||
def _amount_total(self, cr, uid, ids, field_name, arg, context):
|
||||
|
@ -521,7 +521,7 @@ class pos_order(osv.osv):
|
|||
inv_line.update(inv_line_ref.product_id_change(cr, uid, [],
|
||||
line.product_id.id,
|
||||
line.product_id.uom_id.id,
|
||||
line.qty, partner_id = order.partner_id.id)['value'])
|
||||
line.qty, partner_id = order.partner_id.id, fposition_id=order.partner_id.property_account_position.id)['value'])
|
||||
inv_line['price_unit'] = line.price_unit
|
||||
inv_line['discount'] = line.discount
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
|
||||
# $Id$
|
||||
#
|
||||
|
@ -61,7 +61,7 @@ def _createInvoices(self, cr, uid, data, context={}):
|
|||
raise osv.except_osv(
|
||||
_('Error'),
|
||||
_("You cannot make an advance on a sale order that is defined as 'Automatic Invoice after delivery'."))
|
||||
val = obj_lines.product_id_change(cr, uid, [], data['form']['product_id'],uom = False, partner_id = sale.partner_id.id)
|
||||
val = obj_lines.product_id_change(cr, uid, [], data['form']['product_id'],uom = False, partner_id = sale.partner_id.id, fposition_id=sale.fiscal_position.id)
|
||||
line_id =obj_lines.create(cr, uid, {
|
||||
'name': val['value']['name'],
|
||||
'account_id':val['value']['account_id'],
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
|
||||
# $Id$
|
||||
#
|
||||
|
@ -72,21 +72,22 @@ class make_sale(wizard.interface):
|
|||
['invoice', 'delivery', 'contact'])
|
||||
default_pricelist = partner_obj.browse(cr, uid, data['form']['partner_id'],
|
||||
context).property_product_pricelist.id
|
||||
|
||||
fpos_data = partner_obj.browse(cr, uid, data['form']['partner_id'],context).property_account_position
|
||||
new_ids = []
|
||||
|
||||
for case in case_obj.browse(cr, uid, data['ids']):
|
||||
if case.partner_id and case.partner_id.id:
|
||||
partner_id = case.partner_id.id
|
||||
fpos = case.partner_id.property_account_position and case.partner_id.property_account_position.id or False
|
||||
partner_addr = partner_obj.address_get(cr, uid, [case.partner_id.id],
|
||||
['invoice', 'delivery', 'contact'])
|
||||
pricelist = partner_obj.browse(cr, uid, case.partner_id.id,
|
||||
context).property_product_pricelist.id
|
||||
else:
|
||||
partner_id = data['form']['partner_id']
|
||||
fpos = fpos_data and fpos_data.id or False
|
||||
partner_addr = default_partner_addr
|
||||
pricelist = default_pricelist
|
||||
|
||||
vals = {
|
||||
'origin': 'CRM:%s' % str(case.id),
|
||||
'picking_policy': data['form']['picking_policy'],
|
||||
|
@ -102,10 +103,9 @@ class make_sale(wizard.interface):
|
|||
if data['form']['analytic_account']:
|
||||
vals['project_id'] = data['form']['analytic_account']
|
||||
new_id = sale_obj.create(cr, uid, vals)
|
||||
|
||||
for product_id in data['form']['products'][0][2]:
|
||||
value = sale_line_obj.product_id_change(cr, uid, [], pricelist,
|
||||
product_id, qty=1, partner_id=partner_id)['value']
|
||||
product_id, qty=1, partner_id=partner_id, fiscal_position=fpos)['value']
|
||||
value['product_id'] = product_id
|
||||
value['order_id'] = new_id
|
||||
sale_line_obj.create(cr, uid, value)
|
||||
|
|
|
@ -28,9 +28,18 @@ import pooler
|
|||
_form = """<?xml version="1.0"?>
|
||||
<form string="Set Stock to Zero">
|
||||
<separator colspan="4" string="Set Stocks to Zero" />
|
||||
<label string="Do you want to set stocks to zero ?"/>
|
||||
<field name="location_id"/>
|
||||
<newline/>
|
||||
<label colspan="4" string="Do you want to set stocks to zero ?"/>
|
||||
</form>
|
||||
"""
|
||||
_inventory_fields = {
|
||||
'location_id' : {
|
||||
'string':'Location',
|
||||
'type':'many2one',
|
||||
'relation':'stock.location',
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
def do_merge(self, cr, uid, data, context):
|
||||
|
@ -44,14 +53,18 @@ def do_merge(self, cr, uid, data, context):
|
|||
|
||||
cr.execute('select distinct location_id from stock_inventory_line where inventory_id=%s', (data['ids'][0],))
|
||||
loc_ids = map(lambda x: x[0], cr.fetchall())
|
||||
if data['form']['location_id']:
|
||||
loc_ids.append(data['form']['location_id'])
|
||||
locs = ','.join(map(lambda x: str(x), loc_ids))
|
||||
|
||||
cr.execute('select distinct location_id,product_id from stock_inventory_line where inventory_id=%s', (data['ids'][0],))
|
||||
inv = cr.fetchall()
|
||||
|
||||
if not inv:
|
||||
if not locs:
|
||||
raise wizard.except_wizard("Warning",
|
||||
"Please select at least one inventory location !")
|
||||
# if not inv:
|
||||
# raise wizard.except_wizard("Warning",
|
||||
# "Please select at least one inventory location !")
|
||||
else:
|
||||
cr.execute('select distinct product_id from stock_move where (location_dest_id in ('+locs+')) or (location_id in ('+locs+'))')
|
||||
stock = cr.fetchall()
|
||||
|
@ -75,7 +88,7 @@ class merge_inventory(wizard.interface):
|
|||
'actions' : [],
|
||||
'result' : {'type' : 'form',
|
||||
'arch' : _form,
|
||||
'fields' : {},
|
||||
'fields' : _inventory_fields,
|
||||
'state' : [('end', 'Cancel'),
|
||||
('merge', 'Set to Zero') ]}
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue