[IMP] restrict some fields to base.group_user

- sales orders buttons Create Final Invoice, Open Delivery Order, Advance Invoice, Cancel
- products costs (but kanban view needs to handle the 'groups' attribute)

bzr revid: abo@openerp.com-20120531171652-ynjqjw8hmccnh9fo
This commit is contained in:
Antonin Bourguignon 2012-05-31 19:16:52 +02:00
parent 35c1c5fe3d
commit 380acb99a2
4 changed files with 33 additions and 27 deletions

View File

@ -298,7 +298,7 @@ class product_template(osv.osv):
'rental': fields.boolean('Can be Rent'),
'categ_id': fields.many2one('product.category','Category', required=True, change_default=True, domain="[('type','=','normal')]" ,help="Select category for the current product"),
'list_price': fields.float('Sale Price', digits_compute=dp.get_precision('Sale Price'), help="Base price for computing the customer price. Sometimes called the catalog price."),
'standard_price': fields.float('Cost Price', required=True, digits_compute=dp.get_precision('Purchase Price'), help="Product's cost for accounting stock valuation. It is the base price for the supplier price."),
'standard_price': fields.float('Cost Price', required=True, digits_compute=dp.get_precision('Purchase Price'), help="Product's cost for accounting stock valuation. It is the base price for the supplier price.", groups="base.group_user"),
'volume': fields.float('Volume', help="The volume in m3."),
'weight': fields.float('Gross Weight', digits_compute=dp.get_precision('Stock Weight'), help="The gross weight in Kg."),
'weight_net': fields.float('Net Weight', digits_compute=dp.get_precision('Stock Weight'), help="The net weight in Kg."),

View File

@ -221,7 +221,8 @@
<t t-if="record.type.raw_value != 'service'">
<div>Stock: <field name="qty_available"/> on hand, <field name="virtual_available"/> available</div>
<div t-if="record.list_price.raw_value != 0">Public Price: <field name="lst_price"/></div>
<div>Cost : <field name="standard_price"/></div>
<!-- TODO would deserve to be hidden at the field level -->
<div groups="base.group_user">Cost : <field name="standard_price"/></div>
</t>
<div class="oe_kanban_clear"/>
</div>

View File

@ -98,31 +98,35 @@
<field name="arch" type="xml">
<form layout="manual">
<div class="oe_form_topbar">
<button name="invoice_recreate" states="invoice_except" string="Recreate Invoice"/>
<button name="invoice_corrected" states="invoice_except" string="Ignore Exception"/>
<button name="ship_recreate" states="shipping_except" string="Recreate Delivery Order"/>
<button name="ship_corrected" states="shipping_except" string="Ignore Exception"/>
<button name="action_quotation_send" string="Send by Mail" type="object" states="draft" class="oe_form_button_hi"/>
<button name="action_quotation_send" string="Send by Mail" type="object" states="sent"/>
<button name="manual_invoice" states="manual" string="Create Final Invoice" type="object"/>
<button name="print_quotation" string="Send by Post" type="object" states="draft" class="oe_form_button_hi"/>
<button name="print_quotation" string="Send by Post" type="object" states="sent"/>
<button name="order_confirm" states="draft" string="Confirm"/>
<button name="order_confirm" states="sent" string="Confirm" class="oe_form_button_hi"/>
<button name="action_view_invoice" string="Open Invoice" type="object"
attrs="{'invisible': ['|','|',('state', '!=','progress'), ('invoiced', '=', True),('order_policy','=','picking')]}"/>
<button name="action_view_delivery" string="Open Delivery Order" type="object"
attrs="{'invisible': ['|','|','|',('picking_ids','=',False),('picking_ids','=',[]), ('state', 'not in', ('progress','manual')),('shipped','=',True)]}"/>
<button name="%(action_view_sale_advance_payment_inv)d" string="Advance Invoice" type="action" states="manual"/>
<button name="cancel" states="draft,sent" string="Cancel"/>
<button name="action_cancel" states="manual,progress" string="Cancel" type="object"/>
<button name="ship_cancel" states="shipping_except" string="Cancel"/>
<button name="invoice_cancel" states="invoice_except" string="Cancel"/>
<div class="oe_right">
<field name="state" nolabel="1" widget="statusbar" statusbar_visible="draft,sent,progress,invoiced,done" statusbar_colors='{"shipping_except":"red","invoice_except":"red","waiting_date":"blue"}'/>
<span groups="base.group_user">
<button name="invoice_recreate" states="invoice_except" string="Recreate Invoice"/>
<button name="invoice_corrected" states="invoice_except" string="Ignore Exception"/>
<button name="ship_recreate" states="shipping_except" string="Recreate Delivery Order"/>
<button name="ship_corrected" states="shipping_except" string="Ignore Exception"/>
<button name="action_quotation_send" string="Send by Mail" type="object" states="draft" class="oe_form_button_hi"/>
<button name="action_quotation_send" string="Send by Mail" type="object" states="sent"/>
<button name="manual_invoice" states="manual" string="Create Final Invoice" type="object"/>
<button name="print_quotation" string="Send by Post" type="object" states="draft" class="oe_form_button_hi"/>
<button name="print_quotation" string="Send by Post" type="object" states="sent"/>
<button name="order_confirm" states="draft" string="Confirm"/>
<button name="order_confirm" states="sent" string="Confirm" class="oe_form_button_hi"/>
<button name="action_view_invoice" string="Open Invoice" type="object"
attrs="{'invisible': ['|','|',('state', '!=','progress'), ('invoiced', '=', True),('order_policy','=','picking')]}"/>
<button name="action_view_delivery" string="Open Delivery Order" type="object"
attrs="{'invisible': ['|','|','|',('picking_ids','=',False),('picking_ids','=',[]), ('state', 'not in', ('progress','manual')),('shipped','=',True)]}"/>
<button name="%(action_view_sale_advance_payment_inv)d" string="Advance Invoice" type="action" states="manual"/>
<button name="cancel" states="draft,sent" string="Cancel"/>
<button name="action_cancel" states="manual,progress" string="Cancel" type="object"/>
<button name="ship_cancel" states="shipping_except" string="Cancel"/>
<button name="invoice_cancel" states="invoice_except" string="Cancel"/>
</span>
<div class="oe_right">
<field name="state" nolabel="1" widget="statusbar" statusbar_visible="draft,sent,progress,invoiced,done" statusbar_colors='{"shipping_except":"red","invoice_except":"red","waiting_date":"blue"}'/>
</div>
<div class="oe_clear"/>
</div>
<div class="oe_clear"/>
</div>
<sheet string="Sales Order" layout="auto">
<group col="6" colspan="4" class="oe_form_header">
<group col="4" colspan="4">

View File

@ -177,7 +177,8 @@
<li t-if="record.type.raw_value != 'service'">Stock on hand: <field name="qty_available"/> <field name="uom_id"/></li>
<li t-if="record.type.raw_value != 'service'">Stock available: <field name="virtual_available"/> <field name="uom_id"/></li>
<li>Price: <field name="lst_price"></field></li>
<li>Cost: <field name="standard_price"></field></li>
<!-- TODO the 'groups' attribute doesn't work in kanban views -->
<li groups="base.group_user">Cost: <field name="standard_price"></field></li>
</ul>
<a name="%(action_receive_move)d" type="action">
<t t-if="record.reception_count.value">Receptions(<t t-esc="record.reception_count.value"/>)</t>