commit
a518bbaa6a
|
@ -1226,7 +1226,7 @@ class account_tax(osv.osv):
|
|||
_name = 'account.tax'
|
||||
_description = 'Tax'
|
||||
_columns = {
|
||||
'name': fields.char('Tax Name', size=64, required=True, help="This name will be used to be displayed on reports"),
|
||||
'name': fields.char('Tax Name', size=64, required=True, translate=True, help="This name will be used to be displayed on reports"),
|
||||
'sequence': fields.integer('Sequence', required=True, help="The sequence field is used to order the taxes lines from the lowest sequences to the higher ones. The order is important if you have a tax that have several tax childs. In this case, the evaluation order is important."),
|
||||
'amount': fields.float('Amount', required=True, digits=(14,4)),
|
||||
'active': fields.boolean('Active'),
|
||||
|
@ -1261,7 +1261,7 @@ class account_tax(osv.osv):
|
|||
'ref_tax_sign': fields.float('Tax Code Sign', help="Usually 1 or -1."),
|
||||
'include_base_amount': fields.boolean('Include in base amount', help="Indicate if the amount of tax must be included in the base amount for the computation of the next taxes"),
|
||||
'company_id': fields.many2one('res.company', 'Company', required=True),
|
||||
'description': fields.char('Internal Name',size=32),
|
||||
'description': fields.char('Tax Code',size=32),
|
||||
'price_include': fields.boolean('Tax Included in Price', help="Check this is the price you use on the product and invoices is including this tax.")
|
||||
}
|
||||
|
||||
|
|
|
@ -115,7 +115,7 @@ class account_move_line(osv.osv):
|
|||
|
||||
if account and ((not fields) or ('debit' in fields) or ('credit' in fields)) and 'partner_id' in data:
|
||||
part = self.pool.get('res.partner').browse(cr, uid, data['partner_id'])
|
||||
account = self.pool.get('account.fiscal.position').map_account(cr, uid, part, account.id)
|
||||
account = self.pool.get('account.fiscal.position').map_account(cr, uid, part.property_account_position, account.id)
|
||||
account = self.pool.get('account.account').browse(cr, uid, account)
|
||||
data['account_id'] = account.id
|
||||
|
||||
|
@ -199,14 +199,14 @@ class account_move_line(osv.osv):
|
|||
|
||||
part = partner_id and self.pool.get('res.partner').browse(cr, uid, partner_id) or False
|
||||
# part = False is acceptable for fiscal position.
|
||||
account = self.pool.get('account.fiscal.position').map_account(cr, uid, part, account.id)
|
||||
account = self.pool.get('account.fiscal.position').map_account(cr, uid, part.property_account_position, account.id)
|
||||
account = self.pool.get('account.account').browse(cr, uid, account)
|
||||
|
||||
if account and ((not fields) or ('debit' in fields) or ('credit' in fields)):
|
||||
data['account_id'] = account.id
|
||||
# Propose the price VAT excluded, the VAT will be added when confirming line
|
||||
if account.tax_ids:
|
||||
taxes = self.pool.get('account.fiscal.position').map_tax(cr, uid, part, account.tax_ids)
|
||||
taxes = self.pool.get('account.fiscal.position').map_tax(cr, uid, part.property_account_position, account.tax_ids)
|
||||
tax = self.pool.get('account.tax').browse(cr, uid, taxes)
|
||||
for t in self.pool.get('account.tax').compute_inv(cr, uid, tax, total, 1):
|
||||
total -= t['amount']
|
||||
|
@ -472,10 +472,10 @@ class account_move_line(osv.osv):
|
|||
if journal:
|
||||
jt = self.pool.get('account.journal').browse(cr, uid, journal).type
|
||||
if jt=='sale':
|
||||
val['account_id'] = self.pool.get('account.fiscal.position').map_account(cr, uid, part, id2)
|
||||
val['account_id'] = self.pool.get('account.fiscal.position').map_account(cr, uid, part.property_account_position, id2)
|
||||
|
||||
elif jt=='purchase':
|
||||
val['account_id'] = self.pool.get('account.fiscal.position').map_account(cr, uid, part, id1)
|
||||
val['account_id'] = self.pool.get('account.fiscal.position').map_account(cr, uid, part.property_account_position, id1)
|
||||
if val.get('account_id', False):
|
||||
d = self.onchange_account_id(cr, uid, ids, val['account_id'])
|
||||
val.update(d['value'])
|
||||
|
@ -489,7 +489,7 @@ class account_move_line(osv.osv):
|
|||
tax_ids = res.tax_ids
|
||||
if tax_ids and partner_id:
|
||||
part = self.pool.get('res.partner').browse(cr, uid, partner_id)
|
||||
tax_id = self.pool.get('account.fiscal.position').map_tax(cr, uid, part, tax_ids)[0]
|
||||
tax_id = self.pool.get('account.fiscal.position').map_tax(cr, uid, part.property_account_position, tax_ids)[0]
|
||||
else:
|
||||
tax_id = tax_ids and tax_ids[0].id or False
|
||||
val['account_tax_id'] = tax_id
|
||||
|
|
|
@ -18,6 +18,13 @@
|
|||
string="Invoices"
|
||||
attachment="(object.state in ('open','paid')) and ('INV'+(object.number or '').replace('/',''))"
|
||||
attachment_use="1"/>
|
||||
<report
|
||||
auto="False"
|
||||
id="account_invoices_preview"
|
||||
model="account.invoice"
|
||||
name="account.invoice.preview"
|
||||
rml="account/report/invoice.rml"
|
||||
string="Print Preview"/>
|
||||
<report id="account_transfers" model="account.transfer" name="account.transfer" string="Transfers" xml="account/report/transfer.xml" xsl="account/report/transfer.xsl"/>
|
||||
<report auto="False" id="account_intracom" menu="False" model="account.move.line" name="account.intracom" string="IntraCom"/>
|
||||
|
||||
|
|
|
@ -481,7 +481,7 @@
|
|||
<field name="model">account.move</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Account entry">
|
||||
<tree string="Accounting Entries">
|
||||
<field name="name"/>
|
||||
<field name="date"/>
|
||||
<field name="ref"/>
|
||||
|
|
|
@ -36,3 +36,9 @@ report_sxw.report_sxw(
|
|||
parser=account_invoice
|
||||
)
|
||||
|
||||
report_sxw.report_sxw(
|
||||
'report.account.invoice.preview',
|
||||
'account.invoice',
|
||||
'addons/account/report/invoice.rml',
|
||||
parser=account_invoice
|
||||
)
|
||||
|
|
|
@ -81,3 +81,6 @@
|
|||
"access_account_fiscal_position_tax","account.fiscal.position.tax all","model_account_fiscal_position_tax","base.group_user",1,0,0,0
|
||||
"access_account_fiscal_position_account","account.fiscal.position all","model_account_fiscal_position_account","base.group_user",1,0,0,0
|
||||
"access_fiscalyear_seq","fiscalyear.seq","model_fiscalyear_seq","account.group_account_invoice",1,1,1,1
|
||||
"access_account_fiscal_position_template","account.fiscal.position.template","model_account_fiscal_position_template","account.group_account_manager",1,1,1,1
|
||||
"access_account_fiscal_position_tax_template","account.fiscal.position.tax.template","model_account_fiscal_position_tax_template","account.group_account_manager",1,1,1,1
|
||||
"access_account_fiscal_position_account_template","account.fiscal.position.account.template","model_account_fiscal_position_account_template","account.group_account_manager",1,1,1,1
|
||||
|
|
|
|
@ -40,7 +40,7 @@ pay_fields = {
|
|||
'amount': {'string': 'Amount paid', 'type':'float', 'required':True},
|
||||
'name': {'string': 'Entry Name', 'type':'char', 'size': 64, 'required':True},
|
||||
'date': {'string': 'Payment date', 'type':'date', 'required':True, 'default':lambda *args: time.strftime('%Y-%m-%d')},
|
||||
'journal_id': {'string': 'Journal', 'type': 'many2one', 'relation':'account.journal', 'required':True, 'domain':[('type','=','cash')]},
|
||||
'journal_id': {'string': 'Journal/Payment Mode', 'type': 'many2one', 'relation':'account.journal', 'required':True, 'domain':[('type','=','cash')]},
|
||||
'period_id': {'string': 'Period', 'type': 'many2one', 'relation':'account.period', 'required':True},
|
||||
}
|
||||
|
||||
|
|
|
@ -40,26 +40,49 @@ FIELDS = {
|
|||
|
||||
START_FIELD = {
|
||||
'date': {'string': 'Date payment', 'type': 'date','required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')},
|
||||
|
||||
'journal_id': {'string': 'Journal', 'type': 'many2many', 'relation': 'account.journal', 'domain': '[("type","in",["sale","purchase"])]', 'help': 'This field allow you to choose the accounting journals you want for filtering the invoices. If you left this field empty, it will search on all sale and purchase journals.'},
|
||||
}
|
||||
|
||||
START_FORM = '''<?xml version="1.0"?>
|
||||
<form string="Import invoices in statement">
|
||||
<label string="Choose invoice type and payment date" colspan="4"/>
|
||||
<label string="Choose Journal and Payment Date" colspan="4"/>
|
||||
<field name="date"/>
|
||||
<field name="journal_id" colspan="4"/>
|
||||
</form>'''
|
||||
|
||||
def _search_customer_invoices(obj, cursor, user, data, context):
|
||||
pool = pooler.get_pool(cursor.dbname)
|
||||
def _search_invoices(obj, cr, uid, data, context):
|
||||
pool = pooler.get_pool(cr.dbname)
|
||||
line_obj = pool.get('account.move.line')
|
||||
statement_obj = pool.get('account.bank.statement')
|
||||
journal_obj = pool.get('account.journal')
|
||||
|
||||
statement = statement_obj.browse(cursor, user, data['id'], context=context)
|
||||
line_ids = line_obj.search(cursor, user, [
|
||||
statement = statement_obj.browse(cr, uid, data['id'], context=context)
|
||||
journal_ids = data['form']['journal_id'][0][2]
|
||||
|
||||
if journal_ids == []:
|
||||
sale_journal_ids = journal_obj.search(cr, uid, [('type', '=', 'sale')], context=context)
|
||||
pur_journal_ids = journal_obj.search(cr, uid, [('type', '=', 'purchase')], context=context)
|
||||
else:
|
||||
pur_journal_ids = sale_journal_ids = []
|
||||
for journal in pool.get('account.journal').browse(cr, uid, journal_ids):
|
||||
if journal.type == 'sale':
|
||||
sale_journal_ids.append(journal.id)
|
||||
else:
|
||||
pur_journal_ids.append(journal.id)
|
||||
|
||||
line_ids = line_obj.search(cr, uid, [
|
||||
('reconcile_id', '=', False),
|
||||
('journal_id', 'in', sale_journal_ids),
|
||||
('account_id.type', '=', 'receivable')],
|
||||
#order='date DESC, id DESC', #doesn't work
|
||||
context=context)
|
||||
|
||||
line_ids += line_obj.search(cr, uid, [
|
||||
('reconcile_id', '=', False),
|
||||
('journal_id', 'in', pur_journal_ids),
|
||||
('account_id.type', '=', 'payable')],
|
||||
#order='date DESC, id DESC', #doesn't work
|
||||
context=context)
|
||||
|
||||
FORM.string = '''<?xml version="1.0"?>
|
||||
<form string="Import entries from customer invoice">
|
||||
<field name="lines" colspan="4" height="300" width="800" nolabel="1"
|
||||
|
@ -68,25 +91,6 @@ def _search_customer_invoices(obj, cursor, user, data, context):
|
|||
return {'type':'customer'}
|
||||
# return {'lines': line_ids,'type':'customer'}
|
||||
|
||||
def _search_supplier_invoices(obj, cursor, user, data, context):
|
||||
pool = pooler.get_pool(cursor.dbname)
|
||||
line_obj = pool.get('account.move.line')
|
||||
statement_obj = pool.get('account.bank.statement')
|
||||
statement = statement_obj.browse(cursor, user, data['id'], context=context)
|
||||
line_ids = line_obj.search(cursor, user, [
|
||||
('reconcile_id', '=', False),
|
||||
('account_id.type', '=', 'payable')
|
||||
], context=context)
|
||||
# order='date DESC, id DESC', context=context) #doesn't work
|
||||
FORM.string = '''<?xml version="1.0"?>
|
||||
<form string="Import entries from supplier invoice">
|
||||
<field name="lines" colspan="4" height="300" width="800" nolabel="1"
|
||||
domain="[('id', 'in', [%s])]"/>
|
||||
</form>''' % (','.join([str(x) for x in line_ids]))
|
||||
return {'type':'supplier'}
|
||||
# return {'lines': line_ids,'type':'supplier'}
|
||||
|
||||
|
||||
def _populate_statement(obj, cursor, user, data, context):
|
||||
line_ids = data['form']['lines'][0][2]
|
||||
line_date=data['form']['date']
|
||||
|
@ -147,25 +151,12 @@ class PopulateStatementFromInv(wizard.interface):
|
|||
'fields':START_FIELD,
|
||||
'state': [
|
||||
('end', '_Cancel'),
|
||||
('customer', '_Customer invoices', '', True),
|
||||
('supplier', '_Supplier invoices', '', True)
|
||||
('go', '_Go', '', True),
|
||||
]
|
||||
},
|
||||
},
|
||||
'customer': {
|
||||
'actions': [_search_customer_invoices],
|
||||
'result': {
|
||||
'type': 'form',
|
||||
'arch': FORM,
|
||||
'fields': FIELDS,
|
||||
'state': [
|
||||
('end', '_Cancel','', True),
|
||||
('finish', 'O_k','', True)
|
||||
]
|
||||
},
|
||||
},
|
||||
'supplier': {
|
||||
'actions': [_search_supplier_invoices],
|
||||
'go': {
|
||||
'actions': [_search_invoices],
|
||||
'result': {
|
||||
'type': 'form',
|
||||
'arch': FORM,
|
||||
|
@ -176,6 +167,7 @@ class PopulateStatementFromInv(wizard.interface):
|
|||
]
|
||||
},
|
||||
},
|
||||
|
||||
'finish': {
|
||||
'actions': [],
|
||||
'result': {
|
||||
|
|
|
@ -108,16 +108,16 @@ class accounting_report_indicator(report_sxw.rml_parse):
|
|||
return super(accounting_report_indicator,self).repeatIn(lst, name, nodes_parent=False)
|
||||
|
||||
array_header = eval(data,{'year':'Fiscal Year','periods':'Periods'})
|
||||
value = [array_header]
|
||||
# value = [array_header]
|
||||
value = []
|
||||
value.extend(self.header_name)
|
||||
|
||||
type=['string']
|
||||
if name=='array':
|
||||
type.extend(['float']*len(self.header_name))
|
||||
type = ['float']*len(self.header_name)
|
||||
else:
|
||||
type=['lable'] * (len(self.header_name)+1)
|
||||
type = ['lable'] * (len(self.header_name))
|
||||
|
||||
width = [538/float(len(value))]*(len(value))
|
||||
width = [438/float(len(value))]*(len(value))
|
||||
|
||||
if not lst:
|
||||
lst.append(1)
|
||||
|
@ -132,6 +132,7 @@ class accounting_report_indicator(report_sxw.rml_parse):
|
|||
width.append(30)
|
||||
for v in range(len(width)):
|
||||
width_str +=',%d'%width[v]
|
||||
|
||||
ns.setAttribute('colWidths',width_str)
|
||||
|
||||
child_list = ns.childNodes
|
||||
|
@ -169,6 +170,7 @@ class accounting_report_indicator(report_sxw.rml_parse):
|
|||
# find_child(obj_inds)
|
||||
|
||||
for obj_ind in obj_inds:
|
||||
level = 0
|
||||
res = {
|
||||
'id':obj_ind.id,
|
||||
'name':obj_ind.name,
|
||||
|
@ -177,9 +179,15 @@ class accounting_report_indicator(report_sxw.rml_parse):
|
|||
'disp_graph':obj_ind.disp_graph,
|
||||
'disp_tree':obj_ind.disp_tree,
|
||||
'note':obj_ind.note,
|
||||
'level' : obj_ind.parent_id or 0,
|
||||
'type':obj_ind.type,
|
||||
'array_table' : False,
|
||||
}
|
||||
if obj_ind.parent_id:
|
||||
for record in result:
|
||||
if record['id'] == obj_ind.parent_id.id:
|
||||
res['level'] = record['level'] + 1
|
||||
break
|
||||
if len(obj_ind.expression)>=2:
|
||||
res['array_table'] = True
|
||||
result.append(res)
|
||||
|
|
|
@ -2,13 +2,21 @@
|
|||
<document filename="test.pdf">
|
||||
<template pageSize="(595.0,842.0)" title="Test" author="Martin Simon" allowSplitting="20">
|
||||
<pageTemplate id="first">
|
||||
<frame id="first" x1="34.0" y1="28.0" width="527" height="786"/>
|
||||
<pageGraphics>
|
||||
<setFont name="Helvetica" size="8.5"/>
|
||||
<drawString x="10.5cm" y="1cm"><pageNumber/></drawString>
|
||||
<frame id="first" x1="57.0" y1="57.0" width="481" height="728"/>
|
||||
<pageGraphics>
|
||||
<!--COL 1-->
|
||||
<drawString x="1.0cm" y="28.1cm">[[ company.name ]]</drawString>
|
||||
<drawString x="16.2cm" y="28.1cm">Indicators - [[ company.currency_id.name ]]</drawString>
|
||||
|
||||
<setFont name="Helvetica" size="9"/>
|
||||
</pageGraphics>
|
||||
<!--COL 2-->
|
||||
<setFont name="Helvetica" size="9"/>
|
||||
<drawString x="1.0cm" y="1cm"> [[ time.strftime("%m-%d-%y %H:%M", time.localtime()) ]]</drawString>
|
||||
<drawString x="19.0cm" y="1cm">Page <pageNumber/></drawString>
|
||||
|
||||
<lineMode width="0.7"/>
|
||||
<lines>1cm 27.7cm 20cm 27.7cm</lines>
|
||||
<setFont name="Helvetica" size="8"/>
|
||||
</pageGraphics>
|
||||
</pageTemplate>
|
||||
</template>
|
||||
<stylesheet>
|
||||
|
@ -41,19 +49,23 @@
|
|||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table7">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<initialize>
|
||||
<paraStyle name="all" alignment="justify"/>
|
||||
</initialize>
|
||||
<paraStyle name="P1" alignment="CENTER" fontName="Helvetica" fontSize="8.5" leading="10" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P2" fontName="Helvetica" fontSize="10.0" leading="13" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P3" fontName="Times-BoldItalic" fontSize="10.0" leading="13" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P3" fontName="Helvetica-Bold" fontSize="9.0" leading="13" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P4" fontName="Helvetica" fontSize="10.0" leading="14" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P5" fontName="Helvetica" fontSize="8.5" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P6" fontName="Helvetica" fontSize="11.0" leading="14" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P7" fontName="Helvetica" fontSize="10.0" leading="13" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P8" fontName="Helvetica-Bold" fontSize="11.0" leading="14" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P9" fontName="Helvetica" fontSize="8.0" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P10" fontName="Helvetica" fontSize="16.0" leading="20" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P10" fontName="Helvetica-Bold" fontSize="10.0" leading="20" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P11" fontName="Helvetica" fontSize="9.0" leading="14" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P12" fontName="Helvetica" fontSize="11.0" leading="14" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P13" fontName="Helvetica" fontSize="11.0" leading="14" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
|
@ -62,9 +74,9 @@
|
|||
<paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Table Contents" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Table Heading" fontName="Times-Roman" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Caption" fontName="Times-Roman" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Index" fontName="Times-Roman"/>
|
||||
<paraStyle name="Table Heading" fontName="Helvetica" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Caption" fontName="Helvetica" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Index" fontName="Helvetica"/>
|
||||
<paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="12.0" leading="19" alignment="CENTER" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
</stylesheet>
|
||||
<images/>
|
||||
|
@ -104,10 +116,10 @@
|
|||
<para style="P3"><seqReset/></para>
|
||||
<section>
|
||||
<para style="P1">[[ repeatIn(lines(data['form']),'o')]]</para>
|
||||
<blockTable colWidths="528.0" style="Table3">
|
||||
<blockTable colWidths="528.0" style="Table7">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P11"><b>(<seq/>)</b> [[ o['type']=='view' and setTag('para','para',{'fontName':'Helvetica-Bold','fontSize':'10.5'}) ]]<u>[[ o['name'] ]]</u> (<u>[[ o['code'] ]]</u>)</para>
|
||||
<para style="P11"><font>[['.....'*(o['level']) ]][[ setTag('font','font',{'color':'white'}) ]]</font><b>(<seq/>)</b> [[ o['type']=='view' and setTag('para','para',{'fontName':'Helvetica-Bold','fontSize':'10.5'}) ]][[ o['name'] ]] ([[ o['code'] ]])</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
@ -116,57 +128,47 @@
|
|||
<para style="P3">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="14.0,500.0,14.0" repeatRows="1" style="Table6">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P9"> </para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P5"><b>Expression :</b> [[ o['expression'] ]]</para>
|
||||
<blockTable colWidths="528.0" repeatRows="1" style="Table7">
|
||||
<tr><td>
|
||||
<para style="P5"><font>[['..........'*(o['level']) ]][[ setTag('font','font',{'color':'white'}) ]]</font><b>Expression :</b> [[ o['expression'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P9"> </para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="P3">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="14.0,500.0,14.0" repeatRows="1" style="Table6">
|
||||
<blockTable colWidths="528.0" repeatRows="1" style="Table7">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P9"> </para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P5"> [[ format(o['note']) or removeParentNode('blockTable') ]]</para>
|
||||
<para style="P5"> <font>[['..........'*(o['level']) ]][[ setTag('font','font',{'color':'white'}) ]]</font> [[ format(o['note']) or removeParentNode('blockTable') ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P9"> </para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="P3">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</section>
|
||||
<pageBreak/>
|
||||
<para style="P10">
|
||||
<u>Tabular Summary</u>
|
||||
</para>
|
||||
<section>
|
||||
<para style="P13">[[ repeatIn(getarray(data['form'],o,array_header=data['form']['select_base']),'array_header',td=len(data['form']['base_selection'][0][2]),data=data['form']['select_base']) or removeParentNode('section') ]]</para>
|
||||
<blockTable colWidths="0.0" style="Table5">
|
||||
<blockTable colWidths="0.00,90.00" style="Table4">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P3"> </para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3">Indicators</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
||||
</section>
|
||||
<section>
|
||||
<para style="P1">[[ repeatIn(lines(data['form']),'o')]]</para>
|
||||
<para style="P13">[[ repeatIn(getarray(data['form'],o,array_header=data['form']['select_base']),'array',td=len(data['form']['base_selection'][0][2]),data=data['form']['select_base']) or removeParentNode('section') ]]</para>
|
||||
<blockTable colWidths="0.00" style="Table5">
|
||||
<para style="P1">[[ repeatIn(lines(data['form']),'obj')]]</para>
|
||||
<para style="P13">[[ repeatIn(getarray(data['form'],obj,array_header=data['form']['select_base']),'array',td=len(data['form']['base_selection'][0][2]),data=data['form']['select_base']) or removeParentNode('section') ]]</para>
|
||||
<blockTable colWidths="0.00,90.00" style="Table3">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P9"> </para>
|
||||
<td>
|
||||
<para style="P9"> </para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P5"><font>[['.....'*(obj['level']) ]][[ setTag('font','font',{'color':'white'}) ]]</font>[[ obj['code'] ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
|
|
@ -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$
|
||||
#
|
||||
|
@ -82,8 +82,8 @@ class stock_picking(osv.osv):
|
|||
taxes_ids = [x.id for x in picking.carrier_id.product_id.taxes_id]
|
||||
if partner_id:
|
||||
partner = picking.address_id.partner_id
|
||||
account_id = self.pool.get('account.fiscal.position').map_account(cursor, user, partner, account_id)
|
||||
taxes_ids = self.pool.get('account.fiscal.position').map_tax(cursor, user, partner, taxes)
|
||||
account_id = self.pool.get('account.fiscal.position').map_account(cursor, user, partner.property_account_position, account_id)
|
||||
taxes_ids = self.pool.get('account.fiscal.position').map_tax(cursor, user, partner.property_account_position, taxes)
|
||||
|
||||
invoice_line_obj.create(cursor, user, {
|
||||
'name': picking.carrier_id.name,
|
||||
|
|
|
@ -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$
|
||||
#
|
||||
|
@ -44,11 +44,11 @@ def _delivery_default(self, cr, uid, data, context):
|
|||
</form>
|
||||
""" % (data['id'],)
|
||||
|
||||
|
||||
|
||||
if not order.state in ('draft'):
|
||||
raise wizard.except_wizard(_('Order not in draft state !'), _('The order state have to be draft to add delivery lines.'))
|
||||
|
||||
|
||||
|
||||
carrier_id = order.partner_id.property_delivery_carrier.id
|
||||
return {'carrier_id': carrier_id}
|
||||
|
||||
|
@ -65,15 +65,15 @@ def _delivery_set(self, cr, uid, data, context):
|
|||
grid = grid_obj.browse(cr, uid, [grid_id])[0]
|
||||
|
||||
taxes = grid.carrier_id.product_id.taxes_id
|
||||
taxes_ids = pooler.get_pool(cr.dbname).get('account.fiscal.position').map_tax(cr, uid, order.partner_id, taxes)
|
||||
|
||||
fpos = order.fiscal_position or False
|
||||
taxes_ids = pooler.get_pool(cr.dbname).get('account.fiscal.position').map_tax(cr, uid, fpos, taxes)
|
||||
line_obj.create(cr, uid, {
|
||||
'order_id': order.id,
|
||||
'name': grid.carrier_id.name,
|
||||
'product_uom_qty': 1,
|
||||
'product_uom': grid.carrier_id.product_id.uom_id.id,
|
||||
'product_id': grid.carrier_id.product_id.id,
|
||||
'price_unit': grid_obj.get_price(cr, uid, grid.id, order, time.strftime('%Y-%m-%d'), context),
|
||||
'price_unit': grid_obj.get_price(cr, uid, grid.id, order, time.strftime('%Y-%m-%d'), context),
|
||||
'tax_id': [(6,0,taxes_ids)],
|
||||
'type': 'make_to_stock'
|
||||
})
|
||||
|
|
|
@ -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$
|
||||
#
|
||||
|
@ -88,14 +88,14 @@ class final_invoice_create(wizard.interface):
|
|||
sum(line.amount),
|
||||
line.general_account_id,
|
||||
line.product_uom_id,
|
||||
move_line.ref
|
||||
move_line.ref
|
||||
FROM
|
||||
account_analytic_line as line
|
||||
LEFT JOIN account_move_line as move_line on (line.move_id=move_line.id)
|
||||
LEFT JOIN account_analytic_journal as journal on (line.journal_id=journal.id)
|
||||
WHERE
|
||||
line.account_id = %s AND
|
||||
line.move_id IS NOT NULL AND
|
||||
line.account_id = %s AND
|
||||
line.move_id IS NOT NULL AND
|
||||
journal.type = 'sale'
|
||||
GROUP BY
|
||||
line.product_id,
|
||||
|
@ -110,7 +110,7 @@ class final_invoice_create(wizard.interface):
|
|||
else:
|
||||
taxes = []
|
||||
|
||||
tax = pool.get('account.fiscal.position').map_tax(cr, uid, account.partner_id, taxes)
|
||||
tax = pool.get('account.fiscal.position').map_tax(cr, uid, account.partner_id.property_account_position, taxes)
|
||||
curr_line = {
|
||||
'price_unit': -amount,
|
||||
'quantity': 1.0,
|
||||
|
@ -130,7 +130,7 @@ class final_invoice_create(wizard.interface):
|
|||
product = pool.get('product.product').browse(cr, uid, data['form']['balance_product'], context2)
|
||||
|
||||
taxes = product.taxes_id
|
||||
tax = pool.get('account.fiscal.position').map_tax(cr, uid, account.partner_id, taxes)
|
||||
tax = pool.get('account.fiscal.position').map_tax(cr, uid, account.partner_id.property_account_position, taxes)
|
||||
account_id = product.product_tmpl_id.property_account_income.id or product.categ_id.property_account_income_categ.id
|
||||
curr_line = {
|
||||
'price_unit': account.amount_max - amount_total,
|
||||
|
@ -182,7 +182,7 @@ class final_invoice_create(wizard.interface):
|
|||
|
||||
states = {
|
||||
'init' : {
|
||||
'actions' : [_get_defaults],
|
||||
'actions' : [_get_defaults],
|
||||
'result' : {'type':'form', 'arch':_create_form, 'fields':_create_fields, 'state': [('end','Cancel'),('create','Create invoices')]},
|
||||
},
|
||||
'create' : {
|
||||
|
|
|
@ -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$
|
||||
#
|
||||
|
@ -108,7 +108,7 @@ class invoice_create(wizard.interface):
|
|||
price = 0.0
|
||||
|
||||
taxes = product.taxes_id
|
||||
tax = pool.get('account.fiscal.position').map_tax(cr, uid, account.partner_id, taxes)
|
||||
tax = pool.get('account.fiscal.position').map_tax(cr, uid, account.partner_id.property_account_position, taxes)
|
||||
account_id = product.product_tmpl_id.property_account_income.id or product.categ_id.property_account_income_categ.id
|
||||
|
||||
curr_line = {
|
||||
|
@ -194,7 +194,7 @@ class invoice_create(wizard.interface):
|
|||
|
||||
states = {
|
||||
'init' : {
|
||||
'actions' : [_get_accounts],
|
||||
'actions' : [_get_accounts],
|
||||
'result' : {'type':'form', 'arch':_create_form, 'fields':_create_fields, 'state': [('end','Cancel'),('create','Create invoices')]},
|
||||
},
|
||||
'create' : {
|
||||
|
|
|
@ -795,7 +795,7 @@ class mrp_procurement(osv.osv):
|
|||
'close_move': lambda *a: 0,
|
||||
'procure_method': lambda *a: 'make_to_order',
|
||||
}
|
||||
|
||||
|
||||
def unlink(self, cr, uid, ids):
|
||||
procurements = self.read(cr, uid, ids, ['state'])
|
||||
unlink_ids = []
|
||||
|
@ -804,8 +804,8 @@ class mrp_procurement(osv.osv):
|
|||
unlink_ids.append(s['id'])
|
||||
else:
|
||||
raise osv.except_osv(_('Invalid action !'), _('Cannot delete Procurement Order(s) which are in %s State!' % s['state']))
|
||||
return osv.osv.unlink(self, cr, uid, unlink_ids)
|
||||
|
||||
return osv.osv.unlink(self, cr, uid, unlink_ids)
|
||||
|
||||
def onchange_product_id(self, cr, uid, ids, product_id, context={}):
|
||||
if product_id:
|
||||
w=self.pool.get('product.product').browse(cr,uid,product_id, context)
|
||||
|
@ -1051,7 +1051,7 @@ class mrp_procurement(osv.osv):
|
|||
}
|
||||
|
||||
taxes_ids = procurement.product_id.product_tmpl_id.supplier_taxes_id
|
||||
self.pool.get('account.fiscal.position').map_tax(cr, uid, partner, taxes_ids)
|
||||
self.pool.get('account.fiscal.position').map_tax(cr, uid, partner.property_account_position, taxes_ids)
|
||||
line.update({
|
||||
'taxes_id':[(6,0,taxes_ids)]
|
||||
})
|
||||
|
|
|
@ -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$
|
||||
#
|
||||
|
@ -28,8 +28,8 @@ from mx.DateTime import RelativeDateTime, today, DateTime, localtime
|
|||
from tools import config
|
||||
class mrp_repair(osv.osv):
|
||||
_name = 'mrp.repair'
|
||||
_description = 'Repairs Order'
|
||||
|
||||
_description = 'Repairs Order'
|
||||
|
||||
def _amount_untaxed(self, cr, uid, ids, field_name, arg, context):
|
||||
res = {}
|
||||
cur_obj=self.pool.get('res.currency')
|
||||
|
@ -98,7 +98,7 @@ class mrp_repair(osv.osv):
|
|||
("none","No Invoice"),
|
||||
("b4repair","Before Repair"),
|
||||
("after_repair","After Repair")
|
||||
], "Invoice Method",
|
||||
], "Invoice Method",
|
||||
select=True, required=True, states={'draft':[('readonly',False)]}, readonly=True, help='This field allow you to change the workflow of the repair order. If value selected is different from \'No Invoice\', it also allow you to select the pricelist and invoicing address.'),
|
||||
'invoice_id': fields.many2one('account.invoice', 'Invoice', readonly=True),
|
||||
'picking_id': fields.many2one('stock.picking', 'Packing',readonly=True),
|
||||
|
@ -112,7 +112,7 @@ class mrp_repair(osv.osv):
|
|||
'amount_tax': fields.function(_amount_tax, method=True, string='Taxes'),
|
||||
'amount_total': fields.function(_amount_total, method=True, string='Total'),
|
||||
}
|
||||
|
||||
|
||||
_defaults = {
|
||||
'state': lambda *a: 'draft',
|
||||
'deliver_bool': lambda *a: True,
|
||||
|
@ -120,10 +120,10 @@ class mrp_repair(osv.osv):
|
|||
'invoice_method': lambda *a: 'none',
|
||||
'pricelist_id': lambda self, cr, uid,context : self.pool.get('product.pricelist').search(cr,uid,[('type','=','sale')])[0]
|
||||
}
|
||||
|
||||
|
||||
def copy(self, cr, uid, id, default=None, context=None):
|
||||
if not default:
|
||||
default = {}
|
||||
default = {}
|
||||
default.update({
|
||||
'state':'draft',
|
||||
'repaired':False,
|
||||
|
@ -134,17 +134,17 @@ class mrp_repair(osv.osv):
|
|||
})
|
||||
return super(mrp_repair, self).copy(cr, uid, id, default, context)
|
||||
|
||||
|
||||
|
||||
def onchange_product_id(self, cr, uid, ids, product_id=None):
|
||||
return {'value': {
|
||||
'prodlot_id': False,
|
||||
'move_id': False,
|
||||
'guarantee_limit' :False,
|
||||
'location_id': False,
|
||||
'prodlot_id': False,
|
||||
'move_id': False,
|
||||
'guarantee_limit' :False,
|
||||
'location_id': False,
|
||||
'location_dest_id': False,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
def onchange_move_id(self, cr, uid, ids, prod_id=False, move_id=False):
|
||||
data = {}
|
||||
data['value'] = {}
|
||||
|
@ -166,7 +166,7 @@ class mrp_repair(osv.osv):
|
|||
d = self.onchange_partner_id(cr, uid, ids, data['value']['partner_id'], data['value']['address_id'])
|
||||
data['value'].update(d['value'])
|
||||
return data
|
||||
|
||||
|
||||
def button_dummy(self, cr, uid, ids, context=None):
|
||||
return True
|
||||
|
||||
|
@ -182,7 +182,7 @@ class mrp_repair(osv.osv):
|
|||
partner = self.pool.get('res.partner').browse(cr, uid, part)
|
||||
pricelist = partner.property_product_pricelist and partner.property_product_pricelist.id or False
|
||||
return {'value': {
|
||||
'address_id': address_id or addr['delivery'],
|
||||
'address_id': address_id or addr['delivery'],
|
||||
'partner_invoice_id': addr['invoice'],
|
||||
'pricelist_id': pricelist
|
||||
}
|
||||
|
@ -201,7 +201,7 @@ class mrp_repair(osv.osv):
|
|||
return data
|
||||
lot_info = self.pool.get('stock.production.lot').browse(cr, uid, lot)
|
||||
move_ids = self.pool.get('stock.move').search(cr, uid, [('prodlot_id', '=', lot)])
|
||||
|
||||
|
||||
if not len(move_ids):
|
||||
return data
|
||||
|
||||
|
@ -216,7 +216,7 @@ class mrp_repair(osv.osv):
|
|||
d = self.onchange_move_id(cr, uid, ids, product_id, move.id)
|
||||
data['value'].update(d['value'])
|
||||
return data
|
||||
|
||||
|
||||
def action_cancel_draft(self, cr, uid, ids, *args):
|
||||
if not len(ids):
|
||||
return False
|
||||
|
@ -235,10 +235,10 @@ class mrp_repair(osv.osv):
|
|||
if (o.invoice_method == 'b4repair'):
|
||||
self.write(cr, uid, [o.id], {'state': '2binvoiced'})
|
||||
else:
|
||||
self.write(cr, uid, [o.id], {'state': 'confirmed'})
|
||||
self.write(cr, uid, [o.id], {'state': 'confirmed'})
|
||||
mrp_line_obj.write(cr, uid, [l.id for l in o.operations], {'state': 'confirmed'})
|
||||
return True
|
||||
|
||||
|
||||
def action_cancel(self, cr, uid, ids, context=None):
|
||||
ok=True
|
||||
mrp_line_obj = self.pool.get('mrp.repair.line')
|
||||
|
@ -251,7 +251,7 @@ class mrp_repair(osv.osv):
|
|||
return self.action_invoice_create(cr, uid, ids)
|
||||
|
||||
def action_invoice_create(self, cr, uid, ids, group=False, context=None):
|
||||
res={}
|
||||
res={}
|
||||
invoices_group = {}
|
||||
for repair in self.browse(cr, uid, ids, context=context):
|
||||
res[repair.id]=False
|
||||
|
@ -263,10 +263,10 @@ class mrp_repair(osv.osv):
|
|||
if (repair.invoice_method != 'none'):
|
||||
if group and repair.partner_invoice_id.id in invoices_group:
|
||||
inv_id= invoices_group[repair.partner_invoice_id.id]
|
||||
invoice=invoice_obj.browse(cr, uid,inv_id)
|
||||
invoice=invoice_obj.browse(cr, uid,inv_id)
|
||||
invoice_vals = {
|
||||
'name': invoice.name +', '+repair.name,
|
||||
'origin': invoice.origin+', '+repair.name,
|
||||
'origin': invoice.origin+', '+repair.name,
|
||||
'comment':(comment and (invoice.comment and invoice.comment+"\n"+comment or comment)) or (invoice.comment and invoice.comment or ''),
|
||||
}
|
||||
invoice_obj.write(cr, uid, [inv_id],invoice_vals,context=context)
|
||||
|
@ -284,9 +284,9 @@ class mrp_repair(osv.osv):
|
|||
}
|
||||
inv_obj = self.pool.get('account.invoice')
|
||||
inv_id = inv_obj.create(cr, uid, inv)
|
||||
invoices_group[repair.partner_invoice_id.id] = inv_id
|
||||
self.write(cr, uid, repair.id , {'invoiced':True,'invoice_id' : inv_id})
|
||||
|
||||
invoices_group[repair.partner_invoice_id.id] = inv_id
|
||||
self.write(cr, uid, repair.id , {'invoiced':True,'invoice_id' : inv_id})
|
||||
|
||||
for operation in repair.operations:
|
||||
if operation.to_invoice == True:
|
||||
if group:
|
||||
|
@ -294,7 +294,7 @@ class mrp_repair(osv.osv):
|
|||
else:
|
||||
name = operation.name
|
||||
invoice_line_id=self.pool.get('account.invoice.line').create(cr, uid, {
|
||||
'invoice_id': inv_id,
|
||||
'invoice_id': inv_id,
|
||||
'name': name,
|
||||
'origin':repair.name,
|
||||
'account_id': a,
|
||||
|
@ -340,17 +340,17 @@ class mrp_repair(osv.osv):
|
|||
def action_repair_start(self, cr, uid, ids, context=None):
|
||||
self.write(cr, uid, ids, {'state':'under_repair'})
|
||||
return True
|
||||
|
||||
|
||||
def action_invoice_end(self, cr, uid, ids, context=None):
|
||||
for order in self.browse(cr, uid, ids):
|
||||
val = {}
|
||||
val = {}
|
||||
if (order.invoice_method=='b4repair'):
|
||||
val['state'] = 'ready'
|
||||
else:
|
||||
#val['state'] = 'done'
|
||||
pass
|
||||
self.write(cr, uid, [order.id], val)
|
||||
return True
|
||||
return True
|
||||
|
||||
def action_repair_end(self, cr, uid, ids, context=None):
|
||||
for order in self.browse(cr, uid, ids):
|
||||
|
@ -364,16 +364,16 @@ class mrp_repair(osv.osv):
|
|||
#val['state'] = 'done'
|
||||
pass
|
||||
self.write(cr, uid, [order.id], val)
|
||||
return True
|
||||
return True
|
||||
|
||||
def wkf_repair_done(self, cr, uid, ids, *args):
|
||||
res=self.action_repair_done(cr,uid,ids)
|
||||
return True
|
||||
|
||||
|
||||
def action_repair_done(self, cr, uid, ids, context=None):
|
||||
res = {}
|
||||
res = {}
|
||||
company = self.pool.get('res.users').browse(cr, uid, uid).company_id
|
||||
for repair in self.browse(cr, uid, ids, context=context):
|
||||
for repair in self.browse(cr, uid, ids, context=context):
|
||||
for move in repair.operations:
|
||||
move_id = self.pool.get('stock.move').create(cr, uid, {
|
||||
'name': move.name,
|
||||
|
@ -421,25 +421,25 @@ class mrp_repair(osv.osv):
|
|||
else:
|
||||
self.write(cr, uid, [repair.id], {'state':'done'})
|
||||
return res
|
||||
|
||||
|
||||
|
||||
|
||||
mrp_repair()
|
||||
|
||||
|
||||
class ProductChangeMixin(object):
|
||||
def product_id_change(self, cr, uid, ids, pricelist, product, uom=False, product_uom_qty=0, partner_id=False, guarantee_limit=False):
|
||||
result = {}
|
||||
warning = {}
|
||||
warning = {}
|
||||
|
||||
if not product_uom_qty:
|
||||
product_uom_qty = 1
|
||||
result['product_uom_qty'] = product_uom_qty
|
||||
result['product_uom_qty'] = product_uom_qty
|
||||
|
||||
if product:
|
||||
product_obj = self.pool.get('product.product').browse(cr, uid, product)
|
||||
if partner_id:
|
||||
partner = self.pool.get('res.partner').browse(cr, uid, partner_id)
|
||||
result['tax_id'] = self.pool.get('account.fiscal.position').map_tax(cr, uid, partner, product_obj.taxes_id)
|
||||
result['tax_id'] = self.pool.get('account.fiscal.position').map_tax(cr, uid, partner.property_account_position, product_obj.taxes_id)
|
||||
|
||||
result['name'] = product_obj.partner_ref
|
||||
result['product_uom'] = product_obj.uom_id and product_obj.uom_id.id or False
|
||||
|
@ -453,7 +453,7 @@ class ProductChangeMixin(object):
|
|||
else:
|
||||
price = self.pool.get('product.pricelist').price_get(cr, uid, [pricelist],
|
||||
product, product_uom_qty, partner_id, {'uom': uom,})[pricelist]
|
||||
|
||||
|
||||
if price is False:
|
||||
warning={
|
||||
'title':'No valid pricelist line found !',
|
||||
|
@ -463,19 +463,19 @@ class ProductChangeMixin(object):
|
|||
}
|
||||
else:
|
||||
result.update({'price_unit': price, 'price_subtotal' :price*product_uom_qty})
|
||||
|
||||
|
||||
return {'value': result, 'warning': warning}
|
||||
|
||||
|
||||
|
||||
class mrp_repair_line(osv.osv, ProductChangeMixin):
|
||||
_name = 'mrp.repair.line'
|
||||
_description = 'Repair Operations Lines'
|
||||
|
||||
|
||||
def copy(self, cr, uid, id, default=None, context=None):
|
||||
if not default: default = {}
|
||||
default.update( {'invoice_line_id':False,'move_id':False,'invoiced':False,'state':'draft'})
|
||||
return super(mrp_repair_line, self).copy(cr, uid, id, default, context)
|
||||
|
||||
|
||||
def _amount_line(self, cr, uid, ids, field_name, arg, context):
|
||||
res = {}
|
||||
cur_obj=self.pool.get('res.currency')
|
||||
|
@ -493,7 +493,7 @@ class mrp_repair_line(osv.osv, ProductChangeMixin):
|
|||
'product_id': fields.many2one('product.product', 'Product', domain=[('sale_ok','=',True)], required=True),
|
||||
'invoiced': fields.boolean('Invoiced',readonly=True),
|
||||
'price_unit': fields.float('Unit Price', required=True, digits=(16, int(config['price_accuracy']))),
|
||||
'price_subtotal': fields.function(_amount_line, method=True, string='Subtotal',digits=(16, int(config['price_accuracy']))),
|
||||
'price_subtotal': fields.function(_amount_line, method=True, string='Subtotal',digits=(16, int(config['price_accuracy']))),
|
||||
'tax_id': fields.many2many('account.tax', 'repair_operation_line_tax', 'repair_operation_line_id', 'tax_id', 'Taxes'),
|
||||
'product_uom_qty': fields.float('Quantity (UoM)', digits=(16,2), required=True),
|
||||
'product_uom': fields.many2one('product.uom', 'Product UoM', required=True),
|
||||
|
@ -507,7 +507,7 @@ class mrp_repair_line(osv.osv, ProductChangeMixin):
|
|||
'state': lambda *a: 'draft',
|
||||
'product_uom_qty':lambda *a:1,
|
||||
}
|
||||
|
||||
|
||||
def onchange_operation_type(self, cr, uid, ids, type, guarantee_limit):
|
||||
if not type:
|
||||
return {'value': {
|
||||
|
@ -568,6 +568,6 @@ class mrp_repair_fee(osv.osv, ProductChangeMixin):
|
|||
_defaults = {
|
||||
'to_invoice': lambda *a: True,
|
||||
}
|
||||
|
||||
|
||||
mrp_repair_fee()
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -200,7 +200,7 @@ class purchase_order(osv.osv):
|
|||
_description = "Purchase order"
|
||||
_order = "name desc"
|
||||
|
||||
def unlink(self, cr, uid, ids):
|
||||
def unlink(self, cr, uid, ids, context=None):
|
||||
purchase_orders = self.read(cr, uid, ids, ['state'])
|
||||
unlink_ids = []
|
||||
for s in purchase_orders:
|
||||
|
@ -208,7 +208,7 @@ class purchase_order(osv.osv):
|
|||
unlink_ids.append(s['id'])
|
||||
else:
|
||||
raise osv.except_osv(_('Invalid action !'), _('Cannot delete Purchase Order(s) which are in %s State!' % s['state']))
|
||||
return osv.osv.unlink(self, cr, uid, unlink_ids)
|
||||
return super(purchase_order, self).unlink(cr, uid, unlink_ids, context=context)
|
||||
|
||||
def button_dummy(self, cr, uid, ids, context={}):
|
||||
return True
|
||||
|
@ -301,7 +301,8 @@ class purchase_order(osv.osv):
|
|||
raise osv.except_osv(_('Error !'), _('There is no expense account defined for this product: "%s" (id:%d)') % (ol.product_id.name, ol.product_id.id,))
|
||||
else:
|
||||
a = self.pool.get('ir.property').get(cr, uid, 'property_account_expense_categ', 'product.category')
|
||||
a = self.pool.get('account.fiscal.position').map_account(cr, uid, o.partner_id, a)
|
||||
fpos = o.fiscal_position or False
|
||||
a = self.pool.get('account.fiscal.position').map_account(cr, uid, fpos, a)
|
||||
il.append(self.inv_line_create(a,ol))
|
||||
|
||||
a = o.partner_id.property_account_payable.id
|
||||
|
@ -445,7 +446,7 @@ class purchase_order_line(osv.osv):
|
|||
return super(purchase_order_line, self).copy(cr, uid, id, default, context)
|
||||
|
||||
def product_id_change(self, cr, uid, ids, pricelist, product, qty, uom,
|
||||
partner_id, date_order=False):
|
||||
partner_id, date_order=False, fiscal_position=False):
|
||||
if not pricelist:
|
||||
raise osv.except_osv(_('No Pricelist !'), _('You have to select a pricelist in the purchase form !\nPlease set one before choosing a product.'))
|
||||
if not product:
|
||||
|
@ -488,7 +489,8 @@ class purchase_order_line(osv.osv):
|
|||
|
||||
partner = self.pool.get('res.partner').browse(cr, uid, partner_id)
|
||||
taxes = self.pool.get('account.tax').browse(cr, uid,map(lambda x: x.id, prod.supplier_taxes_id))
|
||||
res['value']['taxes_id'] = self.pool.get('account.fiscal.position').map_tax(cr, uid, partner, taxes)
|
||||
fpos = fiscal_position and self.pool.get('account.fiscal.position').browse(cr, uid, fiscal_position) or False
|
||||
res['value']['taxes_id'] = self.pool.get('account.fiscal.position').map_tax(cr, uid, fpos, taxes)
|
||||
|
||||
res2 = self.pool.get('product.uom').read(cr, uid, [uom], ['category_id'])
|
||||
res3 = prod.uom_id.category_id.id
|
||||
|
|
|
@ -172,7 +172,7 @@
|
|||
<form string="Purchase Order Line">
|
||||
<notebook>
|
||||
<page string="Order Line">
|
||||
<field colspan="4" context="partner_id=parent.partner_id,quantity=product_qty,pricelist=parent.pricelist_id,uom=product_uom,warehouse=parent.warehouse_id" name="product_id" on_change="product_id_change(parent.pricelist_id,product_id,product_qty,product_uom,parent.partner_id, parent.date_order)"/>
|
||||
<field colspan="4" context="partner_id=parent.partner_id,quantity=product_qty,pricelist=parent.pricelist_id,uom=product_uom,warehouse=parent.warehouse_id" name="product_id" on_change="product_id_change(parent.pricelist_id,product_id,product_qty,product_uom,parent.partner_id, parent.date_order, parent.fiscal_position)"/>
|
||||
<field name="product_qty"/>
|
||||
<field name="product_uom" on_change="product_uom_change(parent.pricelist_id,product_id,product_qty,product_uom,parent.partner_id, parent.date_order)"/>
|
||||
<field colspan="4" name="name"/>
|
||||
|
|
|
@ -140,6 +140,7 @@
|
|||
<images/>
|
||||
<story>
|
||||
<para style="terp_default_8">[[ repeatIn(objects,'o') ]]</para>
|
||||
<para style="terp_default_8">[[ setLang(o.partner_id.lang) ]]</para>
|
||||
<para style="P5">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
|
@ -158,11 +159,11 @@
|
|||
<td>
|
||||
<para style="P5">[[ repeatIn(o.dest_address_id and [o.dest_address_id] or [],'addr') ]]</para>
|
||||
<para style="P4">Shipping address :</para>
|
||||
<para style="P5">[[ o.partner_id.title or '' ]][[ o.partner_id.name ]]</para>
|
||||
<para style="P5">[[ addr.title or '' ]][[ addr.name ]]</para>
|
||||
<para style="P5">[[ o.partner_id.title or '' ]] [[ o.partner_id.name ]]</para>
|
||||
<para style="P5">[[ addr.title or '' ]] [[ addr.name ]]</para>
|
||||
<para style="P5">[[ addr.street ]]</para>
|
||||
<para style="P5">[[ addr.street2 or '' ]]</para>
|
||||
<para style="P5">[[ addr.zip or '' ]][[ addr.city or '' ]]</para>
|
||||
<para style="P5">[[ addr.zip or '' ]] [[ addr.city or '' ]]</para>
|
||||
<para style="P5">[[ addr.state_id and addr.state_id.name or '' ]]</para>
|
||||
<para style="P5">[[ addr.country_id and addr.country_id.name or '' ]]</para>
|
||||
</td>
|
||||
|
@ -178,11 +179,11 @@
|
|||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P5">[[ o.partner_id.title or '' ]][[ o.partner_id.name ]]</para>
|
||||
<para style="P5">[[ o.partner_address_id.title or '' ]][[ o.partner_address_id.name ]]</para>
|
||||
<para style="P5">[[ o.partner_id.title or '' ]] [[ o.partner_id.name ]]</para>
|
||||
<para style="P5">[[ o.partner_address_id.title or '' ]] [[ o.partner_address_id.name ]]</para>
|
||||
<para style="P5">[[ o.partner_address_id.street ]]</para>
|
||||
<para style="P5">[[ o.partner_address_id.street2 or '' ]]</para>
|
||||
<para style="P5">[[ o.partner_address_id.zip or '' ]][[ o.partner_address_id.city or '' ]]</para>
|
||||
<para style="P5">[[ o.partner_address_id.zip or '' ]] [[ o.partner_address_id.city or '' ]]</para>
|
||||
<para style="P5">[[ o.partner_address_id.state_id and o.partner_address_id.state_id.name or '' ]]</para>
|
||||
<para style="P5">[[ o.partner_address_id.country_id and o.partner_address_id.country_id.name or '' ]]</para>
|
||||
<para style="P5">
|
||||
|
@ -203,7 +204,7 @@
|
|||
<para style="Standard">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="P6">[[ (o.state=='draft' or removeParentNode('font')) and 'Request for Quotation' ]][[ (o.state<>'draft' or removeParentNode('font')) and 'Purchase Order Confirmation' ]] N° [[ o.name ]]</para>
|
||||
<para style="P6">[[ (o.state=='draft' or removeParentNode('font')) and 'Request for Quotation' ]] [[ (o.state<>'draft' or removeParentNode('font')) and 'Purchase Order Confirmation' ]] N° [[ o.name ]]</para>
|
||||
<para style="terp_default_8">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
|
@ -229,20 +230,20 @@
|
|||
<para style="terp_default_Centre_8">[[ o.name or '' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Centre_8">[[ o.partner_ref or '' ]]</para>
|
||||
<para style="terp_default_Centre_8">[[ o.partner_ref or '' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Centre_8">[[ time.strftime('%d/%m/%Y', time.strptime(o.date_order, '%Y-%m-%d')) ]]</para>
|
||||
<para style="terp_default_Centre_8">[[formatLang(o.date_order,date=True) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Centre_8">[[ o.validator and o.validator.name or '' ]]</para>
|
||||
<para style="terp_default_Centre_8">[[ o.validator and o.validator.name or '' ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="terp_default_9">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="251.0,52.0,62.0,46.0,59.0,62.0" repeatRows="1" style="Table_Header_Pur_ord_Line">
|
||||
<blockTable colWidths="251.0,53.0,62.0,47.0,59.0,62.0" repeatRows="1" style="Table_Header_Pur_ord_Line">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Description</para>
|
||||
|
@ -266,19 +267,19 @@
|
|||
</blockTable>
|
||||
<section>
|
||||
<para style="terp_default_8">[[ repeatIn(o.order_line,'line') ]]</para>
|
||||
<blockTable colWidths="252.0,52.0,61.0,28.0,20.0,59.0,63.0" style="Table_Order_Pur_line_Content">
|
||||
<blockTable colWidths="252.0,52.0,61.0,29.0,20.0,59.0,63.0" style="Table_Order_Pur_line_Content">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ line.name ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ ', '.join(map(lambda x: x.name, line.taxes_id)) or '0.00' ]]</para>
|
||||
<para style="terp_default_9">[[ ', '.join(map(lambda x: x.name, line.taxes_id)) or '0.00' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ time.strftime('%d/%m/%Y', time.strptime( line.date_planned, '%Y-%m-%d %H:%M:%S')) ]]</para>
|
||||
<para style="terp_default_9">[[ formatLang( line.date_planned, date=True) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ line.product_qty or '0.00' ]]</para>
|
||||
<para style="terp_default_Right_9">[[ line.product_qty or '0.00' ]] </para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ line.product_uom.name ]]</para>
|
||||
|
@ -341,7 +342,7 @@
|
|||
<para style="terp_default_Right_9">[[ o.amount_untaxed or '0.00' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ o.pricelist_id.currency_id.name ]]</para>
|
||||
<para style="terp_default_Right_9">[[ o.pricelist_id.currency_id.name ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -357,7 +358,7 @@
|
|||
<para style="terp_default_Right_9">[[ o.amount_tax or '0.00' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ o.pricelist_id.currency_id.name ]]</para>
|
||||
<para style="terp_default_Right_9">[[ o.pricelist_id.currency_id.name ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -391,4 +392,4 @@
|
|||
<font color="white"> </font>
|
||||
</para>
|
||||
</story>
|
||||
</document>
|
||||
</document>
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
<paraStyle name="Index" fontName="Times-Roman"/>
|
||||
<paraStyle name="Footer" fontName="Times-Roman"/>
|
||||
<paraStyle name="Horizontal Line" fontName="Times-Roman" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
|
||||
<paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="15.0" leading="15" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
|
@ -70,7 +70,7 @@
|
|||
</stylesheet>
|
||||
<images/>
|
||||
<story>
|
||||
<para style="terp_default_9">[[ repeatIn(objects,'order') ]]</para>
|
||||
<para style="terp_default_9">[[repeatIn(objects,'order')]]</para>
|
||||
<para style="terp_default_9">[[ setLang(order.partner_id.lang) ]]</para>
|
||||
<blockTable colWidths="250.0,59.0,221.0" style="Table_Address_Detail">
|
||||
<tr>
|
||||
|
@ -81,7 +81,7 @@
|
|||
<para style="terp_default_9">[[ (order.warehouse_id and order.warehouse_id.partner_address_id and order.warehouse_id.partner_address_id.street) or order.partner_address_id.street ]]</para>
|
||||
<para style="terp_default_9">[[ (order.warehouse_id and order.warehouse_id.partner_address_id and order.warehouse_id.partner_address_id.street2) or order.partner_address_id.street2 ]]</para>
|
||||
<para style="terp_default_9">[[ (order.warehouse_id and order.warehouse_id.partner_address_id and order.warehouse_id.partner_address_id.zip) or order.partner_address_id.zip ]] [[ (order.warehouse_id and order.warehouse_id.partner_address_id and order.warehouse_id.partner_address_id.city) or order.partner_address_id.city ]]</para>
|
||||
<para style="terp_default_9">[[(order.warehouse_id and order.warehouse_id.partner_address_id and order.warehouse_id.partner_address_id.state_id and order.warehouse_id.partner_address_id.state_id.name) or order.partner_address_id and order.partner_address_id.state_id and order.partner_address_id.state_id.name ]] [[(order.warehouse_id and order.warehouse_id.partner_address_id and order.warehouse_id.partner_address_id.country_id and order.warehouse_id.partner_address_id.country_id.name) or order.partner_address_id.country_id.name ]]</para>
|
||||
<para style="terp_default_9">[[(order.warehouse_id and order.warehouse_id.partner_address_id and order.warehouse_id.partner_address_id.state_id and order.warehouse_id.partner_address_id.state_id.name) or order.partner_address_id and order.partner_address_id.state_id and order.partner_address_id.state_id.name]] [[(order.warehouse_id and order.warehouse_id.partner_address_id and order.warehouse_id.partner_address_id.country_id and order.warehouse_id.partner_address_id.country_id.name) or order.partner_address_id.country_id.name ]]</para>
|
||||
<para style="terp_default_9">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
|
@ -96,7 +96,7 @@
|
|||
<para style="terp_default_9">[[ (order.partner_address_id and order.partner_address_id.title) or '' ]] [[ order.partner_address_id.name ]] </para>
|
||||
<para style="terp_default_9">[[ (order.partner_address_id and order.partner_address_id.street) or '']] [[ order.partner_address_id.street2 ]]</para>
|
||||
<para style="terp_default_9">[[ (order.partner_address_id and order.partner_address_id.zip) or '' ]] [[ (order.partner_address_id and order.partner_address_id.city) or '' ]]</para>
|
||||
<para style="terp_default_9">[[ (order.partner_address_id and order.partner_address_id.state_id and order.partner_address_id.state_id.code) or '' ]] [[ (order.partner_address_id and order.partner_address_id.country_id and order.partner_address_id.country_id.code) or '' ]]</para>
|
||||
<para style="terp_default_9">[[ order.partner_address_id.state_id.code ]] [[ (order.partner_address_id and order.partner_address_id.country_id and order.partner_address_id.country_id.code) or '' ]]</para>
|
||||
<para style="terp_default_9">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
|
@ -134,7 +134,7 @@
|
|||
<para style="terp_default_9">[[ order_line.name ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Centre_9">[[ time.strftime('%d/%m/%Y', time.strptime( order_line.date_planned, '%Y-%m-%d %H:%M:%S')) ]]</para>
|
||||
<para style="terp_default_Centre_9">[[ formatLang(order_line.date_planned, date = True) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ order_line.product_qty or '' ]]</para>
|
||||
|
@ -161,6 +161,9 @@
|
|||
<para style="terp_default_9">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="Space bet user and signature">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="terp_default_9">[[ user.signature or '' ]]</para>
|
||||
</story>
|
||||
</document>
|
||||
|
|
|
@ -10,28 +10,11 @@
|
|||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="AddressTable">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table1">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
|
||||
<lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="3,0" stop="3,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="OrderTable">
|
||||
<blockTableStyle id="Table2">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
|
||||
|
@ -48,7 +31,24 @@
|
|||
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="3,0" stop="3,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="HeadingTable">
|
||||
<blockTableStyle id="Table3">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
|
||||
<lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="3,0" stop="3,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table4">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
|
||||
|
@ -58,7 +58,7 @@
|
|||
<lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="5,-1" stop="5,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Order_Desc_Table">
|
||||
<blockTableStyle id="Table5">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
|
||||
|
@ -69,7 +69,7 @@
|
|||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="5,-1" stop="5,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="6,-1" stop="6,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Total_Table">
|
||||
<blockTableStyle id="Table6">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#ffffff" start="0,0" stop="0,0"/>
|
||||
|
@ -84,20 +84,26 @@
|
|||
<lineStyle kind="LINEABOVE" colorName="#000000" start="2,2" stop="2,2"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#000000" start="3,2" stop="3,2"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Partner_Note_Table">
|
||||
<blockTableStyle id="Table7">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<initialize>
|
||||
<paraStyle name="all" alignment="justify"/>
|
||||
</initialize>
|
||||
<paraStyle name="P1" fontName="Helvetica-Oblique" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P2" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P3" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P4" rightIndent="0.0" leftIndent="14.0" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P5" rightIndent="0.0" leftIndent="11.0" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P6" rightIndent="0.0" leftIndent="-2.0" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P7" rightIndent="0.0" leftIndent="11.0" fontName="Helvetica-Oblique" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P1" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P2" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P3" rightIndent="0.0" leftIndent="14.0" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P4" rightIndent="0.0" leftIndent="11.0" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P5" rightIndent="0.0" leftIndent="-2.0" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P6" rightIndent="0.0" leftIndent="11.0" fontName="Helvetica-Oblique" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P7" fontName="Helvetica-Oblique" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P8" rightIndent="0.0" leftIndent="14.0" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P10" rightIndent="0.0" leftIndent="-2.0" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P11" rightIndent="0.0" leftIndent="11.0" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P12" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P13" rightIndent="0.0" leftIndent="11.0" fontName="Helvetica-Oblique" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="Standard" fontName="Times-Roman"/>
|
||||
<paraStyle name="Text body" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Heading" fontName="Helvetica" fontSize="8.0" leading="10" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
|
@ -134,25 +140,24 @@
|
|||
</stylesheet>
|
||||
<images/>
|
||||
<story>
|
||||
<para style="terp_default_8">[[ repeatIn(objects,'o') ]]</para>
|
||||
<para style="terp_default_8">[[repeatIn(objects,'o')]]</para>
|
||||
<para style="terp_default_8">[[ setLang(o.partner_id.lang) ]]</para>
|
||||
<blockTable colWidths="265.0,51.0,225.0" style="AddressTable">
|
||||
<blockTable colWidths="265.0,51.0,225.0" style="Table1">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">Shipping address :</para>
|
||||
<para style="terp_default_9">[[ o.partner_id.title or '' ]][[ o.partner_id.name ]]</para>
|
||||
<para style="terp_default_9">[[ o.partner_shipping_id.title or '' ]][[ o.partner_shipping_id.name ]]</para>
|
||||
<para style="terp_default_9">[[ o.partner_id.title or '' ]] [[ o.partner_id.name ]]</para>
|
||||
<para style="terp_default_9">[[ o.partner_shipping_id.title or '' ]] [[ o.partner_shipping_id.name ]]</para>
|
||||
<para style="terp_default_9">[[ o.partner_shipping_id.street ]]</para>
|
||||
<para style="terp_default_9">[[ o.partner_shipping_id.street2 or '' ]]</para>
|
||||
<para style="terp_default_9">[[ o.partner_shipping_id.city or '' ]] [[ o.partner_shipping_id.zip or '' ]]</para>
|
||||
<para style="terp_default_9">[[ o.partner_shipping_id.state_id and o.partner_shipping_id.state_id.name or '' ]][[ o.partner_shipping_id.country_id and o.partner_shipping_id.country_id.name or '' ]]</para>
|
||||
<para style="terp_default_9">[[ o.partner_shipping_id.street2 or '' ]]</para>
|
||||
<para style="terp_default_9">[[ o.partner_shipping_id.city or '' ]] [[ o.partner_shipping_id.zip or '' ]]</para>
|
||||
<para style="terp_default_9">[[ o.partner_shipping_id.state_id and o.partner_shipping_id.state_id.name or '' ]] [[ o.partner_shipping_id.country_id and o.partner_shipping_id.country_id.name or '' ]]</para>
|
||||
<para style="terp_default_9">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="terp_default_Bold_9">Invoice address :</para>
|
||||
<para style="terp_default_9">[[ o.partner_invoice_id.street ]][[ o.partner_invoice_id.street2 and (', %s' % o.partner_invoice_id.street2 or '') ]]</para>
|
||||
<para style="terp_default_9">[[ o.partner_invoice_id.city or '' ]] [[ o.partner_invoice_id.zip or '' ]]</para>
|
||||
<para style="terp_default_9">[[ o.partner_invoice_id.country_id and ('%s' % (o.partner_invoice_id.country_id and o.partner_invoice_id.country_id.name or '')) ]]</para>
|
||||
<para style="terp_default_9">[[ o.partner_invoice_id.street ]] [[ o.partner_invoice_id.street2 and (', %s' % o.partner_invoice_id.street2 or '') ]]</para>
|
||||
<para style="terp_default_9">[[ o.partner_invoice_id.zip or '' ]] [[ o.partner_invoice_id.city or '' ]] [[ o.partner_invoice_id.country_id and (', %s' % (o.partner_invoice_id.country_id and o.partner_invoice_id.country_id.name or '')) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_8">
|
||||
|
@ -160,17 +165,17 @@
|
|||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ o.partner_id.title or '' ]][[ o.partner_id.name ]]</para>
|
||||
<para style="terp_default_9">[[ o.partner_order_id.title or '' ]][[ o.partner_order_id.name ]]</para>
|
||||
<para style="terp_default_9">[[ o.partner_id.title or '' ]] [[ o.partner_id.name ]]</para>
|
||||
<para style="terp_default_9">[[ o.partner_order_id.title or '' ]] [[ o.partner_order_id.name ]]</para>
|
||||
<para style="terp_default_9">[[ o.partner_order_id.street ]]</para>
|
||||
<para style="terp_default_9">[[ o.partner_order_id.street2 or '' ]]</para>
|
||||
<para style="terp_default_9">[[ o.partner_order_id.city or '' ]] [[ o.partner_order_id.zip or '' ]]</para>
|
||||
<para style="terp_default_9">[[ o.partner_order_id.state_id and o.partner_order_id.state_id.name or '' ]][[ o.partner_order_id.country_id and o.partner_order_id.country_id.name or '' ]]</para>
|
||||
<para style="terp_default_9">[[ o.partner_order_id.zip or '' ]] [[ o.partner_order_id.city or '' ]]</para>
|
||||
<para style="terp_default_9">[[ o.partner_order_id.state_id and o.partner_order_id.state_id.name or '' ]] [[ o.partner_order_id.country_id and o.partner_order_id.country_id.name or '' ]]</para>
|
||||
<para style="terp_default_9">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="terp_default_9">Tel. : [[ o.partner_order_id.phone or removeParentNode('para') ]]</para>
|
||||
<para style="terp_default_9">Fax : [[ o.partner_order_id.fax or removeParentNode('para') ]]</para>
|
||||
<para style="terp_default_9">Fax : [[ o.partner_order_id.fax or removeParentNode('para') ]]</para>
|
||||
<para style="terp_default_9">TVA : [[ o.partner_id.vat or removeParentNode('para') ]]</para>
|
||||
<para style="terp_default_9">
|
||||
<font color="white"> </font>
|
||||
|
@ -186,7 +191,7 @@
|
|||
<para style="terp_default_8">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="132.0,134.0,135.0,135.0" style="Table1">
|
||||
<blockTable colWidths="132.0,134.0,135.0,135.0" style="Table2">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Centre">Your Reference </para>
|
||||
|
@ -202,13 +207,13 @@
|
|||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="132.0,134.0,135.0,135.0" style="OrderTable">
|
||||
<blockTable colWidths="132.0,134.0,135.0,135.0" style="Table3">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_Centre_8">[[ o.name ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Centre_8">[[ o.date_order ]]</para>
|
||||
<para style="terp_default_Centre_8">[[ formatLang(o.date_order,date = True) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Centre_8">[[ o.user_id.name ]]</para>
|
||||
|
@ -221,7 +226,7 @@
|
|||
<para style="terp_default_8">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="208.0,99.0,64.0,59.0,43.0,65.0" repeatRows="1" style="HeadingTable">
|
||||
<blockTable colWidths="208.0,99.0,64.0,59.0,43.0,65.0" repeatRows="1" style="Table4">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Description</para>
|
||||
|
@ -244,34 +249,34 @@
|
|||
</tr>
|
||||
</blockTable>
|
||||
<section>
|
||||
<para style="terp_default_1">[[ repeatIn(o.order_line,'line') ]]</para>
|
||||
<blockTable colWidths="207.0,99.0,43.0,21.0,59.0,43.0,65.0" style="Order_Desc_Table">
|
||||
<para style="terp_default_1">[[repeatIn(o.order_line,'line')]]</para>
|
||||
<blockTable colWidths="208.0,99.0,43.0,21.0,59.0,43.0,65.0" style="Table5">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ line.name ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Centre_9">[[ ', '.join(map(lambda x: x.name, line.tax_id)) or '0.00' ]]</para>
|
||||
<para style="terp_default_Centre_9">[[formatLang( ', '.join(map(lambda x: x.name, line.tax_id))) or '0.00' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ line.product_uos and line.product_uos_qty or line.product_uom_qty or '0.00']]</para>
|
||||
<para style="terp_default_Right_9">[[ formatLang(line.product_uos and line.product_uos_qty or line.product_uom_qty) or '0.00']] </para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ line.product_uos and line.product_uos.name or line.product_uom.name ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ line.price_unit or '0.00' ]]</para>
|
||||
<para style="terp_default_Right_9">[[ formatLang(line.price_unit) or '0.00' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ line.discount and str(line.discount) or '0.00' ]]</para>
|
||||
<para style="terp_default_Right_9">[[ formatLang(line.discount) and str(line.discount) or '0.00' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ line.price_subtotal or '0.00' ]]</para>
|
||||
<para style="terp_default_Right_9">[[ formatLang(line.price_subtotal) or '0.00' ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P7">[[ format(line.notes or removeParentNode('tr')) ]]</para>
|
||||
<para style="P6">[[ format(line.notes or removeParentNode('tr')) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Centre_9">
|
||||
|
@ -306,7 +311,7 @@
|
|||
</tr>
|
||||
</blockTable>
|
||||
</section>
|
||||
<blockTable colWidths="384.0,67.0,64.0,22.0" style="Total_Table">
|
||||
<blockTable colWidths="384.0,67.0,64.0,22.0" style="Table6">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9">
|
||||
|
@ -314,13 +319,13 @@
|
|||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P6">Net Total :</para>
|
||||
<para style="P5">Net Total :</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ o.amount_untaxed or '0.00' ]]</para>
|
||||
<para style="terp_default_Right_9">[[ formatLang(o.amount_untaxed) or '0.00' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P2">[[ o.pricelist_id.currency_id.name ]]</para>
|
||||
<para style="P1">[[ o.pricelist_id.currency_id.name ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -330,13 +335,13 @@
|
|||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P5">Taxes :</para>
|
||||
<para style="P4">Taxes :</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ o.amount_tax or '0.00' ]]</para>
|
||||
<para style="terp_default_Right_9">[[ formatLang(o.amount_tax) or '0.00' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P2">[[ o.pricelist_id.currency_id.name ]]</para>
|
||||
<para style="P1">[[ o.pricelist_id.currency_id.name ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -346,20 +351,20 @@
|
|||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">Total :</para>
|
||||
<para style="P3">Total :</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9_Bold">[[ o.amount_total or '0.00' ]] </para>
|
||||
<para style="terp_default_Right_9_Bold">[[ formatLang(o.amount_total) or '0.00' ]] </para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3">[[ o.pricelist_id.currency_id.name ]]</para>
|
||||
<para style="P2">[[ o.pricelist_id.currency_id.name ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="terp_default_8">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="533.0" style="Partner_Note_Table">
|
||||
<blockTable colWidths="533.0" style="Table7">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ format(o.note or '') ]]</para>
|
||||
|
@ -371,7 +376,7 @@
|
|||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="P1">
|
||||
<para style="P7">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</story>
|
||||
|
|
|
@ -785,7 +785,8 @@ class sale_order_line(osv.osv):
|
|||
if uosqty:
|
||||
pu = round(line.price_unit * line.product_uom_qty / uosqty,
|
||||
int(config['price_accuracy']))
|
||||
a = self.pool.get('account.fiscal.position').map_account(cr, uid, line.order_id.partner_id, a)
|
||||
fpos = line.order_id.fiscal_position or False
|
||||
a = self.pool.get('account.fiscal.position').map_account(cr, uid, fpos, a)
|
||||
inv_id = self.pool.get('account.invoice.line').create(cr, uid, {
|
||||
'name': line.name,
|
||||
'origin':line.order_id.name,
|
||||
|
@ -849,7 +850,7 @@ class sale_order_line(osv.osv):
|
|||
|
||||
def product_id_change(self, cr, uid, ids, pricelist, product, qty=0,
|
||||
uom=False, qty_uos=0, uos=False, name='', partner_id=False,
|
||||
lang=False, update_tax=True, date_order=False, packaging=False):
|
||||
lang=False, update_tax=True, date_order=False, packaging=False, fiscal_position=False):
|
||||
warning={}
|
||||
product_uom_obj = self.pool.get('product.uom')
|
||||
partner_obj = self.pool.get('res.partner')
|
||||
|
@ -905,11 +906,11 @@ class sale_order_line(osv.osv):
|
|||
result .update({'type': product_obj.procure_method})
|
||||
if product_obj.description_sale:
|
||||
result['notes'] = product_obj.description_sale
|
||||
|
||||
fpos = fiscal_position and self.pool.get('account.fiscal.position').browse(cr, uid, fiscal_position) or False
|
||||
if update_tax: #The quantity only have changed
|
||||
result['delay'] = (product_obj.sale_delay or 0.0)
|
||||
partner = partner_obj.browse(cr, uid, partner_id)
|
||||
result['tax_id'] = self.pool.get('account.fiscal.position').map_tax(cr, uid, partner, product_obj.taxes_id)
|
||||
result['tax_id'] = self.pool.get('account.fiscal.position').map_tax(cr, uid, fpos, product_obj.taxes_id)
|
||||
|
||||
result['name'] = product_obj.partner_ref
|
||||
domain = {}
|
||||
|
|
|
@ -118,19 +118,19 @@
|
|||
<field colspan="4"
|
||||
context="partner_id=parent.partner_id,quantity=product_uom_qty,pricelist=parent.pricelist_id,shop=parent.shop_id,uom=product_uom"
|
||||
name="product_id"
|
||||
on_change="product_id_change(parent.pricelist_id,product_id,product_uom_qty,product_uom,product_uos_qty,product_uos,name,parent.partner_id, 'lang' in context and context['lang'], True, parent.date_order, product_packaging)"
|
||||
on_change="product_id_change(parent.pricelist_id,product_id,product_uom_qty,product_uom,product_uos_qty,product_uos,name,parent.partner_id, 'lang' in context and context['lang'], True, parent.date_order, product_packaging, parent.fiscal_position)"
|
||||
select="1"/>
|
||||
<field
|
||||
context="partner_id=parent.partner_id,quantity=product_uom_qty,pricelist=parent.pricelist_id,shop=parent.shop_id,uom=product_uom"
|
||||
name="product_uom_qty"
|
||||
on_change="product_id_change(parent.pricelist_id,product_id,product_uom_qty,product_uom,product_uos_qty,product_uos,name,parent.partner_id, 'lang' in context and context['lang'], False, parent.date_order, product_packaging)"
|
||||
on_change="product_id_change(parent.pricelist_id,product_id,product_uom_qty,product_uom,product_uos_qty,product_uos,name,parent.partner_id, 'lang' in context and context['lang'], False, parent.date_order, product_packaging, parent.fiscal_position)"
|
||||
select="1"/>
|
||||
<field name="product_uom"
|
||||
on_change="product_uom_change(parent.pricelist_id,product_id,product_uom_qty,product_uom,product_uos_qty,product_uos,name,parent.partner_id, 'lang' in context and context['lang'], False, parent.date_order)"/>
|
||||
<field
|
||||
name="product_packaging"
|
||||
context="partner_id=parent.partner_id,quantity=product_uom_qty,pricelist=parent.pricelist_id,shop=parent.shop_id,uom=product_uom"
|
||||
on_change="product_id_change(parent.pricelist_id,product_id,product_uom_qty,product_uom,product_uos_qty,product_uos,name,parent.partner_id, 'lang' in context and context['lang'], False, parent.date_order, product_packaging)"
|
||||
on_change="product_id_change(parent.pricelist_id,product_id,product_uom_qty,product_uom,product_uos_qty,product_uos,name,parent.partner_id, 'lang' in context and context['lang'], False, parent.date_order, product_packaging, parent.fiscal_position)"
|
||||
domain="[('product_id','=',product_id)]"
|
||||
groups="base.group_extended"/>
|
||||
<separator colspan="4" string="Manual Description"/>
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
multi="True"
|
||||
string="Make invoices"/>
|
||||
|
||||
<wizard string="Advance Payment"
|
||||
<wizard string="Advance Invoice"
|
||||
model="sale.order"
|
||||
name="sale.advance_payment_inv"
|
||||
id="sale.advance_payment"
|
||||
|
|
|
@ -587,7 +587,7 @@ class stock_picking(osv.osv):
|
|||
return self.pool.get('account.fiscal.position').map_tax(
|
||||
cursor,
|
||||
user,
|
||||
move_line.picking_id.address_id.partner_id,
|
||||
move_line.picking_id.address_id.partner_id.property_account_position,
|
||||
taxes
|
||||
)
|
||||
else:
|
||||
|
@ -630,15 +630,15 @@ class stock_picking(osv.osv):
|
|||
address_contact_id, address_invoice_id = \
|
||||
self._get_address_invoice(cursor, user, picking).values()
|
||||
|
||||
comment = self._get_comment_invoice(cursor, user, picking)
|
||||
comment = self._get_comment_invoice(cursor, user, picking)
|
||||
if group and partner.id in invoices_group:
|
||||
invoice_id = invoices_group[partner.id]
|
||||
invoice=invoice_obj.browse(cursor, user,invoice_id)
|
||||
invoice=invoice_obj.browse(cursor, user,invoice_id)
|
||||
invoice_vals = {
|
||||
'name': invoice.name +', '+picking.name,
|
||||
'origin': invoice.origin+', '+picking.name+(picking.origin and (':' + picking.origin) or ''),
|
||||
'origin': invoice.origin+', '+picking.name+(picking.origin and (':' + picking.origin) or ''),
|
||||
'comment':(comment and (invoice.comment and invoice.comment+"\n"+comment or comment)) or (invoice.comment and invoice.comment or ''),
|
||||
}
|
||||
}
|
||||
invoice_obj.write(cursor, user, [invoice_id],invoice_vals,context=context)
|
||||
else:
|
||||
invoice_vals = {
|
||||
|
@ -690,7 +690,7 @@ class stock_picking(osv.osv):
|
|||
account_analytic_id = self._get_account_analytic_invoice(cursor,
|
||||
user, picking, move_line)
|
||||
|
||||
account_id = self.pool.get('account.fiscal.position').map_account(cursor, user, partner, account_id)
|
||||
account_id = self.pool.get('account.fiscal.position').map_account(cursor, user, partner.property_account_position, account_id)
|
||||
invoice_line_id = invoice_line_obj.create(cursor, user, {
|
||||
'name': name,
|
||||
'origin':origin,
|
||||
|
@ -1071,8 +1071,8 @@ class stock_move(osv.osv):
|
|||
self.write(cr, uid, ids, {'state':'cancel', 'move_dest_id': False})
|
||||
|
||||
for pick in self.pool.get('stock.picking').browse(cr,uid,pickings.keys()):
|
||||
if all(move.state == 'cancle' for move in pick.move_lines):
|
||||
self.pool.get('stock.picking').write(cr,uid,[pick.id],{'state':'cancel'})
|
||||
if all(move.state == 'cancel' for move in pick.move_lines):
|
||||
self.pool.get('stock.picking').write(cr,uid,[pick.id],{'state':'cancel'})
|
||||
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
for id in ids:
|
||||
|
|
Loading…
Reference in New Issue