Skip to content

Commit

Permalink
base for SO holding_amount
Browse files Browse the repository at this point in the history
  • Loading branch information
leemannd committed May 16, 2017
1 parent 1f8a714 commit c0573a6
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
6 changes: 2 additions & 4 deletions odoo/local-src/specific_sale/models/sale_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ class SaleOrder(models.Model):
string='Holding Currency Amount',
compute='_compute_holding_currency_amount',
readonly=True,
currency_field='holding_currency_id',
store=True,
currency_field='holding_currency_id'
)

@api.model
Expand Down Expand Up @@ -119,11 +119,9 @@ def _create_analytic_account(self, prefix=None):
)

@api.multi
@api.depends('amount_total', 'pricelist_id.currency_id',
'holding_currency_id')
@api.depends('amount_total', 'holding_currency_id')
def _compute_holding_currency_amount(self):
for so in self:
print so.holding_currency_id.name
if so.state in ('sale', 'done'):
so_date = so.confirmation_date
else:
Expand Down
24 changes: 24 additions & 0 deletions odoo/local-src/specific_sale/views/sale_order_crm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,30 @@
</field>
</record>

<record model="ir.ui.view" id="view_quotation_tree_holding">
<field name="name">sale.order.tree.holding</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_quotation_tree"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='amount_total']" position="after">
<field name="holding_currency_id" invisible="True"/>
<field name="holding_currency_amount" widget="monetary" sum="Total"/>
</xpath>
</field>
</record>

<record model="ir.ui.view" id="view_order_tree_holding">
<field name="name">sale.order.tree.holding</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_tree"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='amount_total']" position="after">
<field name="holding_currency_id" invisible="True"/>
<field name="holding_currency_amount" widget="monetary" sum="Total"/>
</xpath>
</field>
</record>

<record model="ir.ui.view" id="sale_margin_sale_order_line">
<field name="name">sale.order.line hide cost</field>
<field name="model">sale.order</field>
Expand Down

0 comments on commit c0573a6

Please sign in to comment.