-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[3923][ADD] account_view_adj #361
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please run pre-commit before creating a PR. Also, please create a readme file.
<field name="arch" type="xml"> | ||
<xpath expr="//tree/field[@name='state']" position="before"> | ||
<!-- Adding the 'Responsible' field --> | ||
<field name="user_id" string="担当者"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<field name="user_id" string="担当者"/> | |
<field name="user_id" /> |
Add translations instead of using string
to name columns
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This field <field name="user_id" string="Responsible"/>
is inherited from "account.invoice.supplier.form"
and cannot be changed.
If I change it to<field name="user_id" />
and add a translation, the result will be "販売担当者".
account_invoice_view_adj/i18n/ja.po
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you should add blank line at the end of this file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is a generic views adjustment module for the account invoice, you better make the description generic.
please check how its written on purchase_view_adj or stock_view_adj.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for pointing this out.
account_invoice_view_adj :This module makes adjustments to account invoice related views.
Refer to:
purchase_view_adj :This module makes adjustments to purchase related views.
stock_view_adj :This module makes adjustments to stock related views.
<?xml version="1.0"?> | ||
<odoo> | ||
<data> | ||
<!-- Inherit the list view to add the 'Responsible' field --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this comment mean? If you read the code, you will know.
<field name="inherit_id" ref="account.invoice_supplier_tree"/> | ||
<field name="arch" type="xml"> | ||
<xpath expr="//tree/field[@name='state']" position="before"> | ||
<!-- Adding the 'Responsible' field --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment is the same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let it be known that adjustments are inherited from list view "account.invoice.supplier.tree
",
"Responsible
"field name come from form view "account.invoice.supplier.form
".
Refer to 135
I thought about it and decided comments wasn't necessary,
it's already written in the code.
"website": "https://www.quartile.co", | ||
"version": "11.0.1.0.0", | ||
"depends": ["base", "account"], | ||
"data": ["views/account_invoice_view_adj.xml"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename xml file with just model_name (eg. account_invoice_views.xml)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Change to "data": ["account_invoice_view_adj.xml"],
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@liuhehe1995 You misunderstood Lin's comment and the change hasn't been tested.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed it to
["views/account_view_adj.xml"],
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@liuhehe1995 You misunderstood still about Lin's comment. Please look at the names of the views in the other modules
@@ -0,0 +1,15 @@ | |||
<?xml version="1.0"?> | |||
<odoo> | |||
<data> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<data> |
</xpath> | ||
</field> | ||
</record> | ||
</data> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
</data> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
I know the reason for removing .
starting with Odoo version 11.0, the tag is optional and can be omitted when writing module data files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@liuhehe1995 Can you please rename the module to account_view_adj
so that we won't have to create another module when there is another minor adjustment request on views from account module.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@liuhehe1995 Make sure to check 'Files changed' yourself before asking for a review.
5017294
to
e8149dd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please regenerate readme file as well.
account_view_adj/__manifest__.py
Outdated
"name": "Account Invoice View Adjust", | ||
"category": "Invoicing", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"name": "Account Invoice View Adjust", | |
"category": "Invoicing", | |
"name": "Account View Adjust", | |
"category": "Accounting", |
account_view_adj/__manifest__.py
Outdated
"author": "Quartile Limited", | ||
"website": "https://www.quartile.co", | ||
"version": "11.0.1.0.0", | ||
"depends": ["base", "account"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"depends": ["base", "account"], | |
"depends": ["account"], |
account_view_adj/i18n/ja.po
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regenerate the translation file.
@@ -0,0 +1 @@ | |||
This module makes adjustments to account invoice related views. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This module makes adjustments to account invoice related views. | |
This module makes adjustments to account related views. |
@@ -0,0 +1,13 @@ | |||
<?xml version="1.0"?> | |||
<odoo> | |||
<record id="view_account_invoice_supplier_tree_inherit" model="ir.ui.view"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the adjustment only on supplier invoice tree (no need to adjust customer invoice side)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need.
On the Customer invoice side, the "販売担当者" is shown.
@@ -5,7 +5,7 @@ | |||
<field name="model">account.invoice</field> | |||
<field name="inherit_id" ref="account.invoice_supplier_tree"/> | |||
<field name="arch" type="xml"> | |||
<xpath expr="//tree/field[@name='number']" position="after"> | |||
<xpath expr="//tree/field[@name='is_invoice_issuer']" position="before"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can't do this as is_invoice_issuer
comes from a custom module. Use a field from account
module as the hook point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed the position of "Responsible" to before the 'date_due'.
639e481
to
3924b68
Compare
account_view_adj/README.rst
Outdated
Maintainers | ||
~~~~~~~~~~~ | ||
|
||
This module is maintained by the OCA. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This module is NOT maintained by OCA. Please regenerate readme with --org-name=qrtl
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Functional test: Work as expected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please include the setup files in this PR.
<record id="view_account_invoice_supplier_tree_inherit" model="ir.ui.view"> | ||
<field name="name">account.invoice.supplier.tree.inherit</field> | ||
<field name="model">account.invoice</field> | ||
<field name="inherit_id" ref="account.invoice_supplier_tree"/> | ||
<field name="arch" type="xml"> | ||
<xpath expr="//tree/field[@name='date_due']" position="before"> | ||
<field name="user_id" string="Responsible"/> | ||
</xpath> | ||
</field> | ||
</record> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix the indentation.
2ec673b
to
e1878f5
Compare
3923