Skip to content
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

Merged
merged 1 commit into from
Nov 13, 2023
Merged

Conversation

liuhehe1995
Copy link
Contributor

Copy link
Contributor

@kanda999 kanda999 left a 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="担当者"/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<field name="user_id" string="担当者"/>
<field name="user_id" />

Add translations instead of using string to name columns

Copy link
Contributor Author

@liuhehe1995 liuhehe1995 Nov 8, 2023

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 "販売担当者".

Copy link
Contributor

@rinaldifirdaus rinaldifirdaus Nov 8, 2023

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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 -->
Copy link
Contributor

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 -->
Copy link
Contributor

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.

Copy link
Contributor Author

@liuhehe1995 liuhehe1995 Nov 8, 2023

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"],
Copy link
Contributor

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)

Copy link
Contributor Author

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"],

Copy link
Member

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.

Copy link
Contributor Author

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"],

Copy link
Contributor

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>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<data>

</xpath>
</field>
</record>
</data>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
</data>

Copy link
Contributor Author

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.

Copy link
Member

@yostashiro yostashiro left a 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.

Copy link
Member

@yostashiro yostashiro left a 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.

@liuhehe1995 liuhehe1995 changed the title [3923][ADD]account_invoice_view_adj [3923][ADD]account_view_adj Nov 10, 2023
@liuhehe1995 liuhehe1995 force-pushed the 3923-add-account_invoice_view_adj branch from 5017294 to e8149dd Compare November 10, 2023 05:02
Copy link
Member

@yostashiro yostashiro left a 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.

Comment on lines 4 to 5
"name": "Account Invoice View Adjust",
"category": "Invoicing",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"name": "Account Invoice View Adjust",
"category": "Invoicing",
"name": "Account View Adjust",
"category": "Accounting",

"author": "Quartile Limited",
"website": "https://www.quartile.co",
"version": "11.0.1.0.0",
"depends": ["base", "account"],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"depends": ["base", "account"],
"depends": ["account"],

Copy link
Member

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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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">
Copy link
Member

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)?

Copy link
Contributor Author

@liuhehe1995 liuhehe1995 Nov 10, 2023

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.

@yostashiro yostashiro changed the title [3923][ADD]account_view_adj [3923][ADD] account_view_adj Nov 10, 2023
@@ -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">
Copy link
Member

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.

Copy link
Contributor Author

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'.

@liuhehe1995 liuhehe1995 force-pushed the 3923-add-account_invoice_view_adj branch 2 times, most recently from 639e481 to 3924b68 Compare November 13, 2023 04:31
Maintainers
~~~~~~~~~~~

This module is maintained by the OCA.
Copy link
Member

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.

Copy link
Contributor

@rinaldifirdaus rinaldifirdaus left a 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.

Copy link
Member

@yostashiro yostashiro left a 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.

Comment on lines 3 to 12
<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>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix the indentation.

@yostashiro yostashiro merged commit 923e70d into 11.0 Nov 13, 2023
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants