← Back to team overview

openerp-community team mailing list archive

Re: Suggestion for OCA conventions

 

Hi Sandy,

If we do like this with an example on a module:
2 models modified: 'product.product' and 'product.category' with adding a
new field for each
It takes 5 or 20 lines by model. Having 2 files for this could be a lot.
I prefer one file named 'product.py'.

And if the code grows too much, the file can be split in 2

Maybe the limitation could be the file lines number ?

What do you think ?

Should odoo small modules takes java convention ? I don't think.




David BEAL - Akretion
Odoo Development / Integration
+33 (0)6 67 22 86 89 - +33 (0)4 82 53 84 60

2014-10-17 21:40 GMT+02:00 Sandy Carter <sandy.carter@xxxxxxxxxxxxxxxxxxxx>:

> Hi,
>
> I would like propose adding the following to the Module section in
> http://odoo-community.org/page/website.how-to
>
> Each XML and python script should be separated and named by model.
>
> example:
>
> _name = 'sale.order'  # goes in a file named sale_order.py and the class
> name should be SaleOrder
>
> _inherit = 'sale.order.line'  # goes in a file named sale_order_line.py
> and the class name should be SaleOrderLine
>
> <!-- Goes in a file named res_partner_data.xml -->
> <!-- Or goes in a file named res_partner_demo.xml -->
> <record name="example_partner" model="res.partner">...</record>
>
> <!-- Goes in a file named res_company_view.xml -->
> <record id="res_company_form" model="ir.ui.view">
>   <field name="model">res.company</field>
>   ...
> </record>
>
> <!-- Goes in a file named purchase_order_workflow.xml -->
> <record id="purchase_order_workflow" model="ir.ui.view">
>   <field name="osv">purchase.order</field>
>   ...
> </record>
>
> <!-- Goes in a file named payment_order_report.xml -->
> <report id="payment_order_report"
>         model="payment.order"
>         ...
>         />
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~openerp-community
> Post to     : openerp-community@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~openerp-community
> More help   : https://help.launchpad.net/ListHelp
>
>

Follow ups

References