[IMP]improve pos config form view and add group on warehouse

bzr revid: sgo@tinyerp.com-20130207065126-1liwmg1u3emnra6j
This commit is contained in:
sgo@tinyerp.com
2013-02-07 12:21:26 +05:30
parent d0e2c54663
commit bc17621cec
2 changed files with 17 additions and 9 deletions
+2 -1
View File
@@ -114,7 +114,8 @@ class pos_config(osv.osv):
return res and res[0] or False
def _default_warehouse(self, cr, uid, context=None):
res = self.pool.get('stock.warehouse').search(cr, uid, [])
user = self.pool.get('res.users').browse(cr, uid, uid, context)
res = self.pool.get('stock.warehouse').search(cr, uid, [('company_id','=',user.company_id.id)], context)
return res and res[0] or False
def _default_pricelist(self, cr, uid, context=None):
+15 -8
View File
@@ -769,13 +769,20 @@
</header>
<sheet>
<label for="name" class="oe_edit_only"/>
<h1>
<field name="name"/>
</h1>
<group>
<field name="name"/>
<field name="warehouse_id" widget="selection" groups="stock.group_locations" />
<field name="journal_id" widget="selection" />
<field name="pricelist_id" groups="product.group_sale_pricelist"/>
<field name="sequence_id" readonly="1" groups="base.group_no_one" />
<field name="group_by" groups="account.group_account_user" />
<group>
<field name="warehouse_id" widget="selection" groups="stock.group_locations" />
<field name="pricelist_id" groups="product.group_sale_pricelist"/>
<field name="sequence_id" readonly="1" groups="base.group_no_one" />
</group>
<group>
<field name="journal_id" widget="selection" />
<field name="group_by" groups="account.group_account_user" />
</group>
</group>
<separator string="Available Payment Methods" colspan="4"/>
<field name="journal_ids" colspan="4" nolabel="1">
@@ -810,7 +817,7 @@
<field name="arch" type="xml">
<tree string="Point of Sale Configuration" colors="grey:state == 'inactive'">
<field name="name" />
<field name="warehouse_id" />
<field name="warehouse_id" groups="stock.group_locations"/>
<field name="state" />
</tree>
</field>
@@ -824,7 +831,7 @@
<field name="name" />
<filter string="Active" domain="[('state', '=', 'active')]" />
<filter string="Inactive" domain="[('state', '=', 'inactive')]" />
<field name="warehouse_id" />
<field name="warehouse_id" groups="stock.group_locations" />
</search>
</field>
</record>