[MERGE] merge sbh branch => Product Backlog 475 : Account_move when stock_move base on product

bzr revid: mra@mra-laptop-20100609094124-ij406ig8jrvs68br
This commit is contained in:
Mustufa Rangwala
2010-06-09 15:11:24 +05:30
7 changed files with 36 additions and 22 deletions
+2 -2
View File
@@ -265,10 +265,10 @@
<para style="terp_default_Centre_8">[[ formatLang(o.date_planned, date_time = True) ]]</para>
</td>
<td>
<para style="terp_default_Centre_8">[[ o.sale_ref or ' ' ]]</para>
<para style="terp_default_Centre_8">[[ o.sale_ref or removeParentNode('para')]]</para>
</td>
<td>
<para style="terp_default_Centre_8">[[ o.sale_name or '' ]]</para>
<para style="terp_default_Centre_8">[[ o.sale_name or removeParentNode('para') ]]</para>
</td>
</tr>
</blockTable>
-10
View File
@@ -209,13 +209,6 @@ class product_category(osv.osv):
'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 ",),
}
@@ -465,9 +458,6 @@ class product_product(osv.osv):
'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):
+1 -6
View File
@@ -145,11 +145,6 @@ parameter) will see those record just disappear.
<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>
-2
View File
@@ -148,7 +148,6 @@
<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>
@@ -217,7 +216,6 @@
<field name="name" select="1"/>
<field name="parent_id"/>
<field name="sequence" invisible="1"/>
<field name="property_stock_variation"/>
<field name="type"/>
<newline/>
</form>
+10
View File
@@ -312,6 +312,9 @@ class product_product(osv.osv):
'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)
@@ -417,6 +420,13 @@ class product_category(osv.osv):
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()
+16 -1
View File
@@ -28,6 +28,10 @@
<field name="property_stock_account_output_categ" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"/>
<field name="property_stock_journal"/>
</group>
<group col="2" colspan="2">
<separator string="Variation Stock Properties" colspan="4"/>
<field name="property_stock_variation"/>
</group>
</form>
</field>
</record>
@@ -122,7 +126,18 @@
</group>
</field>
</record>
<record id="view_product_valuation_form" model="ir.ui.view">
<field name="name">product.valuation.form.inherit</field>
<field name="model">product.product</field>
<field name="type">form</field>
<field name="inherit_id" ref="product.product_normal_form_view"/>
<field name="arch" type="xml">
<field name="cost_method" position="after">
<field name="valuation"/>
</field>
</field>
</record>
</data>
</openerp>
+7 -1
View File
@@ -288,7 +288,13 @@
<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>