'child_id': fields.one2many('product.category', 'parent_id', string='Child Categories'),
'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of product categories."),
'type': fields.selection([('view','View'), ('normal','Normal')], 'Category Type'),
- 'property_stock_variation': fields.property(
- 'account.account',
- type='many2one',
- relation='account.account',
- string="Stock variation Account",
- method=True,
- view_load=True, help="This account will be used in product when valuation type is real-time valuation ",),
}
'price_extra': fields.float('Variant Price Extra', digits_compute=dp.get_precision('Sale Price')),
'price_margin': fields.float('Variant Price Margin', digits_compute=dp.get_precision('Sale Price')),
'pricelist_id': fields.dummy(string='Pricelist',relation='product.pricelist', type='many2one'),
- 'valuation':fields.selection([('manual_periodic','Manual Periodic Valuation'),
- ('real_time','Real Time valuation'),
- ('','')],'Valuation',help="Decide if the system must automatically creates account moves based on stock moves"),
}
def onchange_uom(self, cursor, user, ids, uom_id,uom_po_id):
<field name="name">Stock Weight</field>
<field name="digits">2</field>
</record>
- <record forcecreate="True" id="property_stock_variation" model="ir.property">
- <field name="name">property_stock_variation</field>
- <field name="fields_id" search="[('model','=','product.category'),('name','=','property_stock_variation')]"/>
- <field eval="'account.account,'+str(ref('account.a_recv'))" model="account.account" name="value"/>
- <field name="company_id" ref="base.main_company"/>
- </record>
+
</data>
</openerp>
<field name="price_extra" groups="base.group_extended"/>
<newline/>
<field groups="base.group_extended" name="cost_method"/>
- <field name="valuation"/>
<newline/>
<field colspan="4" name="seller_ids" nolabel="1"/>
</page>
'track_incoming': fields.boolean('Track Incoming Lots', help="Forces to use a tracking lot during receptions"),
'track_outgoing': fields.boolean('Track Outgoing Lots', help="Forces to use a tracking lot during deliveries"),
'location_id': fields.dummy(string='Location', relation='stock.location', type='many2one', domain=[('usage','=','internal')]),
+ 'valuation':fields.selection([('manual_periodic','Manual Periodic Valuation'),
+ ('real_time','Real Time valuation'),
+ ('','')],'Valuation',help="Decide if the system must automatically creates account moves based on stock moves"),
}
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
res = super(product_product,self).fields_view_get(cr, uid, view_id, view_type, context, toolbar=toolbar, submenu=submenu)
type='many2one', relation='account.account',
string='Stock Output Account', method=True, view_load=True,
help='This account will be used to value the output stock'),
+ 'property_stock_variation': fields.property(
+ 'account.account',
+ type='many2one',
+ relation='account.account',
+ string="Stock variation Account",
+ method=True,
+ view_load=True, help="This account will be used in product when valuation type is real-time valuation ",),
}
product_category()
<field name="property_stock_account_input_categ" domain="[('type','<>','view'),('type','<>','consolidation')]"/>
<field name="property_stock_account_output_categ" domain="[('type','<>','view'),('type','<>','consolidation')]"/>
<field name="property_stock_journal"/>
+ <field name="property_stock_variation"/>
</group>
</form>
</field>
<field name="inherit_id" ref="product.product_normal_form_view"/>
<field name="arch" type="xml">
<field name="standard_price" position="replace">
+ <field name="valuation"/>
<label string="Cost Price" align="1.0"/>
<group col="2" colspan="1">
<field name="standard_price" readonly="True" nolabel="1"/>
<field name="company_id" ref="res_company_tinyshop0"/>
<field name="lot_input_id" ref="stock_location_shop1"/>
</record>
-
+
+ <record forcecreate="True" id="property_stock_variation" model="ir.property">
+ <field name="name">property_stock_variation</field>
+ <field name="fields_id" search="[('model','=','product.category'),('name','=','property_stock_variation')]"/>
+ <field eval="'account.account,'+str(ref('account.a_recv'))" model="account.account" name="value"/>
+ <field name="company_id" ref="base.main_company"/>
+ </record>
</data>
</openerp>