bzr revid: fp@tinyerp.com-20081105163608-zpga9iab2tsafze3
This commit is contained in:
Fabien Pinckaers 2008-11-05 17:36:08 +01:00
parent dcb4a7d4ff
commit 670589a750
3 changed files with 43 additions and 13 deletions

View File

@ -108,27 +108,46 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Files">
<notebook>
<page string="Definition">
<field name="name" select="1" colspan="4"/>
<field name="title" select="1" colspan="4"/>
<newline/>
<field name="datas"/>
<field name="file_size"/>
<newline/>
<field name="parent_id"/>
<newline/>
<group colspan="4" col="6">
<field name="name" select="1" />
<field name="create_uid" select="1"/>
<field name="create_date" select="1"/>
<field name="title" select="1"/>
<field name="user_id"/>
<field name="partner_id"/>
<newline/>
<field name="create_date"/>
<field name="create_uid"/>
<field name="write_date"/>
<field name="write_uid"/>
</group>
<notebook colspan="4">
<page string="Attachment">
<group col="2" colspan="2">
<separator string="Data" colspan="2"/>
<field name="datas" filename="datas_fname"/>
<field name="datas_fname" select="1"/>
<field name="file_size"/>
</group>
<group col="2" colspan="2">
<separator string="Attached To" colspan="2"/>
<field name="res_model" select="1"/>
<field name="res_id"/>
<field name="parent_id"/>
</group>
<separator string="Preview" colspan="4"/>
<field
name="preview"
widget="image"
readonly="1"
nolabel="1"
colspan="4"
img_height="400"
img_width="800"/>
</page><page string="Indexed Content">
<field name="index_content" nolabel="1" colspan="4" select="1"/>
</page><page string="Security">
<field name="group_ids" colspan="4" nolabel="1"/>
<page string="Notes">
<field colspan="4" name="description" nolabel="1"/>
</page>
</notebook>
</form>

View File

@ -41,6 +41,11 @@ class stock_picking(osv.osv):
'sale_id': lambda *a: False
}
def get_currency_id(self, cursor, user, picking):
if picking.sale_id:
return picking.sale_id.pricelist_id.currency_id.id
return False
def _get_address_invoice(self, cursor, user, picking):
res = {}
if picking.sale_id:

View File

@ -539,6 +539,9 @@ class stock_picking(osv.osv):
context=context)
return True
def get_currency_id(self, cursor, user, picking):
return False
def _get_address_invoice(self, cursor, user, picking):
'''Return {'contact': address, 'invoice': address} for invoice'''
partner_obj = self.pool.get('res.partner')
@ -635,6 +638,9 @@ class stock_picking(osv.osv):
'comment': comment,
'payment_term': payment_term_id,
}
cur_id = self.get_currency_id(cursor, user, picking)
if cur_id:
invoice_vals['currency_id'] = cur_id
if journal_id:
invoice_vals['journal_id'] = journal_id
invoice_id = invoice_obj.create(cursor, user, invoice_vals,